From 70200a234bc24847e4a2ecb592aca98da0cec205 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Thu, 18 Jul 2024 10:37:35 -0400 Subject: [PATCH] replace usages of ``copy_arrays`` with ``memmap`` --- docs/roman/datamodels/datamodels_asdf.rst | 4 ++-- romancal/linearity/linearity_step.py | 2 +- romancal/regtest/regtestdata.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/roman/datamodels/datamodels_asdf.rst b/docs/roman/datamodels/datamodels_asdf.rst index e8dfff2d7..b75971ad1 100644 --- a/docs/roman/datamodels/datamodels_asdf.rst +++ b/docs/roman/datamodels/datamodels_asdf.rst @@ -65,7 +65,7 @@ To access the files via a python session, with rdm.open('r0000101001001001001_01101_0001_WFI16_cal.asdf') as model: - 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: Once the files are loaded you can access various attributes. Below is a table @@ -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 diff --git a/romancal/linearity/linearity_step.py b/romancal/linearity/linearity_step.py index 6bd083281..6e42cde8b 100644 --- a/romancal/linearity/linearity_step.py +++ b/romancal/linearity/linearity_step.py @@ -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 diff --git a/romancal/regtest/regtestdata.py b/romancal/regtest/regtestdata.py index 94d7fad9f..8f950ef9f 100644 --- a/romancal/regtest/regtestdata.py +++ b/romancal/regtest/regtestdata.py @@ -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,