Skip to content

Commit

Permalink
Toggle for crpix from saif, working on 8799 bar
Browse files Browse the repository at this point in the history
  • Loading branch information
wbalmer committed May 13, 2024
1 parent 49d943b commit 2b5776d
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions spaceKLIP/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def read_jwst_s012_data(self,
datapaths,
psflibpaths=None,
bgpaths=None,
cr_from_saif=False,
assoc_using_targname=True):
"""
Read JWST stage 0 (*uncal), 1 (*rate or *rateints), or 2 (*cal or
Expand Down Expand Up @@ -274,10 +275,12 @@ def read_jwst_s012_data(self,
BLURFWHM += [head.get('BLURFWHM', np.nan)]
head = hdul['SCI'].header
BUNIT += [head.get('BUNIT', 'NONE')]
# CRPIX1 += [head.get('CRPIX1', np.nan)]
# CRPIX2 += [head.get('CRPIX2', np.nan)]
CRPIX1 += [ap.XSciRef]
CRPIX2 += [ap.YSciRef]
if cr_from_saif:
CRPIX1 += [ap.XSciRef]
CRPIX2 += [ap.YSciRef]
else:
CRPIX1 += [head.get('CRPIX1', np.nan)]
CRPIX2 += [head.get('CRPIX2', np.nan)]
VPARITY += [head.get('VPARITY', -1)]
V3I_YANG += [head.get('V3I_YANG', 0.)]
RA_REF += [head.get('RA_REF', np.nan)]
Expand Down Expand Up @@ -573,7 +576,8 @@ def read_jwst_s012_data(self,
pass

def read_jwst_s3_data(self,
datapaths):
datapaths,
cr_from_saif=False):
"""
Read JWST stage 3 data (this can be *i2d data from the official JWST
pipeline, or data products from the pyKLIP and classical PSF
Expand Down Expand Up @@ -720,10 +724,12 @@ def read_jwst_s3_data(self,
if TYPE[-1] == 'CORON3':
head = hdul['SCI'].header
BUNIT += [head.get('BUNIT', 'NONE')]
# CRPIX1 += [head.get('CRPIX1', np.nan)]
# CRPIX2 += [head.get('CRPIX2', np.nan)]
CRPIX1 += [ap.XSciRef]
CRPIX2 += [ap.YSciRef]
if cr_from_saif:
CRPIX1 += [ap.XSciRef]
CRPIX2 += [ap.YSciRef]
else:
CRPIX1 += [head.get('CRPIX1', np.nan)]
CRPIX2 += [head.get('CRPIX2', np.nan)]
HASH += [TELESCOP[-1] + '_' + INSTRUME[-1] + '_' + DETECTOR[-1] + '_' + FILTER[-1] + '_' + PUPIL[-1] + '_' + CORONMSK[-1] + '_' + SUBARRAY[-1]]
hdul.close()
TYPE = np.array(TYPE)
Expand Down

0 comments on commit 2b5776d

Please sign in to comment.