Skip to content
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

RCAL-911 & 932: remove units from MOS and ELP pipelines. #1445

Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
27195a3
Remove units from MOS pipeline.
mairanteodoro Oct 7, 2024
75cb155
Update to point to temp RAD and datamodels installation.
mairanteodoro Oct 7, 2024
953961a
First refactoring of TweakRegStep to use stcal.
mairanteodoro Aug 29, 2024
89bd44e
Code cleanup/refactoring.
mairanteodoro Aug 30, 2024
c033702
Replace local method with stcal's.
mairanteodoro Aug 30, 2024
f015feb
Further code refactoring.
mairanteodoro Sep 4, 2024
a99761c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 4, 2024
79b667c
Utilize stcal's get_catalog method.
mairanteodoro Sep 4, 2024
42fef2c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 4, 2024
8991f9f
Add clip_accum=True to call to alignment methods.
mairanteodoro Sep 5, 2024
76eb339
Point stcal installation to main branch.
mairanteodoro Sep 10, 2024
7091433
Revert some refactoring.
mairanteodoro Sep 11, 2024
2313559
Refactor handling of invalid exposure types.
mairanteodoro Sep 16, 2024
f316920
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 16, 2024
9d48114
Address comments 2.
mairanteodoro Sep 17, 2024
a97482a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 17, 2024
c365437
Style refactoring.
mairanteodoro Sep 18, 2024
4876457
remove default values from docs
braingram Sep 23, 2024
1b6729a
add changelog
braingram Sep 23, 2024
be13903
fix warning
braingram Sep 23, 2024
89e7148
[CI] rename changelog check job to be more explicit on its purpose (#…
zacharyburnett Sep 24, 2024
7ea6e0a
update pull request checklist (#1336)
zacharyburnett Sep 24, 2024
2f96fba
RCAL-895: allow updating source catalog with tweaked WCS when running…
mairanteodoro Sep 26, 2024
91e9794
fix artifactory_repos for pytest 8
braingram Oct 1, 2024
6fb921c
remove MultilineLogger
braingram Aug 22, 2024
cc62ed2
remove unused variables
braingram Aug 8, 2024
a0d224a
raise on invalid input
braingram Aug 8, 2024
a016b37
update outlier detection docs for spec update
braingram Aug 8, 2024
ac9d89e
reference spec in arguments docs
braingram Aug 8, 2024
ddb72f3
add fragments
braingram Sep 30, 2024
128b657
use outlier detection from stcal
braingram Sep 30, 2024
4f6a6e9
remove unused kernel_size from docs
braingram Sep 30, 2024
a6a180a
update docs for new memory model
braingram Sep 30, 2024
3d31901
use resample_group in resample_many_to_many
braingram Sep 30, 2024
1f159fa
unskip and fix test
braingram Sep 30, 2024
dc7dd09
remove outdated comments
braingram Sep 30, 2024
35c8773
Update docs from review.
braingram Oct 1, 2024
a6bbac5
clarify in_memory
braingram Oct 1, 2024
d290ed4
fix test docstrings
braingram Oct 1, 2024
6c960ab
fix make_output_path docstring entry, add description of default buff…
braingram Oct 1, 2024
e81ff48
expand resample_group docstring
braingram Oct 1, 2024
d99682f
docs typo
braingram Oct 1, 2024
9c2a33f
add failing unit test
braingram Oct 3, 2024
ae00da2
work around NotImplemented Quantity.tofile
braingram Oct 3, 2024
50b439a
add changelog fragment
braingram Oct 3, 2024
f996663
Merge branch 'main' into RCAL-911-remove-units-from-mosaic-level-pipe…
mairanteodoro Oct 7, 2024
4abdef1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 7, 2024
83eae28
Check-style fixes.
mairanteodoro Oct 7, 2024
4e10107
Merge remote-tracking branch 'upstream/main' into RCAL-932-remove-uni…
mairanteodoro Oct 8, 2024
e704298
Begin removing units from ELP.
schlafly Oct 7, 2024
f118928
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 8, 2024
91155e6
Remove units (all unit tests passing).
mairanteodoro Oct 8, 2024
dd04cff
Point to rad+rdm @ RCAL-932.
mairanteodoro Oct 8, 2024
4ba2a7f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 8, 2024
2e37c98
Remove LV2_UNITS.
mairanteodoro Oct 8, 2024
75f3eb4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 8, 2024
17eed0a
Bug fix.
mairanteodoro Oct 9, 2024
9bd0f90
Fix failing unit tests.
mairanteodoro Oct 9, 2024
3226fa5
Remove regtest helper function.
mairanteodoro Oct 10, 2024
f0f1435
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 10, 2024
5921a2c
Fixes for the regression tests.
mairanteodoro Oct 10, 2024
ef289fa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 10, 2024
a755640
Remove ggsaa from file names.
schlafly Oct 11, 2024
68cea78
Remove ggsaa from file names.
schlafly Oct 11, 2024
5c9e4ce
More fixes.
mairanteodoro Oct 12, 2024
4214f85
Update make_regtestdata.sh
mairanteodoro Oct 14, 2024
9986b36
Merge branch 'main' into RCAL-932-remove-units-in-exposure-level-pipe…
mairanteodoro Oct 15, 2024
8b6a7fb
Update docstrings.
mairanteodoro Oct 15, 2024
7b46909
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 15, 2024
bc6877c
Add changelog entry.
mairanteodoro Oct 15, 2024
2748cba
Merge branch 'main' into RCAL-932-remove-units-in-exposure-level-pipe…
mairanteodoro Oct 15, 2024
f3070d0
Update test_photom.py
mairanteodoro Oct 15, 2024
e3b204c
Update skystatistics.py
mairanteodoro Oct 15, 2024
6521c27
Disable in conf.py.
mairanteodoro Oct 16, 2024
d1dd3b4
Remove ggsaa from filename used by new regtest.
mairanteodoro Oct 17, 2024
64674c0
Update pyproject.toml
PaulHuwe Oct 17, 2024
920fb46
Update pyproject.toml
PaulHuwe Oct 17, 2024
6bee47e
Merge branch 'main' into RCAL-932-remove-units-in-exposure-level-pipe…
PaulHuwe Oct 17, 2024
2cf8dbc
Update skymatch_step.py
PaulHuwe Oct 17, 2024
d5a0f52
Merge branch 'main' into RCAL-932-remove-units-in-exposure-level-pipe…
PaulHuwe Oct 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/1445.general.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove units from romancal.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def check_sphinx_version(expected_version):
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {"collapse_navigation": True, "display_version": True}
html_theme_options = {"collapse_navigation": True}
# "nosidebar": "false",
# "sidebarbgcolor": "#4db8ff",
# "sidebartextcolor": "black",
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ dependencies = [
"pyparsing >=2.4.7",
"requests >=2.26",
# "rad>=0.21.0,<0.22.0",
"rad @ git+https://github.com/spacetelescope/rad.git",
"rad @ git+https://github.com/mairanteodoro/rad.git@RCAL-932-remove-units-in-exposure-level-pipeline",
# "roman_datamodels>=0.21.0,<0.22.0",
"roman_datamodels @ git+https://github.com/spacetelescope/roman_datamodels.git",
"roman_datamodels @ git+https://github.com/mairanteodoro/roman_datamodels.git@RCAL-932-remove-units-in-exposure-level-pipeline",
"scipy >=1.11",
# "stcal>=1.8.0,<1.9.0",
"stcal @ git+https://github.com/spacetelescope/stcal.git@main",
Expand Down
2 changes: 1 addition & 1 deletion romancal/dark_current/dark_current_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def process(self, input):
# Do the dark correction
out_model = input_model
nresultants = len(input_model.meta.exposure["read_pattern"])
out_model.data -= dark_model.data[:nresultants]
out_model.data -= dark_model.data[:nresultants].value
out_model.pixeldq |= dark_model.dq
out_model.meta.cal_step.dark = "COMPLETE"

Expand Down
9 changes: 4 additions & 5 deletions romancal/dark_current/tests/test_dark.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import numpy as np
import pytest
import roman_datamodels as rdm
from astropy import units as u
from roman_datamodels import maker_utils
from roman_datamodels.datamodels import DarkRefModel, RampModel

Expand Down Expand Up @@ -60,20 +59,20 @@ def test_dark_step_subtraction(instrument, exptype):

# populate data array of science cube
for i in range(0, 20):
ramp_model.data[0, 0, i] = i * ramp_model.data.unit
ramp_model.data[0, 0, i] = i
darkref_model.data[0, 0, i] = i * 0.1 * darkref_model.data.unit
orig_model = ramp_model.copy()

# Perform Dark Current subtraction step
result = DarkCurrentStep.call(ramp_model, override_dark=darkref_model)

# check that the dark file is subtracted frame by frame from the science data
diff = orig_model.data.value - darkref_model.data.value
diff = orig_model.data - darkref_model.data.value

# test that the output data file is equal to the difference found when subtracting
# reffile from sci file
np.testing.assert_array_equal(
result.data.value, diff, err_msg="dark file should be subtracted from sci file "
result.data, diff, err_msg="dark file should be subtracted from sci file "
)


Expand Down Expand Up @@ -148,7 +147,7 @@ def create_ramp_and_dark(shape, instrument, exptype):
ramp.meta.instrument.detector = "WFI01"
ramp.meta.instrument.optical_element = "F158"
ramp.meta.exposure.type = exptype
ramp.data = u.Quantity(np.ones(shape, dtype=np.float32), u.DN, dtype=np.float32)
ramp.data = np.ones(shape, dtype=np.float32)
ramp_model = RampModel(ramp)

# Create dark model
Expand Down
19 changes: 5 additions & 14 deletions romancal/dq_init/tests/test_dq_init.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import pytest
from astropy import units as u
from roman_datamodels import maker_utils, stnode
from roman_datamodels.datamodels import MaskRefModel, ScienceRawModel
from roman_datamodels.dqflags import pixel
Expand Down Expand Up @@ -199,9 +198,7 @@ def test_dqinit_step_interface(instrument, exptype):
wfi_sci_raw.meta["guidestar"]["gw_window_xstart"] = 1012
wfi_sci_raw.meta["guidestar"]["gw_window_xsize"] = 16
wfi_sci_raw.meta.exposure.type = exptype
wfi_sci_raw.data = u.Quantity(
np.ones(shape, dtype=np.uint16), u.DN, dtype=np.uint16
)
wfi_sci_raw.data = np.ones(shape, dtype=np.uint16)
wfi_sci_raw[extra_key] = extra_value
wfi_sci_raw_model = ScienceRawModel(wfi_sci_raw)

Expand Down Expand Up @@ -251,9 +248,7 @@ def test_dqinit_refpix(instrument, exptype):
wfi_sci_raw.meta["guidestar"]["gw_window_xstart"] = 1012
wfi_sci_raw.meta["guidestar"]["gw_window_xsize"] = 16
wfi_sci_raw.meta.exposure.type = exptype
wfi_sci_raw.data = u.Quantity(
np.ones(shape, dtype=np.uint16), u.DN, dtype=np.uint16
)
wfi_sci_raw.data = np.ones(shape, dtype=np.uint16)
wfi_sci_raw_model = ScienceRawModel(wfi_sci_raw)

# Create mask model
Expand All @@ -272,7 +267,7 @@ def test_dqinit_refpix(instrument, exptype):

# check if reference pixels are correct
assert result.data.shape == (2, 20, 20) # no pixels should be trimmed
assert result.amp33.value.shape == (2, 4096, 128)
assert result.amp33.shape == (2, 4096, 128)
assert result.border_ref_pix_right.shape == (2, 20, 4)
assert result.border_ref_pix_left.shape == (2, 20, 4)
assert result.border_ref_pix_top.shape == (2, 4, 20)
Expand Down Expand Up @@ -304,9 +299,7 @@ def test_dqinit_resultantdq(instrument, exptype):
wfi_sci_raw.meta["guidestar"]["gw_window_xsize"] = 16
wfi_sci_raw.meta.exposure.type = exptype
wfi_sci_raw.resultantdq[1, 12, 12] = pixel["DROPOUT"]
wfi_sci_raw.data = u.Quantity(
np.ones(shape, dtype=np.uint16), u.DN, dtype=np.uint16
)
wfi_sci_raw.data = np.ones(shape, dtype=np.uint16)
wfi_sci_raw_model = ScienceRawModel(wfi_sci_raw)

# Create mask model
Expand Down Expand Up @@ -354,9 +347,7 @@ def test_dqinit_getbestref(instrument, exptype):
wfi_sci_raw.meta["guidestar"]["gw_window_xstart"] = 1012
wfi_sci_raw.meta["guidestar"]["gw_window_xsize"] = 16
wfi_sci_raw.meta.exposure.type = exptype
wfi_sci_raw.data = u.Quantity(
np.ones(shape, dtype=np.uint16), u.DN, dtype=np.uint16
)
wfi_sci_raw.data = np.ones(shape, dtype=np.uint16)
wfi_sci_raw_model = ScienceRawModel(wfi_sci_raw)

# Perform Data Quality application step
Expand Down
7 changes: 1 addition & 6 deletions romancal/flatfield/flat_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import logging

import numpy as np
from astropy import units as u
from roman_datamodels.dqflags import pixel

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -105,9 +104,7 @@ def apply_flat_field(science, flat):
flat_data[np.where(flat_bad)] = 1.0
# Now let's apply the correction to science data and error arrays. Rely
# on array broadcasting to handle the cubes
science.data = u.Quantity(
(science.data.value / flat_data), u.DN / u.s, dtype=science.data.dtype
)
science.data = (science.data / flat_data).astype(science.data.dtype)

# Update the variances using BASELINE algorithm. For guider data, it has
# not gone through ramp fitting so there is no Poisson noise or readnoise
Expand All @@ -121,8 +118,6 @@ def apply_flat_field(science, flat):
science.var_flat = science.data**2 / flat_data_squared * flat_err**2

science.err = np.sqrt(science.var_poisson + science.var_rnoise + science.var_flat)
science.err = science.err.to(science.data.unit)
# Workaround for https://github.com/astropy/astropy/issues/16055

# Combine the science and flat DQ arrays
science.dq = np.bitwise_or(science.dq, flat_dq)
21 changes: 5 additions & 16 deletions romancal/flatfield/tests/test_flatfield.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import pytest
from astropy import units as u
from astropy.time import Time
from roman_datamodels import maker_utils, stnode
from roman_datamodels.datamodels import FlatRefModel, ImageModel
Expand All @@ -26,22 +25,12 @@ def test_flatfield_step_interface(instrument, exptype):
wfi_image.meta.instrument.detector = "WFI01"
wfi_image.meta.instrument.optical_element = "F158"
wfi_image.meta.exposure.type = exptype
wfi_image.data = u.Quantity(
np.ones(shape, dtype=np.float32), u.DN / u.s, dtype=np.float32
)
wfi_image.data = np.ones(shape, dtype=np.float32)
wfi_image.dq = np.zeros(shape, dtype=np.uint32)
wfi_image.err = u.Quantity(
np.zeros(shape, dtype=np.float32), u.DN / u.s, dtype=np.float32
)
wfi_image.var_poisson = u.Quantity(
np.zeros(shape, dtype=np.float32), u.DN**2 / u.s**2, dtype=np.float32
)
wfi_image.var_rnoise = u.Quantity(
np.zeros(shape, dtype=np.float32), u.DN**2 / u.s**2, dtype=np.float32
)
wfi_image.var_flat = u.Quantity(
np.zeros(shape, dtype=np.float32), u.DN**2 / u.s**2, dtype=np.float32
)
wfi_image.err = np.zeros(shape, dtype=np.float32)
wfi_image.var_poisson = np.zeros(shape, dtype=np.float32)
wfi_image.var_rnoise = np.zeros(shape, dtype=np.float32)
wfi_image.var_flat = np.zeros(shape, dtype=np.float32)

wfi_image_model = ImageModel(wfi_image)
flatref = stnode.FlatRef()
Expand Down
24 changes: 6 additions & 18 deletions romancal/flux/flux_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import logging

import astropy.units as u
from roman_datamodels import datamodels

from ..datamodels import ModelLibrary
Expand All @@ -14,10 +13,6 @@
__all__ = ["FluxStep"]


# Define expected Level 2 units
LV2_UNITS = u.DN / u.s


class FluxStep(RomanStep):
"""Apply flux scaling to count-rate data

Expand Down Expand Up @@ -104,26 +99,19 @@
DATA = ("data", "err")
VARIANCES = ("var_rnoise", "var_poisson", "var_flat")

if model.data.unit == model.meta.photometry.conversion_megajanskys.unit:
log.info(
f"Input data is already in flux units of {model.meta.photometry.conversion_megajanskys.unit}."
)
log.info("Flux correction already applied.")
return

if model.data.unit != LV2_UNITS:
if model.meta.cal_step["flux"] == "COMPLETE":
message = (
f"Input data units {model.data.unit} are not in the expected units of {LV2_UNITS}"
"\nAborting flux correction"
"Input data is already in flux units of MJy/sr."
"\nFlux correction already applied."
)
[log.error(line) for line in message.splitlines()]
raise ValueError(message)
log.info(message)
return

Check warning on line 108 in romancal/flux/flux_step.py

View check run for this annotation

Codecov / codecov/patch

romancal/flux/flux_step.py#L107-L108

Added lines #L107 - L108 were not covered by tests

# Apply the correction.
# The end goal in units is to have MJy/sr. The scale is in MJy/sr also.
# Hence the extra factor of s/DN must be applied to cancel DN/s.
log.debug("Flux correction being applied")
c_mj = model.meta.photometry.conversion_megajanskys / model.data.unit
c_mj = model.meta.photometry.conversion_megajanskys
for data in DATA:
model[data] = model[data] * c_mj
for variance in VARIANCES:
Expand Down
33 changes: 8 additions & 25 deletions romancal/flux/tests/test_flux_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from romancal.datamodels import ModelLibrary
from romancal.flux import FluxStep
from romancal.flux.flux_step import LV2_UNITS


@pytest.mark.parametrize(
Expand All @@ -23,7 +22,7 @@
def test_attributes(flux_step, attr, factor):
"""Test that the attribute has been scaled by the right factor"""
original, result = flux_step
c_unit = 1.0 / LV2_UNITS
c_unit = 1.0

# Handle difference between just a single image and a list.
if isinstance(original, datamodels.ImageModel):
Expand Down Expand Up @@ -86,31 +85,15 @@ def flux_step(request):
@pytest.fixture(scope="module")
def image_model():
"""Product a basic ImageModel"""
# Create a random image and specify a conversion.
# Create a random image and specify a conversion
rng = np.random.default_rng()
shape = (10, 10)
image_model = maker_utils.mk_datamodel(datamodels.ImageModel, shape=shape)
image_model.data = u.Quantity(
rng.poisson(2.5, size=shape).astype(np.float32),
LV2_UNITS,
dtype=np.float32,
)
image_model.var_rnoise = u.Quantity(
rng.normal(1, 0.05, size=shape).astype(np.float32),
LV2_UNITS**2,
dtype=np.float32,
)
image_model.var_poisson = u.Quantity(
rng.poisson(1, size=shape).astype(np.float32),
LV2_UNITS**2,
dtype=np.float32,
)
image_model.var_flat = u.Quantity(
rng.uniform(0, 1, size=shape).astype(np.float32),
LV2_UNITS**2,
dtype=np.float32,
)
image_model.meta.photometry.conversion_megajanskys = 2.0 * u.MJy / u.sr
image_model.data = rng.poisson(2.5, size=shape).astype(np.float32)
image_model.var_rnoise = rng.normal(1, 0.05, size=shape).astype(np.float32)
image_model.var_poisson = rng.poisson(1, size=shape).astype(np.float32)
image_model.var_flat = rng.uniform(0, 1, size=shape).astype(np.float32)
image_model.meta.photometry.conversion_megajanskys = (2.0 * u.MJy / u.sr).value

return image_model

Expand All @@ -129,6 +112,6 @@ def input_modellibrary(image_model):
# Create and return a ModelLibrary
image_model1 = image_model.copy()
image_model2 = image_model.copy()
image_model2.meta.photometry.conversion_megajanskys = 0.5 * u.MJy / u.sr
image_model2.meta.photometry.conversion_megajanskys = (0.5 * u.MJy / u.sr).value
container = ModelLibrary([image_model1, image_model2])
return container
5 changes: 3 additions & 2 deletions romancal/jump/jump_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ def process(self, input):

# Extract the needed info from the Roman Data Model
meta = input_model.meta
r_data = input_model.data.value
r_data = input_model.data
r_gdq = input_model.groupdq
r_pdq = input_model.pixeldq
r_err = input_model.err.value
r_err = input_model.err
result = input_model

# If the ramp fitting jump detection is enabled, then skip this step
Expand Down Expand Up @@ -106,6 +106,7 @@ def process(self, input):
self.log.info("Maximum cores to use = %s", max_cores)

# Get the gain and readnoise reference files
# TODO: remove units from gain and RN reference files
gain_filename = self.get_reference_file(input_model, "gain")
self.log.info("Using GAIN reference file: %s", gain_filename)
gain_model = rdd.GainRefModel(gain_filename)
Expand Down
16 changes: 7 additions & 9 deletions romancal/jump/tests/test_jump_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ def _setup(
dm_ramp.meta.instrument.name = "WFI"
dm_ramp.meta.instrument.optical_element = "F158"

dm_ramp.data = u.Quantity(data + 6.0, u.DN, dtype=np.float32)
dm_ramp.data = data + 6.0
dm_ramp.pixeldq = pixdq
dm_ramp.groupdq = gdq
dm_ramp.err = u.Quantity(err, u.DN, dtype=np.float32)
dm_ramp.err = err

dm_ramp.meta.exposure.type = "WFI_IMAGE"
dm_ramp.meta.exposure.group_time = deltatime
Expand Down Expand Up @@ -148,7 +148,7 @@ def test_one_CR(generate_wfi_reffiles, max_cores, setup_inputs):
)

for i in range(ngroups):
model1.data[i, :, :] = deltaDN * i * model1.data.unit
model1.data[i, :, :] = deltaDN * i

first_CR_group_locs = [x for x in range(1, 7) if x % 5 == 0]

Expand All @@ -161,8 +161,7 @@ def test_one_CR(generate_wfi_reffiles, max_cores, setup_inputs):
for i in range(len(CR_x_locs)):
CR_group = next(CR_pool)
model1.data[CR_group:, CR_y_locs[i], CR_x_locs[i]] = (
model1.data[CR_group:, CR_y_locs[i], CR_x_locs[i]]
+ 5000.0 * model1.data.unit
model1.data[CR_group:, CR_y_locs[i], CR_x_locs[i]] + 5000.0
)

out_model = JumpStep.call(
Expand Down Expand Up @@ -203,7 +202,7 @@ def test_two_CRs(generate_wfi_reffiles, max_cores, setup_inputs):
)

for i in range(ngroups):
model1.data[i, :, :] = deltaDN * i * model1.data.unit
model1.data[i, :, :] = deltaDN * i

first_CR_group_locs = [x for x in range(1, 7) if x % 5 == 0]
CR_locs = [x for x in range(xsize * ysize) if x % CR_fraction == 0]
Expand All @@ -215,11 +214,10 @@ def test_two_CRs(generate_wfi_reffiles, max_cores, setup_inputs):
CR_group = next(CR_pool)

model1.data[CR_group:, CR_y_locs[i], CR_x_locs[i]] = (
model1.data[CR_group:, CR_y_locs[i], CR_x_locs[i]] + 5000 * model1.data.unit
model1.data[CR_group:, CR_y_locs[i], CR_x_locs[i]] + 5000
)
model1.data[CR_group + 8 :, CR_y_locs[i], CR_x_locs[i]] = (
model1.data[CR_group + 8 :, CR_y_locs[i], CR_x_locs[i]]
+ 700 * model1.data.unit
model1.data[CR_group + 8 :, CR_y_locs[i], CR_x_locs[i]] + 700
)

out_model = JumpStep.call(
Expand Down
Loading