Skip to content

Commit

Permalink
updae to slitmeta to include is_star
Browse files Browse the repository at this point in the history
  • Loading branch information
jemorrison committed Mar 1, 2021
1 parent 0e26d8b commit 71f4976
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions jwst/datamodels/schemas/slitmeta.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ properties:
enum: [EXTENDED, POINT, UNKNOWN]
fits_keyword: SRCTYPE
fits_hdu: SCI
is_star:
title: Flag indicated whether the source is a star
type: boolean
source_xpos:
title: Source position in slit (x-axis)
type: number
Expand Down
3 changes: 1 addition & 2 deletions jwst/extract_2d/grisms.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,8 @@ def extract_grism_objects(input_model,
# The overall subarray offset is recorded in model.meta.subarray.
# nslit = obj.sid - 1 # catalog id starts at zero
new_slit.name = "{0}".format(obj.sid)
#new_slit.source_type = 'UNKNOWN'
if obj.is_star:
new_slit.source_type = 'POINT'
new_slit.is_star = True
else:
new_slit.source_type = 'EXTENDED'
new_slit.xstart = xmin + 1 # fits pixels
Expand Down
8 changes: 8 additions & 0 deletions jwst/srctype/srctype.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ def set_source_type(input_model):
log.info(f'Input is a TSO exposure; setting default SRCTYPE = {src_type}')
input_model.meta.target.source_type = src_type

# FOR NIR_WFSS check slit values of is_star to set SRCTYPE
elif exptype == 'NIS_WFSS':
for slit in input_model.slits:
if slit.is_star:
slit.source_type = 'POINT'
else:
slit.source_type = 'EXTENDED'

# Unrecognized exposure type; set to UNKNOWN as default
else:
log.warning(f'EXP_TYPE {exptype} not applicable to this operation')
Expand Down

0 comments on commit 71f4976

Please sign in to comment.