Skip to content

Commit

Permalink
JP-3750: Fix IFU cube moving target RA, Dec metadata (spacetelescope#…
Browse files Browse the repository at this point in the history
  • Loading branch information
emolter authored Oct 24, 2024
1 parent 200b1ab commit a2d6ba8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/8911.cube_build.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For moving-target IFU data, set RA, Dec header information of s3d products according to the mean of input models instead of the first input model.
8 changes: 8 additions & 0 deletions jwst/cube_build/ifu_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -2436,6 +2436,14 @@ def blend_output_metadata(self, IFUCube):
"meta.filename",
],
)
# For moving targets, set RA, Dec equal to the average
mt_avra = getattr(self.input_models_this_cube[0].meta.wcsinfo, "mt_avra", None)
mt_avdec = getattr(self.input_models_this_cube[0].meta.wcsinfo, "mt_avdec", None)
if mt_avra is not None:
IFUCube.meta.wcsinfo.mt_ra = mt_avra
IFUCube.meta.wcsinfo.mt_dec = mt_avdec
IFUCube.meta.target.ra = mt_avra
IFUCube.meta.target.dec = mt_avdec

# ********************************************************************************
def find_ra_dec_offset(self, filename):
Expand Down

0 comments on commit a2d6ba8

Please sign in to comment.