Skip to content

Commit

Permalink
Merge branch 'master' into release_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
tapastro committed Sep 20, 2024
2 parents 5b561d3 + 40a019e commit ebdf6ad
Show file tree
Hide file tree
Showing 58 changed files with 1,908 additions and 1,400 deletions.
97 changes: 96 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ calwebb_detector1
- Added the optional ``clean_flicker_noise`` step between ``jump`` and
``ramp_fit``. [#8669]

change_migration
----------------

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

clean_flicker_noise
-------------------

Expand All @@ -82,12 +87,20 @@ cube_build

- Replaced deep copies of NIRSpec WCS objects within most loops. [#8793]

- Allow the user to provide ra and dec shifts to apply for each file to fine
tune the WCS. [#8720]

datamodels
----------

- Added `ModelLibrary` class to allow passing on-disk models between steps in the
image3 pipeline. [#8683]

dark_current
------------

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

documentation
-------------

Expand All @@ -96,12 +109,30 @@ documentation
- Updated description of association keyword `expname`: including path information
in addition to the filename is discouraged, but allowed. [#8789]

dq_init
--------

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

emicorr
-------

- Fixed a bug where MIRI EMI correction step would return NaNs when it was unable
to compute a correction. [#8675]

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

extract_1d
----------

- Updated NIRISS SOSS extraction to utilize ``pastasoss``
rotation solution. [#8763]

first_frame
-----------

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

flat_field
----------

Expand All @@ -110,6 +141,11 @@ flat_field

- Replaced deep copies of NIRSpec WCS objects within most loops [#8793]

gain_scale
----------

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

general
-------

Expand All @@ -123,12 +159,37 @@ general

- bump dependency to use ``stcal 1.9.0`` [#8808]

group_scale
-----------

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

ipc
---

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

jump
----

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

klip
----

- Allowed klip to ingest a single shifted 3-D PSF model instead of a 4-D structure
containing one shifted PSF per science integration. [#8747]

lastframe
---------

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

linearity
---------

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

master_background
-----------------

Expand Down Expand Up @@ -193,6 +254,11 @@ pathloss

- Replaced deep copies of NIRSpec WCS objects within most loops [#8793]

persistence
-----------

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

photom
------

Expand Down Expand Up @@ -229,6 +295,18 @@ ramp_fitting
- Updated the flow of the detector 1 pipeline when selecting the ``LIKELY`` algorithm
for ramp fitting. The ramps must contain a minimum number of groups (4).[#8631]

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

refpix
------

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

regtest
-------

- Added memory usage test for Detector1 pipeline. [#8676]

resample
--------

Expand All @@ -242,6 +320,11 @@ resample
- Ensure that NaNs and DO_NOT_USE flags match up in all input data before
resampling. [#8557]

reset
-----

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

resample_spec
-------------

Expand All @@ -266,12 +349,19 @@ resample_spec
- Ensure that NaNs and DO_NOT_USE flags match up in all input data before
resampling. [#8557]

rscd
----

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

saturation
----------

- Add option for using the readout pattern information to improve saturation flagging
in grouped data. [#8731]


- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

scripts
-------

Expand All @@ -298,6 +388,11 @@ stpipe

- Log jwst version at end of `Step.run`. [#8769]

superbias
---------

- Removed unnecessary copies, and created a single copy at step.py level. [#8676]

tso_photometry
--------------

Expand Down
45 changes: 45 additions & 0 deletions docs/jwst/cube_build/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ The following arguments control the size and sampling characteristics of the out
``nspax_y``
The odd integer number of spaxels to use in the y dimension of the tangent plane.

``offset_file [string]``
The string contains the name of the file holding RA and Dec offsets to apply to each input file. This file
must be an asdf file with a specific format. For details on how to construct the offset file see
:ref:`offsets`.


``coord_system [string]``
The default IFU cubes are built on the ra-dec coordinate system (``coord_system=skyalign``). In these cubes north is up
and east is left. There are two other coordinate systems an IFU cube can be built on:
Expand Down Expand Up @@ -122,3 +128,42 @@ A parameter only used for investigating which detector pixels contributed to a c

The string is the x,y,z value of the cube spaxel that is being investigated. The numbering starts counting at 0.
To print information to the screeen about the x = 10, y = 20, z = 35 spaxel the parameter string value is '10 20 35'.

.. _offsets:

Creating an offset file
-----------------------

The offset file is an ASDF formatted file :`<https://asdf-standard.readthedocs.io/>`_ stands for "Advanced Scientific Data.
For each input file in the spec3 association used to build the IFU cubes, the offset file needs to have a
corresponding right ascension and declination offset given in arc seconds.

Below is an example of how to make an ASDF offset file. It is assumed the user has determined the
offsets to apply to the data in each file. The offsets information is stored in three lists:
`filename`, `raoffset` and `decoffset`. The units of the Ra and Dec offsets
are required to be in the offset file and only the unit, `arcsec`, is allowed. The file names should
not contain the directory path. The offset file can have any name, but it must have the `asdf` extension.

An example of making an offset file for an association containing three files is:

.. code-block:: python
import asdf
import astropy.units as u
filename = ['file1.fits', 'file2.fits', 'file3.fits']
raoffset = [0.0, -1.0, 1.0]
decoffset = [0.0, 1.0, -1.0]
tree = {
"units": str(u.arcsec),
"filename": filename,
"raoffset": raoffset,
"decoffset": decoffset
}
af = asdf.AsdfFile(tree)
af.write_to('offsets.asdf')
af.close()
3 changes: 0 additions & 3 deletions docs/jwst/emicorr/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ The ``emicorr`` step has the following step-specific arguments.
If True, the reference wavelength will be scaled to the
data's phase amplitude.

``--user_supplied_reffile`` (boolean, default=None)
This is to specify an ASDF-format user-created reference file.

``--save_intermediate_results`` (string, default=False)
This is a boolean flag to specify whether to write a step output
file with the EMI correction, and a reference file with all the
Expand Down
5 changes: 0 additions & 5 deletions docs/jwst/extract_1d/arguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ The ``extract_1d`` step has the following step-specific arguments.
used when soss_wave_grid is not provided to make sure the computation time or the memory
used stays reasonable. Default value is 20000.

``--soss_transform``
This is a NIRISS-SOSS algorithm-specific parameter; this defines a rotation to
apply to the reference files to match the observation. It should be specified as
a list of three floats, with default values of None.

``--soss_tikfac``
This is a NIRISS-SOSS algorithm-specific parameter; this is the regularization
factor used in the SOSS extraction. If not specified, ATOCA will calculate a
Expand Down
11 changes: 4 additions & 7 deletions jwst/charge_migration/charge_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
CHLO_DNU = CHLO + DNU


def charge_migration(input_model, signal_threshold):
def charge_migration(output_model, signal_threshold):
"""
Correct for chargemigration
Parameters
----------
input_model : `~jwst.datamodels.RampModel`
output_model : `~jwst.datamodels.RampModel`
The input science data to be corrected
signal_threshold : float
Expand All @@ -35,11 +35,8 @@ def charge_migration(input_model, signal_threshold):
DO_NOT_USE flags to groups exceeding signal_threshold
"""
data = input_model.data
gdq = input_model.groupdq

# Create the output model as a copy of the input
output_model = input_model.copy()
data = output_model.data
gdq = output_model.groupdq

log.info('Using signal_threshold: %.2f', signal_threshold)

Expand Down
19 changes: 10 additions & 9 deletions jwst/charge_migration/charge_migration_step.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#! /usr/bin/env python
import logging

from ..stpipe import Step

from stdatamodels.jwst import datamodels
from ..stpipe import Step

from . import charge_migration

Expand All @@ -25,22 +24,24 @@ class ChargeMigrationStep(Step):
skip = boolean(default=True)
"""

def process(self, input):
def process(self, step_input):

# Open the input data model
with datamodels.RampModel(input) as input_model:
with datamodels.RampModel(step_input) as input_model:

if (input_model.data.shape[1] < 3): # skip step if only 1 or 2 groups/integration
log.info('Too few groups per integration; skipping charge_migration')

result = input_model
result.meta.cal_step.charge_migration = 'SKIPPED'

return result
input_model.meta.cal_step.charge_migration = 'SKIPPED'
return input_model

# Work on a copy
result = input_model.copy()

# Retrieve the parameter value(s)
signal_threshold = self.signal_threshold

result = charge_migration.charge_migration(input_model, signal_threshold)
result = charge_migration.charge_migration(result, signal_threshold)
result.meta.cal_step.charge_migration = 'COMPLETE'

return result
Loading

0 comments on commit ebdf6ad

Please sign in to comment.