Fix problem of dropping bad_times in spec file and y-scale divergence #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This fixes the issue noted on slack that after #123, any bad times in a model spec file that were not covered by the fitting range in
xija_gui_fit
would be dropped from the spec file.This PR makes
self.bad_times
be an unchanged copy of the original spec file value. Then after computing the indices (into the model times) of the intersecting bad times, only the indices get carried around on the object. Where the times are needed they are regenerated by indexing intomodel.times
.This also fixes (3f45047) an unrelated problem where each new bad time region that was plotted was expanding the y-axis limit by a multiplicative factor, leading to an exponential divergence in the y-scale with many bad regions. It isn't clear why this wasn't showing up a long time ago.
Interface impacts
None.
Testing
Unit tests
Functional tests
Dropped bad times
I made a copy of the flight
aca_spec.json
file and added a new bad time interval (not strictly necessary but I did it):Then using both
master
branch and this branch, I did:In both cases:
Using the
master
branch I saw that all the saved bad times outside of the fit range were missing.Using this branch I saw that the saved bad times matched exactly the original bad times.
Y-axis scaling
Using the MUPS model with thousands of bad regions with the master branch shows the divergence in y-scale with each new region that gets added to the plot. Running the same with this branch now shows the expected plot with every bad region having the same Y size.
I also tested manually adding an "ignore" filter and this worked OK.