-
Notifications
You must be signed in to change notification settings - Fork 167
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-3753: Refactor extract1d #8961
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8961 +/- ##
==========================================
+ Coverage 64.56% 66.76% +2.20%
==========================================
Files 375 375
Lines 38890 37948 -942
==========================================
+ Hits 25109 25336 +227
+ Misses 13781 12612 -1169 ☔ View full report in Codecov by Sentry. |
Initial regression test run here: There are differences in every x1d and x1dints product, but they are all minor:
This small change also appears in these results (attempt 1), but probably shouldn't:
I will modify the code to make sure all background values are finite. Test attempt 2 at the same link above incorporates this change. |
24f5f1a
to
ce895f3
Compare
378b149
to
6ea94a3
Compare
c2a3b26
to
421ee4f
Compare
326fb37
to
20d2c0b
Compare
bb7b338
to
2eb56dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am self-reviewing this PR to add some annotations and point out a few changes to specific people. I'm hoping that will make this large PR easier to review. Please let me know if there's anything else I can do to assist or clarify.
Note that the pipeline takes input start/stop values from the reference files to be | ||
zero-indexed positions, but all extraction values are recorded in the headers as one-indexed | ||
values, following FITS header conventions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note added to document that FITS header values are 1 off from input and logged start/stop values.
The DQ array is set to DO_NOT_USE for pixels with NaN flux values and zero | ||
otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note added for DQ handling change.
Please note that this is different from the convention used for the cross-dispersion | ||
start/stop values, which are expected to be inclusive index values. For the example here, | ||
for horizontal dispersion, `ystart = 325`, `ystop = 335` is equivalent | ||
to `src_coeff = [[324.5],[335.5]]`. To include half a pixel more at the top | ||
and bottom of the aperture, `ystart = 324.5`, `ystop = 335.5` is equivalent | ||
to `src_coeff = [[324],[336]]`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note added to clarify the interpretation difference between start/stop values and polynomial coefficients.
(in microns) or pixel number (pixels in the dispersion direction, with respect to | ||
the input 2D slit image), which is specified by the parameter ``independent_var``. | ||
The default is "pixel". The values of these polynomial functions are pixel numbers in the | ||
direction perpendicular to dispersion. | ||
|
||
.. _extract-1d-for-ifu: | ||
|
||
Extraction for 3D IFU Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation changes for IFU extraction in this file are for style only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file are just to remove the image-type reference file, which is no longer supported. Only ASDF reference files are now supported for IFU extractions.
jwst/extract_1d/tests/conftest.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file adds/relocates some test fixtures for mock data that can pass through various parts of the extraction routines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file adds complete unit test coverage for the jwst.extract_1d.extract module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file now includes complete statement coverage for the extract_1d_step interface: all supported modes are tested for basic step completion. NIRISS SOSS takes too long to complete, so it is marked as slow
- it will not run with basic CI tests. It will run with the regression tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new regression test, added to exercise aperture definition via source coefficients. Truth data on artifactory was generated with the main branch, so any diffs are due to the refactoring in this PR.
5ea7aa8
to
67bef53
Compare
Resolves JP-3753
Resolves JP-3813
Partially addresses JP-3432
Significant refactor for extract1d, to improve code organization, maintainability, and efficiency, as well as set up for PSF-based extraction, to be added in the future.
Tasks
Build 11.3
(use the latest build if not sure)no-changelog-entry-needed
)changes/
:echo "changed something" > changes/<PR#>.<changetype>.rst
(see below for change types)docs/
pageokify_regtests
to update the truth filesnews fragment change types...
changes/<PR#>.general.rst
: infrastructure or miscellaneous changechanges/<PR#>.docs.rst
changes/<PR#>.stpipe.rst
changes/<PR#>.datamodels.rst
changes/<PR#>.scripts.rst
changes/<PR#>.fits_generator.rst
changes/<PR#>.set_telescope_pointing.rst
changes/<PR#>.pipeline.rst
stage 1
changes/<PR#>.group_scale.rst
changes/<PR#>.dq_init.rst
changes/<PR#>.emicorr.rst
changes/<PR#>.saturation.rst
changes/<PR#>.ipc.rst
changes/<PR#>.firstframe.rst
changes/<PR#>.lastframe.rst
changes/<PR#>.reset.rst
changes/<PR#>.superbias.rst
changes/<PR#>.refpix.rst
changes/<PR#>.linearity.rst
changes/<PR#>.rscd.rst
changes/<PR#>.persistence.rst
changes/<PR#>.dark_current.rst
changes/<PR#>.charge_migration.rst
changes/<PR#>.jump.rst
changes/<PR#>.clean_flicker_noise.rst
changes/<PR#>.ramp_fitting.rst
changes/<PR#>.gain_scale.rst
stage 2
changes/<PR#>.assign_wcs.rst
changes/<PR#>.badpix_selfcal.rst
changes/<PR#>.msaflagopen.rst
changes/<PR#>.nsclean.rst
changes/<PR#>.imprint.rst
changes/<PR#>.background.rst
changes/<PR#>.extract_2d.rst
changes/<PR#>.master_background.rst
changes/<PR#>.wavecorr.rst
changes/<PR#>.srctype.rst
changes/<PR#>.straylight.rst
changes/<PR#>.wfss_contam.rst
changes/<PR#>.flatfield.rst
changes/<PR#>.fringe.rst
changes/<PR#>.pathloss.rst
changes/<PR#>.barshadow.rst
changes/<PR#>.photom.rst
changes/<PR#>.pixel_replace.rst
changes/<PR#>.resample_spec.rst
changes/<PR#>.residual_fringe.rst
changes/<PR#>.cube_build.rst
changes/<PR#>.extract_1d.rst
changes/<PR#>.resample.rst
stage 3
changes/<PR#>.assign_mtwcs.rst
changes/<PR#>.mrs_imatch.rst
changes/<PR#>.tweakreg.rst
changes/<PR#>.skymatch.rst
changes/<PR#>.exp_to_source.rst
changes/<PR#>.outlier_detection.rst
changes/<PR#>.tso_photometry.rst
changes/<PR#>.stack_refs.rst
changes/<PR#>.align_refs.rst
changes/<PR#>.klip.rst
changes/<PR#>.spectral_leak.rst
changes/<PR#>.source_catalog.rst
changes/<PR#>.combine_1d.rst
changes/<PR#>.ami.rst
other
changes/<PR#>.wfs_combine.rst
changes/<PR#>.white_light.rst
changes/<PR#>.cube_skymatch.rst
changes/<PR#>.engdb_tools.rst
changes/<PR#>.guider_cds.rst