xarray Dataset from CASA Tables
Project description
Constructs xarray Datasets from CASA Tables via python-casacore.
The Variables contained in the Dataset are dask arrays backed by
deferred calls to casacore.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[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
Documentation
Gitter Page
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
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dask_ms-0.2.29.tar.gz.
File metadata
- Download URL: dask_ms-0.2.29.tar.gz
- Upload date:
- Size: 151.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79a16250e0360868424d3f030c4399a52a35d007ba6c4c5ff712ef243efa6697
|
|
| MD5 |
c4c92d81ffa15efc6f1cf42e8fc1c8fb
|
|
| BLAKE2b-256 |
857f7fa60f112545908e95d0268eda5297b41b9432d43a5478cc4e7dae4422c4
|
Provenance
The following attestation bundles were made for dask_ms-0.2.29.tar.gz:
Publisher:
ci.yml on ratt-ru/dask-ms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dask_ms-0.2.29.tar.gz -
Subject digest:
79a16250e0360868424d3f030c4399a52a35d007ba6c4c5ff712ef243efa6697 - Sigstore transparency entry: 834399004
- Sigstore integration time:
-
Permalink:
ratt-ru/dask-ms@c5496a28697741addf1b828c54f4691b4ea6a6ef -
Branch / Tag:
refs/tags/0.2.29 - Owner: https://github.com/ratt-ru
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@c5496a28697741addf1b828c54f4691b4ea6a6ef -
Trigger Event:
push
-
Statement type:
File details
Details for the file dask_ms-0.2.29-py3-none-any.whl.
File metadata
- Download URL: dask_ms-0.2.29-py3-none-any.whl
- Upload date:
- Size: 164.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57625c4fea15f406ed572b0c3dc9c8466f6529fd2598905e647f1c6eea0b13c5
|
|
| MD5 |
0996283c815e29efa9ed594dfc7a9c0f
|
|
| BLAKE2b-256 |
5d48a19e76c6f52d514ff5733c89809746d2d68ba646036fbc59cbdee4ef0cd3
|
Provenance
The following attestation bundles were made for dask_ms-0.2.29-py3-none-any.whl:
Publisher:
ci.yml on ratt-ru/dask-ms
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dask_ms-0.2.29-py3-none-any.whl -
Subject digest:
57625c4fea15f406ed572b0c3dc9c8466f6529fd2598905e647f1c6eea0b13c5 - Sigstore transparency entry: 834399009
- Sigstore integration time:
-
Permalink:
ratt-ru/dask-ms@c5496a28697741addf1b828c54f4691b4ea6a6ef -
Branch / Tag:
refs/tags/0.2.29 - Owner: https://github.com/ratt-ru
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@c5496a28697741addf1b828c54f4691b4ea6a6ef -
Trigger Event:
push
-
Statement type: