Skip to content

Commit

Permalink
add new LW badpix files
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrammer committed Jan 20, 2023
1 parent 351422a commit fc8b0ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
Binary file added grizli/data/nrc_badpix_230120_NRCALONG.fits.gz
Binary file not shown.
Binary file added grizli/data/nrc_badpix_230120_NRCBLONG.fits.gz
Binary file not shown.
19 changes: 11 additions & 8 deletions grizli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5630,15 +5630,18 @@ def drizzle_from_visit(visit, output, pixfrac=1., kernel='point',
_inst = flt[0].header['INSTRUME']
if (extra_wfc3ir_badpix) & (_inst in ['NIRCAM']):
_det = flt[0].header['DETECTOR']
bpfile = os.path.join(os.path.dirname(__file__),
f'data/nrc_lowpix_0916_{_det}.fits.gz')
bpfiles = [os.path.join(os.path.dirname(__file__),
f'data/nrc_badpix_230120_{_det}.fits.gz')]
bpfiles += [os.path.join(os.path.dirname(__file__),
f'data/nrc_lowpix_0916_{_det}.fits.gz')]

if os.path.exists(bpfile):
bpdata = pyfits.open(bpfile)[0].data
#bpdata = nd.binary_dilation(bpdata > 0, iterations=2)*1024
bpdata = nd.binary_dilation(bpdata > 0)*1024
msg = f'Use extra badpix in {bpfile}'
log_comment(LOGFILE, msg, verbose=verbose)
for bpfile in bpfiles:
if os.path.exists(bpfile):
bpdata = pyfits.open(bpfile)[0].data
bpdata = nd.binary_dilation(bpdata > 0)*1024
msg = f'Use extra badpix in {bpfile}'
log_comment(LOGFILE, msg, verbose=verbose)
break
else:
bpdata = np.zeros(flt['SCI'].data.shape, dtype=int)

Expand Down

0 comments on commit fc8b0ff

Please sign in to comment.