Skip to main content

xarray Datasets from CASA Tables

PyPI package dask-ms-2 https://github.com/tmolteno/dask-ms/actions/workflows/ci.yml/badge.svg Documentation Status

Constructs xarray Datasets from CASA Tables via casacure, a pure-Rust implementation of the CASA table system. The Variables contained in the Dataset are dask arrays backed by deferred calls to casacure.tables.table.getcol.

Supports writing Variables back to the respective column in the Table.

The intention behind this package is to support the Measurement Set as a data source and sink for the purposes of writing parallel, distributed Radio Astronomy algorithms.

Installation

To install with xarray support:

$ pip install dask-ms-2[xarray]

Without xarray similar, but reduced Dataset functionality is replicated in dask-ms itself. Expert users may wish to use this option to reduce python package dependencies.

$ pip install dask-ms-2

Backend

Table I/O goes through casacure, a pure-Rust implementation of the CASA table system, installed as a dependency of this package and used automatically — there is nothing to select, configure or build. The package is published on PyPI as dask-ms-2:

$ pip install dask-ms-2
$ python my_pipeline.py

casacure ships wheels for Linux, macOS and Windows, so no C/C++ casacore libraries are involved and no casacore Measures data is needed.

Documentation

https://dask-ms.readthedocs.io

Gitter Page

https://gitter.im/dask-ms/community

Example Usage

  import dask.array as da
  from daskms import xds_from_table, xds_to_table

  # Create xarray datasets from Measurement Set "WSRT.MS"
  ds = xds_from_table("WSRT.MS")
  # Set the flag Variable on first Dataset to it's inverse
  ds[0]['flag'] = (ds[0].flag.dims, da.logical_not(ds[0].flag))
  # Write the flag column back to the Measurement Set
  xds_to_table(ds, "WSRT.MS", "FLAG").compute()

  print ds

[<xarray.Dataset>
 Dimensions:         (chan: 64, corr: 4, row: 6552, uvw: 3)
 Coordinates:
     ROWID           (row) int32 dask.array<shape=(6552,), chunksize=(6552,)>
 Dimensions without coordinates: chan, corr, row, uvw
 Data variables:
     IMAGING_WEIGHT  (row, chan) float32 dask.array<shape=(6552, 64), chunksize=(6552, 64)>
     ANTENNA1        (row) int32 dask.array<shape=(6552,), chunksize=(6552,)>
     STATE_ID        (row) int32 dask.array<shape=(6552,), chunksize=(6552,)>
     EXPOSURE        (row) float64 dask.array<shape=(6552,), chunksize=(6552,)>
     MODEL_DATA      (row, chan, corr) complex64 dask.array<shape=(6552, 64, 4), chunksize=(6552, 64, 4)>
     FLAG_ROW        (row) bool dask.array<shape=(6552,), chunksize=(6552,)>
     CORRECTED_DATA  (row, chan, corr) complex64 dask.array<shape=(6552, 64, 4), chunksize=(6552, 64, 4)>
     PROCESSOR_ID    (row) int32 dask.array<shape=(6552,), chunksize=(6552,)>
     WEIGHT          (row, corr) float32 dask.array<shape=(6552, 4), chunksize=(6552, 4)>
     FLAG            (row, chan, corr) bool dask.array<shape=(6552, 64, 4), chunksize=(6552, 64, 4)>
     TIME            (row) float64 dask.array<shape=(6552,), chunksize=(6552,)>
     SIGMA           (row, corr) float32 dask.array<shape=(6552, 4), chunksize=(6552, 4)>
     SCAN_NUMBER     (row) int32 dask.array<shape=(6552,), chunksize=(6552,)>
     INTERVAL        (row) float64 dask.array<shape=(6552,), chunksize=(6552,)>
     OBSERVATION_ID  (row) int32 dask.array<shape=(6552,), chunksize=(6552,)>
     TIME_CENTROID   (row) float64 dask.array<shape=(6552,), chunksize=(6552,)>
     ARRAY_ID        (row) int32 dask.array<shape=(6552,), chunksize=(6552,)>
     ANTENNA2        (row) int32 dask.array<shape=(6552,), chunksize=(6552,)>
     DATA            (row, chan, corr) complex64 dask.array<shape=(6552, 64, 4), chunksize=(6552, 64, 4)>
     FEED1           (row) int32 dask.array<shape=(6552,), chunksize=(6552,)>
     FEED2           (row) int32 dask.array<shape=(6552,), chunksize=(6552,)>
     UVW             (row, uvw) float64 dask.array<shape=(6552, 3), chunksize=(6552, 3)>
 Attributes:
     FIELD_ID:      0
     DATA_DESC_ID:  0]

Limitations

  1. Many Measurement Sets columns are defined as variably shaped, but the actual data is fixed. dask-ms will infer the shape of the data from the first row and must be consistent with that of other rows. For example, this may be issue where multiple Spectral Windows are present in the Measurement Set with differing channels per SPW.

    dask-ms works around this by partitioning the Measurement Set into multiple datasets. The first row’s shape is used to infer the shape of the partition. Thus, in the case of multiple Spectral Window’s, we can partition the Measurement Set by DATA_DESC_ID to create a dataset for each Spectral Window.

Metadata

Release files for dask-ms-2 0.2.37

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dask-ms-2 0.2.37
File Size Uploaded Provenance Actions
dask_ms_2-0.2.37.tar.gz 570.6 kB With provenance Details for dask_ms_2-0.2.37.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dask-ms-2 0.2.37
File Interpreter ABI Platform Actions
dask_ms_2-0.2.37-py3-none-any.whl Python 3 none any Details for dask_ms_2-0.2.37-py3-none-any.whl

Total release size: 744.4 kB

Release files / dask_ms_2-0.2.37.tar.gz

Download URL dask_ms_2-0.2.37.tar.gz
Size 570.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d6930e9b0c2171637a32fccb98ba2fe0f378ab7d3a9d66e035a10b6e240fe4c4
BLAKE2b-256 checksum
How to use checksums
dd23cbd43917aef553db9d96d528c48a75ff4999dd11154a7cd157f3b44c7055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / dask_ms_2-0.2.37-py3-none-any.whl

Download URL dask_ms_2-0.2.37-py3-none-any.whl
Size 173.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fc5743f696a88cf550fd43237a7620baf13e1b5f3415f8e7c3256e487a956fe
BLAKE2b-256 checksum
How to use checksums
67f6df14362d6c0d98e3da6537a26fbfc25d4975a0d55a554fe94078e60d70c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for dask-ms-2 0.2.37

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dask_ms_2-0.2.37.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page