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

replace usages of copy_arrays with memmap #1316

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading