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 53025a9 commit c3b2428
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions gwcs/tests/test_wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ def test_to_fits_sip():
xflat = np.ravel(x[1:-1, 1:-1])
yflat = np.ravel(y[1:-1, 1:-1])
fn = os.path.join(data_path, 'miriwcs.asdf')
with asdf.open(fn, lazy_load=False, copy_arrays=True, ignore_missing_extensions=True) as af:
with asdf.open(fn, lazy_load=False, memmap=False, ignore_missing_extensions=True) as af:
miriwcs = af.tree['wcs']
bounding_box = ((0, 1024), (0, 1024))
mirisip = miriwcs.to_fits_sip(bounding_box, max_inv_pix_error=0.1, verbose=True)
Expand Down Expand Up @@ -1009,7 +1009,7 @@ def test_to_fits_tab_time_cube(gwcs_cube_with_separable_time):
def test_to_fits_tab_miri_image():
# gWCS:
fn = os.path.join(data_path, 'miriwcs.asdf')
with asdf.open(fn, copy_arrays=True, lazy_load=False, ignore_missing_extensions=True) as af:
with asdf.open(fn, memmap=False, lazy_load=False, ignore_missing_extensions=True) as af:
w = af.tree['wcs']

# FITS WCS -TAB:
Expand All @@ -1033,7 +1033,7 @@ def test_to_fits_tab_miri_image():

def test_to_fits_tab_miri_lrs():
fn = os.path.join(data_path, 'miri_lrs_wcs.asdf')
with asdf.open(fn, copy_arrays=True, lazy_load=False, ignore_missing_extensions=True) as af:
with asdf.open(fn, memmap=False, lazy_load=False, ignore_missing_extensions=True) as af:
w = af.tree['wcs']

# FITS WCS -TAB:
Expand Down Expand Up @@ -1102,7 +1102,7 @@ def test_in_image():

def test_iter_inv():
fn = os.path.join(data_path, 'nircamwcs.asdf')
with asdf.open(fn, lazy_load=False, copy_arrays=False, ignore_missing_extensions=True) as af:
with asdf.open(fn, lazy_load=False, memmap=True, ignore_missing_extensions=True) as af:
w = af.tree['wcs']
# remove analytic/user-supplied inverse:
w.pipeline[0].transform.inverse = None
Expand All @@ -1129,7 +1129,7 @@ def test_iter_inv():
)
assert np.allclose((x, y), (xp, yp))

with asdf.open(fn, lazy_load=False, copy_arrays=False, ignore_missing_extensions=True) as af:
with asdf.open(fn, lazy_load=False, memmap=True, ignore_missing_extensions=True) as af:
w = af.tree['wcs']

# test single point
Expand Down
2 changes: 1 addition & 1 deletion gwcs/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ def numerical_inverse(self, *args, tolerance=1e-5, maxiter=50, adaptive=True,
>>> import numpy as np
>>> filename = get_pkg_data_filename('data/nircamwcs.asdf', package='gwcs.tests')
>>> with asdf.open(filename, copy_arrays=True, lazy_load=False, ignore_missing_extensions=True) as af:
>>> with asdf.open(filename, memmap=False, lazy_load=False, ignore_missing_extensions=True) as af:
... w = af.tree['wcs']
>>> ra, dec = w([1,2,3], [1,1,1])
Expand Down

0 comments on commit c3b2428

Please sign in to comment.