-
Notifications
You must be signed in to change notification settings - Fork 28
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
RCAL-930 Roundtrip L3 wcsinfo especially when skycell specifications are used #1585
RCAL-930 Roundtrip L3 wcsinfo especially when skycell specifications are used #1585
Conversation
Result: Only one item that is expected and will need to be okified. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1585 +/- ##
==========================================
+ Coverage 77.92% 78.15% +0.23%
==========================================
Files 115 116 +1
Lines 7619 7646 +27
==========================================
+ Hits 5937 5976 +39
+ Misses 1682 1670 -12 ☔ View full report in Codecov by Sentry. |
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 looks good. My chief concern is whether we're populating the "real" L3 WCS correctly, though, and I'm not 100% sure that this captures that case? I would suggest one of the following two tests:
- regression test comparing wcsinfo_to_wcs of one of the resampled L3 files in the regression tests to l3.meta.wcs
- unit test comparing something like
wcs1 = skycell_to_wcs(skycell_record)
l3 = dummy_l3()
gwcs_into_l3(l3, wcs1)
wcs2 = wcsinfo_to_wcs(l3.meta.wcsinfo)
# compare wcs1, wcs2
I'm also interested in knowing which of these two cases
https://github.com/spacetelescope/romancal/pull/1585/files#diff-15cbca0fd660d7d5eac167ece3633d2a1a665d776bf180b07617f06b5fb40a7bR229-R231
is the usual branch we take for normal files we produce; I hope that it's the one on line 230 and not the one on line 232-236?
Did you end up being able to reproduce the WCS nearly perfectly?
I have pushed the wcs comparison tests. The dec differences are < 1.e-5 arcsec. The ra differences are < 5e-4 arcsec. If one looks at the wcs info itself, in particular the scaling, they are similar to the 6th decimal place. Without making the wcs to wcsinfo func very knowledgeable about the exact info in a wcs (right now it is fairly general), this is the best, due to calculation roundoff. Concerning the question of whether the matrix is used directly or not. Methinks this is the wrong question to be asking. There is really only one situation where this routine would normally be called by MosaicPipeline and that is when a skycell has been defined. As best as I can tell, the patches file does not define a rotation matrix, but only "orientation". I have also not done a search, but I presume most skycells are not defined with 0 orientation anyways. Hence, it is mute. Otherwise, the wcsinfo_to_wcs is just a convenience function. If MosaicPipeline does not have a skycell, it will be computing the wcs from the input images' wcs' anyways. |
Thanks. It looks to me like the mad_std are actually 10^-5 mas, rather than arcseconds, which is negligible. The biggest difference in the regtest I looked at was the median overall offset rather than the standard deviation, coming from the scale factor times the distance from the center. This was ~3e-3 mas, which is small but not utterly negligible. If I artificially forced the scale factor to match exactly, this all went away and things agreed perfectly. I think we have two options if we want to get that extra precision:
Do you have a sense here? I'm okay with either of those options, but do think we should try to get the median shift down to the <1 uas range. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
b4bbd32
to
fbfa7df
Compare
for more information, see https://pre-commit.ci
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.
Looks great, thanks!
Resolves RCAL-930
Closes #1431
This PR addresses ensures that the L3
meta.wcsinfo
can be used to accurately reproduce the originating WCS from which the wcsinfo block had been derived. In particular, when the L3 product has been created based on a skycell instead of the input images, this update ensures that roundtripping of the wcsinfo is still valid.Tasks
24Q4_B15
(use the latest build if not sure)no-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)docs/
pageokify_regtests
to update the truth filesnews fragment change types...
changes/<PR#>.general.rst
: infrastructure or miscellaneous changechanges/<PR#>.docs.rst
changes/<PR#>.stpipe.rst
changes/<PR#>.associations.rst
changes/<PR#>.scripts.rst
changes/<PR#>.mosaic_pipeline.rst
changes/<PR#>.patch_match.rst
steps
changes/<PR#>.dq_init.rst
changes/<PR#>.saturation.rst
changes/<PR#>.refpix.rst
changes/<PR#>.linearity.rst
changes/<PR#>.dark_current.rst
changes/<PR#>.jump_detection.rst
changes/<PR#>.ramp_fitting.rst
changes/<PR#>.assign_wcs.rst
changes/<PR#>.flatfield.rst
changes/<PR#>.photom.rst
changes/<PR#>.flux.rst
changes/<PR#>.source_detection.rst
changes/<PR#>.tweakreg.rst
changes/<PR#>.skymatch.rst
changes/<PR#>.outlier_detection.rst
changes/<PR#>.resample.rst
changes/<PR#>.source_catalog.rst