-
Notifications
You must be signed in to change notification settings - Fork 171
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 3861 refpix style #9234
base: main
Are you sure you want to change the base?
Jp 3861 refpix style #9234
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9234 +/- ##
==========================================
- Coverage 73.66% 69.56% -4.11%
==========================================
Files 368 367 -1
Lines 36393 35585 -808
==========================================
- Hits 26809 24754 -2055
- Misses 9584 10831 +1247 ☔ View full report in Codecov by Sentry. |
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.
Thanks very much Robert, looks good overall! I left some comments.
|
||
return data0 | ||
|
||
|
||
def fft_interp_norm(dd0, mask0, row, hnorm, hnorm1, ny, ngroups, aa, n_iter_norm): | ||
|
||
"""Do something FFT related.""" |
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.
Was this the line you mentioned at stand-up? If so just flagging this so Melanie has a chance to look at it
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.
Yes, one of them.
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.
Hmm, this is obscure, isn't it? From the comments in fill_bad_regions, and some inspection of the code and inputs, it looks like it is doing an iterative filtering in FFT space of the normal pixels in each group.
Here's my best guess at the parameter values:
dd0: ndarray, Data array containing all groups, updated in place
mask0: ndarray, Mask for pixels to filter, with dimensions ny x nrow. 1 means use the pixel, 0 means do not use it.
row: int, Row size. Computed from the number of science pixels, reference pixels and padding in an amplifier.
hnorm: ndarray, Array of column indices for normal pixels.
hnorm1: ndarray, Shifted index values for normal pixels.
ny: int, Y size of data array.
ngroups: int, Number of groups.
aa: ndarray, Filter to apply.
n_iter_norm: int, Number of filtering iterations.
# | ||
# Just flip back |
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.
can this comment be integrated into the docstring instead of having both?
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 a few more in the lines below that this might apply to
Integration number | ||
group : int | ||
Group number | ||
""" | ||
# | ||
# The inverse is to rotate 180 degrees, then flip over the line Y=X | ||
self.group = np.swapaxes(self.group[::-1, ::-1], 0, 1) | ||
self.restore_group(integration, group) | ||
|
||
|
||
class NRCA1Dataset(NIRDataset): |
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.
for all of these classes that inherit from a parent class and all have the same few functions defined, if the parent class also has the function defined, then Sphinx will automagically copy over the docstring from the parent class. In that case you could just use a noqa:
statement to ignore the style checker for all of these repeated methods.
In this case, it doesn't look like NIRDataset
has a dms_to_detector
, dms_to_detector_dq
, or detector_to_dms
method. I'm not familiar enough with the intent of this code to know for sure if this suggestion makes sense, but a possible future improvement could be to make NIRDataset
an abstract base class and require child classes to define those three methods. It looks like the similar class for MIRI does so below.
flag that controls whether odd and even-numbered columns are | ||
Parameters | ||
---------- | ||
input_model : jwst.datamodels.model |
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.
input_model : jwst.datamodels.model | |
input_model : jwst.datamodels.JWSTDataModel |
""" | ||
Check that the correction is skipped for MIR subarray data. | ||
""" | ||
# For MIRI, no reference pixel correction is performed on subarray data | ||
# No changes should be seen in the data arrays before and after correction |
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.
same as before, can these be both in the docstring?
Also as written currently it looks like this is a single-line docstring, in which case it should be on one line. Since this is in a file starting with test_
, the style checker doesn't ensure this is the case.
""" | ||
Check that odd/even rows are applied when flag is set. | ||
""" |
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.
Same here, and other instances below - single-line docstrings should be on one line.
I consider it less important in the tests, so feel free to ignore this, but since you went to the trouble of changing these I figure it can't hurt to try to get them to match as closely as possible with the rules in the rest of the repo
Addresses JP-3861
Closes #
This PR applies style rules for the refpix step files
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#>.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