Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JP-2066: Add srctype to Combine1D headers #6079

Merged
merged 3 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
1.2.1 (unreleased)
==================

combine_1d
----------

- Added SRCTYPE to COMBINE1D output extension headers, propagated from
EXTRACT1D inputs [#6079]

general
-------

Expand Down
3 changes: 3 additions & 0 deletions jwst/combine_1d/combine1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class InputSpectrumModel:
right_ascension
declination
source_id
source_type
"""

def __init__(self, ms, spec, exptime_key):
Expand Down Expand Up @@ -65,6 +66,7 @@ def __init__(self, ms, spec, exptime_key):
self.right_ascension = np.zeros_like(self.wavelength)
self.declination = np.zeros_like(self.wavelength)
self.source_id = spec.source_id
self.source_type = spec.source_type

self.weight = np.ones_like(self.wavelength)
if exptime_key == "integration_time":
Expand Down Expand Up @@ -580,6 +582,7 @@ def combine_1d_spectra(input_model, exptime_key):
output_order = output_spectra[order].create_output_data()
output_order.spectral_order = order
output_order.source_id = input_spectra[order][0].source_id
output_order.source_type = input_spectra[order][0].source_type
output_model.spec.append(output_order)

# Copy one of the input headers to output.
Expand Down
6 changes: 6 additions & 0 deletions jwst/datamodels/schemas/combinedspec.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ allOf:
type: integer
fits_keyword: SOURCEID
fits_hdu: COMBINE1D
source_type:
title: Source type used for calibration
type: string
enum: [EXTENDED, POINT, UNKNOWN]
fits_keyword: SRCTYPE
fits_hdu: COMBINE1D
6 changes: 6 additions & 0 deletions jwst/datamodels/schemas/multicombinedspec.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ allOf:
type: integer
fits_keyword: SOURCEID
fits_hdu: COMBINE1D
source_type:
title: Source type used for calibration
type: string
enum: [EXTENDED, POINT, UNKNOWN]
fits_keyword: SRCTYPE
fits_hdu: COMBINE1D