Skip to content

Commit

Permalink
replace usages of copy_arrays with memmap (spacetelescope#1316)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Jul 22, 2024
1 parent 362084f commit 5f9d8d6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ general

- Rename highlevelpipeline to mosaic pipeline [#1249]

- replace usages of ``copy_arrays`` with ``memmap`` [#1316]

source_catalog
--------------
- Add PSF photometry capability. [#1243]
Expand Down
4 changes: 2 additions & 2 deletions docs/roman/datamodels/datamodels_asdf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ To access the files via a python session,
with rdm.open('r0000101001001001001_01101_0001_WFI16_cal.asdf') as model:
<Manipulate the files>
with asdf.open('r0000101001001001001_01101_0001_WFI16_cal.asdf', copy_arrays=True) as model:
with asdf.open('r0000101001001001001_01101_0001_WFI16_cal.asdf', memmap=False) as model:
<Manipulate the files>
Once the files are loaded you can access various attributes. Below is a table
Expand Down Expand Up @@ -103,7 +103,7 @@ The ASDF equivalent is

If you trigger an error,
"ValueError: assignment destination is read-only"
make sure the asdf file was opened with copy_arrays=True, or
make sure the asdf file was opened with memmap=False, or
with mode='rw'

You can also access and modify the data arrays
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = [
"asdf >=2.15.0",
"asdf >=3.1.0",
"asdf-astropy >=0.5.0",
"astropy >=5.3.0",
"crds >=11.16.16",
Expand Down
2 changes: 1 addition & 1 deletion romancal/linearity/linearity_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def process(self, input):

return input_model

lin_model = rdd.LinearityRefModel(self.lin_name, copy_arrays=True)
lin_model = rdd.LinearityRefModel(self.lin_name, memmap=False)

# copy poly coeffs from linearity model so Nan's can be updated
lin_coeffs = lin_model.coeffs
Expand Down
2 changes: 1 addition & 1 deletion romancal/regtest/regtestdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ def compare_asdf(result, truth, ignore=None, rtol=1e-05, atol=1e-08, equal_nan=T
# lazy loading and memmory mapping
open_kwargs = {
"lazy_load": False,
"copy_arrays": True,
"memmap": False,
}
with (
asdf.open(result, **open_kwargs) as af0,
Expand Down

0 comments on commit 5f9d8d6

Please sign in to comment.