Skip to content
Draft
Show file tree
Hide file tree
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
12 changes: 9 additions & 3 deletions python/lvmdrp/core/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,21 @@ def from_spectrographs(cls, rss_sp1, rss_sp2, rss_sp3):
# update header
if len(hdrs) > 0:
hdr_out = hdrs[0]._header.copy()
channel = hdr_out["CCD"][0]
for hdr in hdrs[1:]:
hdr_out.update(hdr._header)
hdr_out["CCD"] = hdr_out["CCD"][0]
hdr_out["CCD"] = channel
else:
hdr_out = None

channel = None

# update slitmap
slitmap_out = rss._slitmap
slitmap_out = copy(rsss[-1]._slitmap)
for i in range(len(rsss)-1):
spec_idx = numpy.where(slitmap_out["spectrographid"] == i+1)
if channel is not None:
slitmap_out[f"ypix_{channel}"][spec_idx] = rsss[i]._slitmap[f"ypix_{channel}"][spec_idx]
slitmap_out["fibstatus"][spec_idx] = rsss[i]._slitmap["fibstatus"][spec_idx]

return cls(
data=data_out,
Expand Down
3 changes: 3 additions & 0 deletions python/lvmdrp/functions/imageMethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -2716,6 +2716,9 @@ def extract_spectra(
channel = img._header['CCD'][0]
slitmap[f"ypix_{channel}"] = slitmap[f"ypix_{channel}"].astype("float64")
slitmap[f"ypix_{channel}"][select_spec] += numpy.nan_to_num(bn.nanmedian(shifts, axis=0))
# propagate bad fibers to slitmap
slitmap_spec["fibstatus"][mask.all(axis=1)] = 5
slitmap["fibstatus"][select_spec] = slitmap_spec["fibstatus"]

if error is not None:
error[mask] = replace_error
Expand Down
Loading