Skip to content

Commit

Permalink
use badpix
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrammer committed May 15, 2024
1 parent a62f6bd commit 415c59a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions msaexp/slit_combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def __init__(
fixed_offset=0.0,
nod_offset=None,
pad_border=2,
weight_type="ivm_bar",
weight_type="ivm",
reference_exposure="auto",
**kwargs,
):
Expand Down Expand Up @@ -778,8 +778,6 @@ def __init__(
self.info = self.parse_metadata()
self.calculate_slices()

self.sh = np.min(np.array(self.shapes), axis=0)

self.parse_data()

if self.grating.startswith("G"):
Expand Down Expand Up @@ -1127,7 +1125,8 @@ def calculate_slices(self):
xstart = np.max(self.info["xstart"])
xstop = np.min(self.info["xstart"] + self.info["shape"][:, 1])

sh = (ystop - ystart, xstop - xstart)
# Global shape
self.sh = (ystop - ystart, xstop - xstart)

y0 = ystart - self.info["ystart"]
x0 = xstart - self.info["xstart"]
Expand Down Expand Up @@ -1291,6 +1290,14 @@ def parse_data(self):

bad = (dq & BAD_PIXEL_FLAG) > 0

# Extra bad pix
for i, slit in enumerate(slits):
sl = slit.slice
dqi, dqf = msautils.extra_slit_dq_flags(
slit, verbose=(VERBOSE_LOG > 1)
)
bad[i, :] |= dqi.flatten() > 0

# Dilate stuck open pixels
if ("MSA_FAILED_OPEN" in BAD_PIXEL_NAMES) & self.meta[
"dilate_failed_open"
Expand Down

0 comments on commit 415c59a

Please sign in to comment.