Skip to content

Commit

Permalink
Use casa-formats-io package
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Nov 8, 2020
1 parent 71fd8e2 commit 8add544
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 1,310 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ docs/api

# Other generated stuff
*/version.py
*/cython_version.py
*/cython_version.py

.tmp
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ install_requires =
six
dask[array]
joblib
casa-formats-io @ git+https://github.com/radio-astro-tools/casa-formats-io

[options.extras_require]
test =
Expand Down
214 changes: 0 additions & 214 deletions spectral_cube/io/casa_dask.py

This file was deleted.

10 changes: 4 additions & 6 deletions spectral_cube/io/casa_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
from .. utils import BeamWarning
from .. import wcs_utils

from .casa_low_level_io import getdesc
from .casa_wcs import wcs_casa2astropy
from .casa_dask import casa_image_dask_reader
from casa_formats_io import getdesc, coordsys_to_astropy_wcs, image_to_dask

# Read and write from a CASA image. This has a few
# complications. First, by default CASA does not return the
Expand Down Expand Up @@ -59,14 +57,14 @@ def load_casa_image(filename, skipdata=False, memmap=True,

# read in the data
if not skipdata:
data = casa_image_dask_reader(filename, memmap=memmap)
data = image_to_dask(filename, memmap=memmap)

# CASA stores validity of data as a mask
if skipvalid:
valid = None
else:
try:
valid = casa_image_dask_reader(filename, memmap=memmap, mask=True)
valid = image_to_dask(filename, memmap=memmap, mask=True)
except FileNotFoundError:
valid = None

Expand Down Expand Up @@ -95,7 +93,7 @@ def load_casa_image(filename, skipdata=False, memmap=True,
else:
beam_ = {}

wcs = wcs_casa2astropy(casa_cs)
wcs = coordsys_to_astropy_wcs(casa_cs)

del casa_cs

Expand Down
Loading

0 comments on commit 8add544

Please sign in to comment.