Xarray Datasets from House Tables.
dask-ms的Python项目详细描述
通过python-casacore从casa表构造xarrayDatasets。
Dataset中包含的Variables是dask数组,由
对pyrap.tables.table.getcol
的延迟调用。
支持将Variables写入表中的相应列。
这个包的目的是支持测量集 用于编写并行、分布式数据的数据源和接收器 射电天文学算法。
安装
使用xarray支持安装:
$ pip install dask-ms[xarray]
没有类似的xarray,但是复制了减少的数据集功能 在达斯克MS本身。专家用户可能希望使用此选项来减少 python包依赖项。
$ pip install dask-ms
示例用法
importdask.arrayasdafromdaskmsimportxds_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 inverseds[0]['flag']=(ds[0].flag.dims,da.logical_not(ds[0].flag))# Write the flag column back to the Measurement Setxds_to_table(ds,"WSRT.MS","FLAG").compute()printds[<xarray.Dataset>Dimensions:(chan:64,corr:4,row:6552,uvw:3)Coordinates:ROWID(row)int32dask.array<shape=(6552,),chunksize=(6552,)>Dimensionswithoutcoordinates:chan,corr,row,uvwDatavariables:IMAGING_WEIGHT(row,chan)float32dask.array<shape=(6552,64),chunksize=(6552,64)>ANTENNA1(row)int32dask.array<shape=(6552,),chunksize=(6552,)>STATE_ID(row)int32dask.array<shape=(6552,),chunksize=(6552,)>EXPOSURE(row)float64dask.array<shape=(6552,),chunksize=(6552,)>MODEL_DATA(row,chan,corr)complex64dask.array<shape=(6552,64,4),chunksize=(6552,64,4)>FLAG_ROW(row)booldask.array<shape=(6552,),chunksize=(6552,)>CORRECTED_DATA(row,chan,corr)complex64dask.array<shape=(6552,64,4),chunksize=(6552,64,4)>PROCESSOR_ID(row)int32dask.array<shape=(6552,),chunksize=(6552,)>WEIGHT(row,corr)float32dask.array<shape=(6552,4),chunksize=(6552,4)>FLAG(row,chan,corr)booldask.array<shape=(6552,64,4),chunksize=(6552,64,4)>TIME(row)float64dask.array<shape=(6552,),chunksize=(6552,)>SIGMA(row,corr)float32dask.array<shape=(6552,4),chunksize=(6552,4)>SCAN_NUMBER(row)int32dask.array<shape=(6552,),chunksize=(6552,)>INTERVAL(row)float64dask.array<shape=(6552,),chunksize=(6552,)>OBSERVATION_ID(row)int32dask.array<shape=(6552,),chunksize=(6552,)>TIME_CENTROID(row)float64dask.array<shape=(6552,),chunksize=(6552,)>ARRAY_ID(row)int32dask.array<shape=(6552,),chunksize=(6552,)>ANTENNA2(row)int32dask.array<shape=(6552,),chunksize=(6552,)>DATA(row,chan,corr)complex64dask.array<shape=(6552,64,4),chunksize=(6552,64,4)>FEED1(row)int32dask.array<shape=(6552,),chunksize=(6552,)>FEED2(row)int32dask.array<shape=(6552,),chunksize=(6552,)>UVW(row,uvw)float64dask.array<shape=(6552,3),chunksize=(6552,3)>Attributes:FIELD_ID:0DATA_DESC_ID:0]