cngi.conversion.convert_image

convert_image(infile, outfile=None, artifacts=[], compressor=None, chunks=(- 1, - 1, 1, 1))[source]

Convert legacy CASA or FITS format Image to xarray Image Dataset and zarr storage format

This function requires CASA6 casatools module.

Parameters
  • infile (str) – Input image filename (.image or .fits format). If taylor terms are present, they should be in the form of filename.image.tt0 and this infile string should be filename.image

  • outfile (str) – Output zarr filename. If None, will use infile name with .img.zarr extension

  • artifacts (list of str) – List of other image artifacts to include if present with infile. Use None for just the specified infile. Default [] uses ['mask','model','pb','psf','residual','sumwt','weight']

  • compressor (numcodecs.blosc.Blosc) – The blosc compressor to use when saving the converted data to disk using zarr. If None the zstd compression algorithm used with compression level 2.

  • chunks (4-D tuple of ints) – Shape of desired chunking in the form of (l, m, channels, polarization), use -1 for entire axis in one chunk. Default is (-1, -1, 1, 1) Note: chunk size is the product of the four numbers (up to the actual size of the dimension)

Returns

new xarray Datasets of Image data contents

Return type

xarray.core.dataset.Dataset