-
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-3598: The ResampleSpecStep and Extract1DStep within MasterBackgroundMosStep are inaccessible #8847
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8847 +/- ##
==========================================
- Coverage 64.54% 64.54% -0.01%
==========================================
Files 375 375
Lines 38740 38739 -1
==========================================
- Hits 25004 25003 -1
Misses 13736 13736 ☔ View full report in Codecov by Sentry. |
The error in the regression tests is as expected and can be ignored: |
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.
Code changes look good to me. I'm attempting to test now with some real data.
Can you please update the documentation for master background with MOS to add in the pixel_replace step? Also, it looks like there is not yet any mention of how to set parameters in the substeps for the master_background_mos pipeline -- can we add a sentence or two about that to the description?
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.
On closer look, and testing on real data, I think this needs more work. Setting the other steps up as part of the step_defs allows it to take input parameters for the substeps, but then they are not actually used, since the steps are created and called in create_background_from_multislit
instead of in the process
function, like the other steps are.
I'm testing by just running spec2 from the command line on a MOS rate file with background slits, setting --steps.master_background_mos.steps.pixel_replace.skip=False
. The top-level parameters report that skip is set to False, but when the step is created later, the default parameter skip=True
is used.
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.
One more thing - this needs documentation updates, in docs/jwst/master_background/description.rst, under the NIRSpec MOS Mode heading.
@melanieclarke - either way is fine with me. I'll take a look at this PR to see if I have any feedback, but one thing I did notice was the switch to call the #8932 will add another parameter for |
This was my suggestion/fault - I figured it would be more forward looking if the combine_1d call was part of the pipeline too. That way if we add more parameters to it in the future, the user can directly control them as needed. For the case where you want master_background_mos to have a different default for specific combine_1d parameters, we could pass them directly from the top-level parameters to the step before calling it, e.g.
I can see that potentially being confusing, though, if the user sets sigma_clip directly in the substep, and then it's overridden by the top-level parameters. Since combine1_d is currently a simple step, and there is already the self-contained |
@melanieclarke and @hayescr I merged the changes of #8932. Can you please take a look at the code? |
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.
There are some unit tests that are failing because they call the create_background_from_multislit
on a slit model, rather than extracted spectra, as is now expected. Can you please update those?
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 don't think I have any other comments on top of what Melanie mentioned and the changes work for me. In terms of the tests, just in case it helps streamline adjusting the tests, I had set up a few of them to work around applying/removing some of the NIRSpec correction steps. I just did this to avoid the effects of the pixel-to-pixel differences in the flat-fielding, which can make the values of the background and background correction difficult to predict ahead of time.
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.
Testing locally, it looks like parameters for the substeps are now being passed appropriately and the new parameters for sigma clipping and median filtering are incorporated correctly.
There are still some lingering clean up issues - please address these, and then we should re-run regression tests.
removing this because it is for the wrong step
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.
All comments addressed and regtest results look good - the only change is that the pixel replace keyword is added in the background spectra (and set to SKIPPED, as expected).
Resolves JP-3598
and
Resolves JP-3748
Closes #
This PR adds resample_spec and extract_1d as steps of the MOS background pipeline so that their respective step attributes can be modified there as well.
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