-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply temperature-dependent drift model offset to fid positions #388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is a WIP but it looks really good and just needs a few changes and some testing. We should go ahead with this soon!
There is a slight complication here: The current code will break this because
|
Those kadi observations are an interesting use case. Thanks for bringing that up. |
I forgot -- I need to document the functional testing in here so that's still to-do. |
We probably also need to handle dates < 2012 explicitly (perhaps with a warning instead of rethrowing the valueerror from chandra_aca) if we want to leave this turned on and run old schedules in matlab regression for example. |
Good point about the 2012 cutoff from this code in
One idea is to just change the drift model to extrapolate back from 2012 with a constant via:
|
One more thing, can you make the notebook names more descriptive. I'd suggest:
|
Co-authored-by: Tom Aldcroft <[email protected]>
Co-authored-by: Tom Aldcroft <[email protected]>
Co-authored-by: Tom Aldcroft <[email protected]>
Co-authored-by: Tom Aldcroft <[email protected]>
proseco/core.py
Outdated
@@ -1487,7 +1487,8 @@ def add_fake_stars_from_fid( | |||
detector=detector, | |||
sim_offset=sim_offset, | |||
focus_offset=0, | |||
t_ccd=-10.0, | |||
t_ccd_guide=-10.0, | |||
t_ccd_acq=-10.0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be controversial, but it seems to be in the context of use in a test function that is in proseco.core (maybe should be somewhere in tests
?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can reverting this count as the test of changing the t_ccd
setter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just un-done this (makes sense at this point), though did your comment mean that you wanted me to remove some of my gratuitous t_ccd tests?
@@ -128,6 +131,7 @@ def t_ccd(self): | |||
@t_ccd.setter | |||
def t_ccd(self, value): | |||
self.t_ccd_guide = value | |||
self.t_ccd_acq = value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In more detailed review and testing, this was the change needed so that "get_fid_catalog" will mostly do the right thing if just a t_ccd is supplied. In that case the temperature is assigned to both t_ccd_guide and t_ccd_acq and fid offsets will be applied based on t_ccd_acq by default. This was already the default behavior for get_aca_catalog, but not for get_fid_catalog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
Is this ready again for review? BTW I put this as Squash and Merge, unless you are adamant that all 36 commits should go in the permanent history. |
Sure. I just made that change to add_fake_stars_from_fid and reran unit tests (did not re-run functional/notebook). This is ready for review again. And sure I don't care if we keep all the commits if this is approved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeanconn - I pushed a final commit with some cleanup. I re-reviewed the key validation notebook and code. It all looks good now, thanks for this important fix!
|
||
aca_args = STD_INFO.copy() | ||
for kw in ["t_ccd", "t_ccd_acq", "t_ccd_guide"]: | ||
if kw in aca_args: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, a one-line way to do this is aca_args.pop(kw, None)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if it ever comes up again, we could update mod_info()
(or whatever is that function) to allow for deleting kwargs via mod_info(delete_kwargs=("t_ccd", "t_ccd_acq", "t_ccd_guide"))
.
} | ||
|
||
|
||
def test_t_ccd_attr(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new tests!
Description
Update proseco to apply the time and temperature-dependent fid position offsets to the fid positions in proseco constructed catalogs. This code relies on
chandra_aca.drift.get_fid_offset
and the aimpoint drift model inchandra_models
.Interface impacts
Changes default behavior in proseco to apply offsets in y and z to expected fid positions via chandra_aca.drift.get_fid_offset. Respects new environment variable PROSECO_ENABLE_FID_OFFSET .
Testing
Requires sot/chandra_aca#157
Unit tests
Independent check of unit tests by @taldcroft
Functional tests
Added a unit test.
Reselected ~900 catalogs in two aca aimpoint drift model epochs and since the last safe modes (2023:044 and 2023:047) and confirmed proseco fid positions with the PR are overall reasonable compared to observed positions and that there are small mean offests since the last safe mode (expected). Also reviewed reselected star catalogs with critical warnings (with and without fid offsets applied) and confirmed proseco catalogs are reasonable (one new critical warning on an hrc fid light in a field with many spoiler stars).
Functional review notebook is part of the PR in the analysis directory https://github.com/sot/proseco/blob/5595c4c002814b82ccee2f20f4f084bd14850770/analysis/reselect_fid_offset.ipynb