-
Notifications
You must be signed in to change notification settings - Fork 171
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
JP-1829: Fix resample_spec output size from input images crossing RA=0 #5929
JP-1829: Fix resample_spec output size from input images crossing RA=0 #5929
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5929 +/- ##
==========================================
+ Coverage 77.91% 77.97% +0.06%
==========================================
Files 403 403
Lines 35392 35573 +181
==========================================
+ Hits 27575 27739 +164
- Misses 7817 7834 +17
*This pull request uses carry forward flags. Click here to find out more.
Continue to review full report at Codecov.
|
524868e
to
afa8267
Compare
ra_slice = ra[:, lam_center_index] | ||
dec_slice = dec[:, lam_center_index] | ||
# wrap RA if near zero | ||
ra_center_pt = np.nanmean(wrap_ra(ra_slice)) |
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 was the bug. For RA~0, the mean of the RA slice was the mean of zeros and 359, so an output frame centered at RA~180 deg.
LGTM. |
Yeah, I'd like to do a follow-up PR that does a bit of refactoring to |
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.
LGTM. So this only affected resample_spec
and not resample
(for images)?
@hbushouse right, it was only in the |
789cc0f
to
c4c5fe0
Compare
Added one last commit to fix a bug that the NIRSpec MOS lev3 regression tests revealed. |
spacetelescope#5929) * Output i2d in image2 for NIRCam regtest * Fix build_interpolated_output_wcs for WCS near RA=0 * Update tests * Fix test warnings * Use np.append instead of looping Separated the OLS and GLS functionality into their own file. Removing an unused function and refactoring the function. Break into smaller functions. Making flake8 style changes. Updating docstrings for new functions. Updating the comments.
spacetelescope#5929) * Output i2d in image2 for NIRCam regtest * Fix build_interpolated_output_wcs for WCS near RA=0 * Update tests * Fix test warnings * Use np.append instead of looping Separated the OLS and GLS functionality into their own file. Removing an unused function and refactoring the function. Break into smaller functions. Making flake8 style changes. Updating docstrings for new functions. Updating the comments.
* JP-1829: Fix resample_spec output size from input images crossing RA=0 (#5929) * Output i2d in image2 for NIRCam regtest * Fix build_interpolated_output_wcs for WCS near RA=0 * Update tests * Fix test warnings * Use np.append instead of looping Separated the OLS and GLS functionality into their own file. Removing an unused function and refactoring the function. Break into smaller functions. Making flake8 style changes. Updating docstrings for new functions. Updating the comments. * Fixing bug found with 'None * 22'. * Updating tests. * Making style changes due to flake8 failures. * Changing comment to a test to clarify that since there are only two groups in the data setting the first and last groups to DO_NOT_USE means setting all groups to DO_NOT_USE. * Removing unnecessary comment in ols_fit.py and adding clarifying comment to tests. Co-authored-by: James Davies <[email protected]>
Closes #5564
Resolves JP-1829
Description
This PR fixes the case where the WCS of the input images spans RA=0.