Skip to content
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-1863: Correct offset in cross-dispersion axis for NIRISS WFSS extraction boxes #5809

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions jwst/assign_wcs/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,11 +697,13 @@ def _create_grism_bbox(input_model, mmag_extract=99.0,

if wfss_extract_half_height is not None and obj.is_star:
if input_model.meta.wcsinfo.dispersion_direction == 2:
center = (xmax + xmin) / 2
ra_center, dec_center = obj.sky_centroid.ra.value, obj.sky_centroid.dec.value
center, _, _, _, _ = sky_to_grism(ra_center, dec_center, (lmin + lmax) / 2, order)
xmin = center - wfss_extract_half_height
xmax = center + wfss_extract_half_height
elif input_model.meta.wcsinfo.dispersion_direction == 1:
center = (ymax + ymin) / 2
ra_center, dec_center = obj.sky_centroid.ra.value, obj.sky_centroid.dec.value
_, center, _, _, _ = sky_to_grism(ra_center, dec_center, (lmin + lmax) / 2, order)
ymin = center - wfss_extract_half_height
ymax = center + wfss_extract_half_height
else:
Expand All @@ -711,7 +713,7 @@ def _create_grism_bbox(input_model, mmag_extract=99.0,
# off the detector partial_order marks partial
# off-detector objects which are near enough to
# cause spectra to be observed on the detector.
# This is usefull because the catalog often is
# This is useful because the catalog often is
# created from a resampled direct image that is
# bigger than the detector FOV for a single grism
# exposure.
Expand Down