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 into model.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
[x] Mac
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):
[
"2020:165:14:10:00",
"2020:170:00:00:00"
]
Then using both master branch and this branch, I did:
Confirm seeing the two expected bad time intervals marked in light blue on the plot.
Confirm that masked values are hidden in the residual plot.
Freeze all parameters and thaw a couple of solar heat P parameters
Fit and confirm things look OK with no obvious influence of the bad time intervals.
Save spec file as JSON
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.
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.