Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/spacetelescope/jwst into …
Browse files Browse the repository at this point in the history
…JP-3741
  • Loading branch information
emolter committed Sep 20, 2024
2 parents 87b8504 + 217d660 commit d6821d9
Show file tree
Hide file tree
Showing 61 changed files with 2,012 additions and 1,418 deletions.
116 changes: 110 additions & 6 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
1.15.2 (unreleased)
1.16.1 (unreleased)
===================

outlier_detection
-----------------

- Decrease the amount of file I/O required to compute the median when `in_memory`
is set to `False`. [#8782]

resample
--------

- Permit creating drizzled models one at a time in many-to-many mode. [#8782]

1.16.0 (2024-09-20)
===================

align_refs
Expand Down Expand Up @@ -63,6 +77,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 +101,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 +123,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 +155,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 +173,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 +268,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 +309,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,7 +334,10 @@ resample
- Ensure that NaNs and DO_NOT_USE flags match up in all input data before
resampling. [#8557]

- Permit creating drizzled models one at a time in many-to-many mode. [#8782]
reset
-----

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

resample_spec
-------------
Expand All @@ -268,12 +363,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 @@ -300,6 +402,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 Expand Up @@ -609,9 +716,6 @@ outlier_detection
- Fixed a bug that caused different results from the median calculation when the
`in_memory` parameter was set to `True` vs `False`. [#8777]

- Decrease the amount of file I/O required to compute the median when `in_memory`
is set to `False`. [#8782]

pathloss
--------

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ the specified context and less than the context for the next release.

| jwst tag | DMS build | SDP_VER | CRDS_CONTEXT | Released | Ops Install | Notes |
|---------------------|-----------|----------|--------------|------------|-------------|-----------------------------------------------|
| 1.15.1 | B11.0rc2 | TBD | 1242 | 2024-07-08 | TBD | Second release candidate for B11.0 |
| 1.15.0 | B11.0rc1 | TBD | 1241 | 2024-06-26 | TBD | First release candidate for B11.0 |
| 1.16.0 | B11.1rc1 | TBD | 1281 | 2024-09-20 | TBD | First release candidate for B11.1 |
| 1.15.1 | B11.0 | 2024.2.2 | 1242 | 2024-07-08 | 2024-09-12 | Final release candidate for B11.0 |
| 1.15.0 | B11.0rc1 | | 1241 | 2024-06-26 | | First release candidate for B11.0 |
| 1.14.1 | | | 1238 | 2024-06-27 | | PyPI-only release for external users |
| 1.14.0 | B10.2.1 | 2024.1.1 | 1238 | 2024-03-29 | 2024-06-12 | Final release candidate for B10.2.1 |
| 1.13.4 | | | 1185 | 2024-01-25 | | PyPI-only release for external users |
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 d6821d9

Please sign in to comment.