cngi

CNGI Package

Module functions with blank descriptions have not been completed yet. As each function is completed, its description will be populated.

conversion

Legacy CASA uses a custom MS format while CNGI uses the standard Zarr format. These functions allow conversion between the two as well as directly from the telescope archival science data model (ASDM) (future growth). Note that both the MS and Zarr formats are directories, not single files.

This package has a dependency on legacy CASA / casacore and will be separated in the future to its own distribution apart from the rest of the CNGI package.

To access these functions, use your favorite variation of: import cngi.conversion

convert_image

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

convert_ms

Convert legacy format MS to xarray Visibility Dataset and zarr storage format

convert_table

Convert casacore table format to xarray Dataset and zarr storage format.

describe_ms

Summarize the contents of an MS directory in casacore table format

read_ms

Read legacy format MS to xarray Visibility Dataset

read_table

Read generic casacore table format to xarray Dataset

dio

Most CNGI functions operate on xarray Datasets while the data is stored on disk in Zarr format. These functions allow the transition back and forth between the two.

To access these functions, use your favorite variation of: import cngi.dio

append_xds

Append a list of dask arrays to a zarr file on disk. If a data variable with the same name is found it will be overwritten.

describe_vis

Summarize the contents of a zarr format Visibility directory on disk

read_image

Read xarray zarr format image from disk

read_vis

Read zarr format Visibility data from disk to xarray Dataset

write_image

Write image xarray dataset to zarr format on disk. When chunks_on_disk is not specified the chunking in the input dataset is used.

write_vis

Write xarray dataset to zarr format on disk. When chunks_on_disk is not specified the chunking in the input dataset is used.

direct

These functions allow direct access to the underlying Dask processing engine.

To access these functions, use your favorite variation of: import cngi.direct

InitializeFramework

Initialize the CNGI framework

GetFrameworkClient

Return the CNGI framework scheduler client

image

These functions examine or manipulate Image data in the xarray Dataset (xds) format. They take an xds as input and return a new xds or some other structure as output. Some may operate directly on the zarr data store on disk.

The input xarray Dataset is never modified.

To access these functions, use your favorite variation of: import cngi.image

cont_sub

Continuum subtraction of an image cube

fit_gaussian

Fit one or more elliptical gaussian components on an image region

fit_gaussian_rl

Fit one or more elliptical gaussian components on an image region

gaussian_beam

Construct a gaussian beam of image dimensions from specified size or beam attribute

implot

Plot a preview of Image xarray DataArray contents

mask

Create a new mask Data variable in the Dataset

moments

Collapse an n-dimensional image cube into a moment by taking a linear combination of individual planes

rebin

Rebin an n-dimensional image across any single (spatial or spectral) axis

reframe

Change the velocity system of an image

region

Create a new region Data variable in the Dataset

smooth

Smooth data along the spatial plane of the image cube.

spec_fit

Perform gaussian spectral line fits in the image cube

statistics

Generate statistics on specified image data contents

stokes_to_corr

Convert polarization data from Stokes parameters to the correlation basis.

vis

These functions examine or manipulate Visibility data in the xarray Dataset (xds) format. They take an xds as input and return a new xds or some other structure as output. Some may operate directly on the zarr data store on disk.

The input xarray Dataset is never modified.

To access these functions, use your favorite variation of: import cngi.vis

apply_flags

Apply flag variables to other data in Visibility Dataset

chan_average

Average data across the channel axis

chan_smooth

Apply a smoothing kernel to the channel axis

join_dataset

Join together two visibility zarr directories.

join_vis

Concatenate together two Visibility xds’s of compatible shape from the same mxds

reframe

Transform channel labels and visibilities to a spectral reference frame which is appropriate for analysis, e.g. from TOPO to LSRK or to correct for doppler shifts throughout the time of observation

split_dataset

Pull the xds visibilites out with the mxds, preserving only that information in the subtables that is related to the given visibilities.

time_average

Average data across the time axis

uv_cont_fit

Fit a polynomial regression to source data and return model values to target

visplot

Plot a preview of Visibility xarray DataArray contents