Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #488 +/- ##
==========================================
- Coverage 91.54% 89.08% -2.47%
==========================================
Files 63 63
Lines 8715 8792 +77
==========================================
- Hits 7978 7832 -146
- Misses 737 960 +223 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
emolter
left a comment
There was a problem hiding this comment.
The jwst repository calls gwcs_blot and the Resample class. So in order for this to be accessible to jwst, I think the two new parameters stepsize and order need to be propagated one more step and become optional inputs to those two.
For changelog fragments, you'll need a few different ones, something like the following:
- 488.alignment.rst: Rename
calc_pixmaptocalc_gwcs_pixmap, and add interpolation options tocalc_gwcs_pixmapto speed up resample computations. (something about the amount of speedup here). - 488.alignment.rst: Remove util.reproject method
- 488.outlier_detection.rst: Remove utils.reproject method. Remove utils.calc_gwcs_pixmap; use alignment.resample_utils.calc_gwcs_pixmap instead.
- 488.breaking.rst: Remove alignment.util.reproject, outlier_detection.utils.reproject, and outlier_detection.utils.calc_gwcs_pixmap. Rename alignment.util.calc_pixmap to alignment.util.calc_gwcs_pixmap
|
I added two changelog fragments attempting to match the current filenames and the spirit of your suggestions, I propagated stepsize and order up as needed, and I fixed the formatting. Tests are passing. This PR still needs unit tests of the interpolation aspect of calc_pixmap. |
|
Thanks for doing so! It looks like I have what I need to ensure this looks good on multiple types of JWST data. RE the changelog, what you have looks good. We are about to change some of the categories - this is part of what we were arguing about at hack day - so they unfortunatley may need to be renamed and split by step if #486 gets in before this does. |
|
@t-brandt I started testing this by hooking it into the jwst repository (see this early PR draft). I think I found a small bug, which is that the output pixel map seems to be the wrong shape for non-square data. For example, for the unit test Changing the last line of |
|
Thanks, @emolter -- the x and y order were reversed in one call. It didn't matter if they were the same as for a square array. I think it should be fixed now. |
|
Fix looks like it works, thanks. I'm still testing this on different jwst datasets, will update when that's done. |
|
I've now tested this on all jwst imaging regression test data. Things are looking excellent- the differences in output data are almost all smaller than our tolerances, and those that aren't are still small enough that I'm not worried. I've also confirmed that the runtime improvements can be substantial for large JWST mosaics. See comments on spacetelescope/jwst#10137 for details. I'm ready to approve this pending two things:
|
|
There are three failures in the regression tests (https://github.com/spacetelescope/RegressionTests/actions/runs/21004645391) pointing to jwst/main and this PR branch. They look small so I'm not super worried, but we didn't expect any changes at all, so I think it'd be worth at least understanding where they are coming from. I presume it is indeed related to some difference between the old stcal
Does anyone have insight here? edit with more details: So the four points the regtest flagged (the four in the upper left) are indeed substantially larger differences than the rest. Still unclear to me what caused this.
For the failing second exposure in the MultiExposureModel in
|
|
Looking again at the analysis I did above, I think it's fine to chalk it up to just small numerical differences between the old and new |
|
As per discussion in rcalpr#2136, rcal is good-to-go with this PR. |
|
With regard to "wiggling" of 3rd order splines... I still think this is a potential issue albeit, as of now, it is only theoretical. I performed extensive (oversampling each output pixel x10) search for these wiggling using WCS of several imaging instruments and I was not able to find any. I did not perform any testing on spectral WCS which is not possible at this moment. Attempt to test this on spectral WCS failed because resulting pixmap for spectral WCS is all The reason for all So, my recommendation is to modify the code for the case of I assume this is the reason why |
Yes, I believe the differences are specifically due to differences in the algorithm of To be safe, if desired, I recommend making a separate PR that does only one thing: switch |
|
However, regression tests run on this PR test only the default case of |
There was a problem hiding this comment.
I left separate comments with some recommendations. However, existing unit test failures should be fixed and I recommend that new unit tests be added to test calc_pixmap for both stepsize == 1 (or use drizzle.utils.calc_pixmap() for stepsize=1) and stepsize > 1.
Also, IMO, for stepsize>1 bounding box must be taken into account.
|
@mcara, I fully agree that we need unit tests to verify behavior for |
|
One more question for everyone: Why is CC: @braingram @emolter |
@t-brandt I think it's best if you add any unit tests you'd like to this PR and @mcara can review them. |
I agree with @mcara that resample seems like the most intuitive home for |
40522e2 to
7d78887
Compare
6f4aa8a to
3ce73f6
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
3ce73f6 to
bbd1b45
Compare
emolter
left a comment
There was a problem hiding this comment.
LGTM, one comment about the test coverage but it doesn't feel important enough to hold up the PR
8924d92 to
bbd1b45
Compare
|
@zacharyburnett would you please re-trigger the readthedocs build? It appears to have timed out and is required for merge. It looks to me like you might be the only one with permission in here |
|
Sure, restarted |
|
https://app.readthedocs.org/projects/stcal/builds/31372985/ shows the most recent build worked, so why hasn't the CI summary updated to reflect that? Does anyone with permission feel like overriding the branch protections to merge this? @zacharyburnett @tapastro |


Partially resolves JP-3997
Resolves JP-4216
Resolves RCAL-1311
Closes spacetelescope/jwst#10115
This PR supersedes #485 and #367
The reproject functions and calc_pixmap and calc_gwcs_pixmap functions in alignment and outlier_detection are all removed in favor of a copy of the calc_pixmap function from drizzle which now lives in alignment. The rewritten calc_pixmap accepts two new inputs: stepsize (duplicating an argument in drizzlepac), which performs the full WCS pixel mapping only every stepsize pixels in each direction, and order, either 1 or 3, to perform either bilinear or bicubic interpolation in between. These parameters should be exposed at the top-level calls to outlier detection and resample.
Tasks
docs/pageno-changelog-entry-needed)changes/:echo "changed something" > changes/<PR#>.<changetype>.rst(see changelog readme for instructions)"git+https://github.com/<fork>/stcal@<branch>")jwstregression testromancalregression test