Skip to content

Commit

Permalink
Merge branch 'develop' into bad-pix-html-exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
mfixstsci authored Mar 15, 2024
2 parents 695780e + 33c0619 commit d0334d5
Show file tree
Hide file tree
Showing 14 changed files with 739 additions and 281 deletions.
23 changes: 23 additions & 0 deletions jwql/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,3 +1032,26 @@ class QueryConfigKeys:
+ WFSC_SUFFIX_TYPES
+ MSA_SUFFIX
)

# Model.Charfield Max Length Constants
MAX_LEN_AMPLIFIER = 40
MAX_LEN_APERTURE = 40
MAX_LEN_DEPENDENCY_VALUE = 40
MAX_LEN_DETECTOR = 40
MAX_LEN_DIFF_IMAGE = 1000
MAX_LEN_FILENAME = 1000
MAX_LEN_FILTER = 7
MAX_LEN_GRATING = 40
MAX_LEN_INSTRUMENT = 7
MAX_LEN_MNEMONIC = 40
MAX_LEN_NGROUPS = 10
MAX_LEN_NINTS = 10
MAX_LEN_OBS = 3
MAX_LEN_PATH = 1000
MAX_LEN_PROPOSAL = 5
MAX_LEN_PUPIL = 40
MAX_LEN_READPATTERN = 40
MAX_LEN_SUBARRAY = 40
MAX_LEN_TIME = 50
MAX_LEN_TYPE = 40
MAX_LEN_USER = 50
34 changes: 18 additions & 16 deletions jwql/website/apps/jwql/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,36 +466,38 @@ def get_additional_exposure_info(root_file_infos, image_info):
header = fits.getheader(file_path)
header_sci = fits.getheader(file_path, 1)

basic_info['category'] = header['CATEGORY']
basic_info['visit_status'] = header['VISITSTA']
additional_info['NGROUPS'] = header['NGROUPS']
additional_info['NINTS'] = header['NINTS']
additional_info['EXPTIME'] = header['EFFEXPTM']
additional_info['TITLE'] = header['TITLE']
additional_info['PI_NAME'] = header['PI_NAME']
additional_info['TARGNAME'] = header['TARGPROP']
# Dont assume headers exist, some are omitted in parallel observations
basic_info['category'] = header.get('CATEGORY', 'N/A')
basic_info['visit_status'] = header.get('VISITSTA', 'N/A')
additional_info['NGROUPS'] = header.get('NGROUPS', 'N/A')
additional_info['NINTS'] = header.get('NINTS', 'N/A')
additional_info['EXPTIME'] = header.get('EFFEXPTM', 'N/A')
additional_info['TITLE'] = header.get('TITLE', 'N/A')
additional_info['PI_NAME'] = header.get('PI_NAME', 'N/A')
additional_info['TARGNAME'] = header.get('TARGPROP', 'N/A')
additional_info['BRADTEST'] = header.get('BRADTEST', 'N/A')

# For the exposure level (i.e. multiple files) present the target
# RA and Dec. For the image level, give RA_REF, DEC_REF, since those
# are specific to the detector. Similarly, for the exposure level, show
# PA_V3, which applies to all detectors. At the image level, show
# ROLL_REF, which is detector-specific.
if isinstance(root_file_infos, QuerySet):
additional_info['TARG_RA'] = header['TARG_RA']
additional_info['TARG_DEC'] = header['TARG_DEC']
additional_info['PA_V3'] = header_sci['PA_V3']
additional_info['TARG_RA'] = header.get('TARG_RA', 'N/A')
additional_info['TARG_DEC'] = header.get('TARG_DEC', 'N/A')
additional_info['PA_V3'] = header_sci.get('PA_V3', 'N/A')
elif isinstance(root_file_infos, RootFileInfo):
additional_info['RA_REF'] = header_sci['RA_REF']
additional_info['DEC_REF'] = header_sci['DEC_REF']
additional_info['ROLL_REF'] = header_sci['ROLL_REF']
additional_info['RA_REF'] = header_sci.get('RA_REF', 'N/A')
additional_info['DEC_REF'] = header_sci.get('DEC_REF', 'N/A')
additional_info['ROLL_REF'] = header_sci.get('ROLL_REF', 'N/A')

additional_info['CAL_VER'] = 'N/A'
additional_info['CRDS context'] = 'N/A'

# Pipeline version and CRDS context info are not in uncal files
if suffix != 'uncal':
additional_info['CAL_VER'] = header['CAL_VER']
additional_info['CRDS context'] = header['CRDS_CTX']
additional_info['CAL_VER'] = header.get('CAL_VER', 'N/A')
additional_info['CRDS context'] = header.get('CRDS_CTX', 'N/A')

return basic_info, additional_info

Expand Down
Loading

0 comments on commit d0334d5

Please sign in to comment.