Fix issues related to large p_acq change for small T_ccd change#409
Fix issues related to large p_acq change for small T_ccd change#409
Conversation
| return spoilers | ||
|
|
||
|
|
||
| def force_even_and_on_ccd(val: int, offset: int) -> int: |
There was a problem hiding this comment.
This is a lightweight new function but seems like it should have some unit tests someplace in this PR.
There was a problem hiding this comment.
This is not really a public function and it is just 3 lines of very straightforward code. If these lines had been inlined in the original function there wouldn't be a question of unit testing.
|
What would be important for unit/functional tests is verification that the patch actually fixes items (1) and (2). I believe that (2) is done from the flight catalog in question, so it might be good to adapt this to a unit test. Verifying (1) is trickier and I need to think about it. |
|
For (1) I was thinking about just explicitly testing with synthetic dark map(s). |
|
Related to the in-person discussion yesterday with @jeanconn, I found the source of yet-another potential discontinuity here. Basically there will be a T_ccd value at which a new search hit appears (the 2x2 binned value exceeds the threshold). This adds new values to With the current algorithm relying on 2x2 search hits and PEA-ish behavior, I don't see an easy way around this. |
|
Yes, I was worried that search hits could change both based on the dark current scaling and on the way that maxmag may be modified with t_ccd. You've made the effect of the hits more smooth by the new interpolation in position space - it does seem like the remaining piece is to figure out how to make the "hits" themselves just a bit more stable with changing t_ccd. Or maybe the complexity for that just isn't worth it. Hmph. |
|
@jeanconn - somehow we both managed to miss a crucial point that would seem to invalidate the premise of this PR: Within proseco the yag/zag to row/col transforms alway use the same default ACA temperature of +20 C. That could mean that the issue is mostly (or entirely) related to new search hits crossing the threshold and bumping the imposter centroid around. This seems less easy to fix. |
|
Ah, well I think that's a subtlety that would have come up in testing eventually. Though I suppose it means that this fix had to happen for me to understand what is going on as I was convinced it was the plate scale moving the imposter instead of the shape of the imposter changing. Also it seems like there's no driver to have a fixed t_aca in proseco for these conversions except the issue that chandra_aca isn't supporting the transforms we want sot/chandra_aca#152 ? Though I suppose then we only need this PR if we eventually extend to actually using the differing plate scale by temperature. |

Description
As discussed here and here, proseco can occasionally end up generating very different
p_acqvalues for the same star (diff by up to 0.3) when the acquisitionT_ccdchanges by a tiny amount (< 0.02 C).The operational impact is that a schedule which passes sparkles during load development can fail final review due to temperature propagation changes. This has happened twice.
The mechanism we identified is the temperature-dependent transformation from yag/zag to row/col. If the row/col of an acq candidate crosses a row/col boundary then box comparisons to imposter locations (fixed in row/col by definition) can change. There are two manifestations we found:
This PR fixes both issues as follows:
T_ccdchanges.Interface impacts
Testing
Unit tests
Independent check of unit tests by [REVIEWER NAME]
Functional tests
No functional testing.