-
Notifications
You must be signed in to change notification settings - Fork 75
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
Fix compute_scale when fiducial coordinates are outside bounding box #2887
base: main
Are you sure you want to change the base?
Fix compute_scale when fiducial coordinates are outside bounding box #2887
Conversation
9edc67e
to
cd9715e
Compare
…de of bounding box
cd9715e
to
ce15aeb
Compare
I don't think this needs a changelog entry as as far as users are concerned it won't have an impact yet, since jdaviz disables the bounding box by default. It's more to future-proof if we do want to retain the bounding boxes. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2887 +/- ##
==========================================
- Coverage 88.72% 88.71% -0.01%
==========================================
Files 111 111
Lines 17102 17106 +4
==========================================
+ Hits 15174 15176 +2
- Misses 1928 1930 +2 ☔ View full report in Codecov by Sentry. |
@@ -575,7 +576,13 @@ def compute_scale(wcs, fiducial, disp_axis, pscale_ratio=1): | |||
if spectral and disp_axis is None: # pragma: no cover | |||
raise ValueError('If input WCS is spectral, a disp_axis must be given') | |||
|
|||
crpix = np.array(wcs.invert(*fiducial)) | |||
if wcs.in_image(*fiducial): |
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.
@bmorris3 should review this one. And also since he mentioned that he lifted this code from jwst
, I wonder if a similar patch has to go to jwst
also.
I'm re-milestoning this one to 4.0, since the related upstream GWCS changes (spacetelescope/gwcs#498) are in draft pending strategizing and discussion from @nden and @mcara. |
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.
With the latest changes to spacetelescope/gwcs#498, this will work for us with one further change, in astrofrog#5.
Stop GWCS bounding box override in imviz parser
# NOTE: if extending this beyond GWCS, the mouseover logic | ||
# for outside_*_bounding_box should also be updated. | ||
data.coords._orig_bounding_box = data.coords.bounding_box |
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.
@bmorris3 - is this still needed/used anywhere? Can we remove the entire if-statement?
Description
This fixes a corner case in
compute_scale
when the fiducial coordinates provided are outside of the bounding box.This is needed if the bounding box on data is not reset, and in order to be compatible with spacetelescope/gwcs#498
cc @bmorris3
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.