Skip to content

Commit

Permalink
adding back in header update in to_native_wave function
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmejia committed Oct 23, 2024
1 parent d62d5e1 commit ba8c7af
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/lvmdrp/functions/run_twilights.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,17 @@ def to_native_wave(rss, wave=None):
header=rss._header
)

# reset header keywords to match original wavelength grid state
new_rss._header["WAVREC"] = False
if "CRPIX1" in new_rss._header:
del new_rss._header["CRPIX1"]
if "CRVAL1" in new_rss._header:
del new_rss._header["CRVAL1"]
if "CDELT1" in new_rss._header:
del new_rss._header["CDELT1"]
if "CTYPE1" in new_rss._header:
del new_rss._header["CTYPE1"]

# interpolate data, error, mask and sky arrays from rectified grid to original grid
for ifiber in range(rss._fibers):
f = interpolate.interp1d(rss._wave, rss._data[ifiber], kind="linear", bounds_error=False, fill_value=np.nan)
Expand Down

0 comments on commit ba8c7af

Please sign in to comment.