Skip to content

Commit

Permalink
replace usages of copy_arrays with memmap
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Jul 18, 2024
1 parent 2b19fc4 commit 70200a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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 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 70200a2

Please sign in to comment.