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-3794: Add trace-based extraction option for NIRSpec #9022

Merged
merged 23 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f45f25c
add option for using trace based extraction for nirspec data
hayescr Dec 18, 2024
ec40cf8
fix limit population
hayescr Dec 18, 2024
1c6a66f
avoid use_source_posn and use_trace messages
hayescr Dec 18, 2024
36dcce9
fix trace_offset type
hayescr Dec 19, 2024
6369734
update logging
hayescr Dec 19, 2024
ef4c4e7
update documentation
hayescr Dec 19, 2024
43a215b
updated/added tests
hayescr Dec 19, 2024
5ce9d66
cleaning formatting
hayescr Dec 20, 2024
c10ac87
Merge remote-tracking branch 'upstream/main' into jp-3794_extraction_…
hayescr Dec 20, 2024
c04a831
added changelog snippet
hayescr Dec 20, 2024
5066ffa
Expand trace extraction to MIRI, expand trace offset to all
melanieclarke Dec 30, 2024
4df7fba
Default BOTS to use_source_posn=True
melanieclarke Dec 30, 2024
c61bdc0
Use custom extraction parameters as is for BOTS regtest
melanieclarke Dec 30, 2024
6d37ac4
Clean up docs; description.rst still needs update
melanieclarke Dec 30, 2024
46c8696
Merge 'shift_by' functions
melanieclarke Jan 3, 2025
feb7c8b
Rename trace_offset to position_offset
melanieclarke Jan 3, 2025
62d57d3
Merge pull request #3 from melanieclarke/expand_on_trace
hayescr Jan 3, 2025
9326ed9
Merge remote-tracking branch 'origin/main' into jp-3794_extraction_trace
hayescr Jan 3, 2025
d24fc76
update documentation
hayescr Jan 3, 2025
279673e
fix typo
hayescr Jan 3, 2025
8acf6a5
Merge branch 'main' into jp-3794_extraction_trace
melanieclarke Jan 3, 2025
60eedab
Merge branch 'main' into jp-3794_extraction_trace
melanieclarke Jan 7, 2025
c8491e1
Merge branch 'main' into jp-3794_extraction_trace
melanieclarke Jan 8, 2025
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
2 changes: 2 additions & 0 deletions changes/9022.extract_1d.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Expanded the ``use_source_posn`` option to calculate a source trace from WCS and expected source positions for unresampled NIRSpec and MIRI LRS fixed slit data.
Added the step parameter ``position_offset`` to allow an additional aperture offset in pixels.
8 changes: 6 additions & 2 deletions docs/jwst/extract_1d/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ Step Arguments for Slit and Slitless Spectroscopic Data
file should be shifted to account for the expected position of the source. If None (the default),
the step will decide whether to use the source position based
on the observing mode and the source type. By default, source position corrections
are attempted only for NIRSpec MOS and NIRSpec and MIRI LRS fixed-slit point sources.
are attempted only for point sources in NIRSpec MOS/FS/BOTS and MIRI LRS fixed-slit exposures.
Set to False to ignore position estimates for all modes; set to True to additionally attempt
source position correction for NIRSpec BOTS data or extended sources.
source position correction for extended sources.

``--position_offset``
Specify a number of pixels (fractional pixels are allowed) to offset the
extraction aperture from the nominal position. The default is 0.

``--smoothing_length``
If ``smoothing_length`` is greater than 1 (and is an odd integer), the
Expand Down
27 changes: 18 additions & 9 deletions docs/jwst/extract_1d/description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,26 @@ If `extract_width` is also given, the start and stop values are used to define
the center of the extraction region in the cross-dispersion direction, but the
width of the aperture is set by the `extract_width` value.

For some instruments and modes, the cross-dispersion start and stop values may be shifted
to account for the expected location of the source. This option
is available for NIRSpec MOS, fixed-slit, and BOTS data, as well as MIRI LRS fixed-slit.
For some instruments and modes, the extraction region may be adjusted
to account for the expected location of the source with the `use_source_posn`
option. This option is available for NIRSpec MOS, fixed-slit, and BOTS data,
as well as MIRI LRS fixed-slit.
If `use_source_posn` is set to None via the reference file or input parameters,
it is turned on by default for all point sources in these modes, except NIRSpec BOTS.
To turn it on for NIRSpec BOTS or extended sources, set `use_source_posn` to True.
it is turned on by default for all point sources in these modes.
To turn it on for extended sources, set `use_source_posn` to True.
To turn it off for any mode, set `use_source_posn` to False.
If source position correction is enabled, the planned location for the source is
calculated internally, via header metadata recording the source position and the
spectral WCS transforms, then used to offset the extraction start and stop values
in the cross-dispersion direction.
If source position option is enabled, the planned location for the source and its
trace are calculated internally via header metadata recording the source position
and the spectral WCS transforms. The source location will be used to offset the
extraction start and stop values in the cross-dispersion direction.
If `extract_width` is provided, the source extraction region will be centered
on the calculated trace with a width set by the `extract_width` value.
For resampled, "s2d", products this will effectively be the rectangular
extraction region offset in the cross-dispersion direction. For
"cal" or "calints" products that have not been resampled, the extraction region
will be curved to follow the calculated trace.
If no `extract_width` has been provided, the shifted extraction start and
stop values will be used.

A more flexible way to specify the source extraction region is via the `src_coeff`
parameter. `src_coeff` is specified as a list of lists of floating-point
Expand Down
Loading
Loading