karabo.util.ska_sdp_datamodels.visibility package
Submodules
karabo.util.ska_sdp_datamodels.visibility.msv2 module
Source: https://gitlab.com/ska-telescope/sdp/ska-sdp-datamodels Copyright: SKAO License: Apache License 2.0
MeasurementSets V2 Codes Based on Python-casacore For ska-sdp-datamodels
- class Ms(filename, ref_time=0.0, source_name=None, frame='ITRF', verbose=False, if_delete=False)
Bases:
WriteMsClass for storing visibility data and writing the data, along with array geometry, frequency setup, etc., to a CASA measurement set.
- class WriteMs(filename, ref_time=0.0, source_name=None, frame='ITRF', verbose=False, if_delete=False)
Bases:
BaseDataClass for storing visibility data and writing the data, along with array geometry, frequency setup, etc., to a CASA measurement set.
- add_data_set(obstime, inttime, baselines, visibilities, flags=None, weights=None, pol='XX', source=None, phasecentre=None, uvw=None)
Create a UVData object to store a collection of visibilities.
- close()
Close out the file.
- set_geometry(site_config, antennas, bits=8)
Given a station and an array of stands, set the relevant common observation parameters and add entries to the self.array list.
- Parameters:
site_config – SKA-SDP Configuration
antennas – Antenna array
bits – Preserved
- write()
Fill in the Measurement Sets file with correct order.
karabo.util.ska_sdp_datamodels.visibility.msv2fund module
Source: https://gitlab.com/ska-telescope/sdp/ska-sdp-datamodels Copyright: SKAO License: Apache License 2.0
MeasurementSets V2 Reference Codes Based on Python-casacore
- class Antenna(ant_id, stand=None, pol=0, theta=0.0, phi=0.0, fee=None, feePort=1, cable=None)
Bases:
object- Object to store the information about an antenna. Stores antenna:
ID number (id)
Stand instance the antenna is part of (stand)
Polarization (0 == N-S; pol)
Antenna vertical mis-alignment in degrees (theta)
Antenna rotation mis-alignment in degrees (phi)
Fee instance the antenna is attached to (fee)
Port of the FEE used for the antenna (feePort)
Cable instance used to connect the antenna (cable)
Some arguments are designed for future extension
- class BaseData(filename, ref_time=0.0, source_name=None, frame='ITRF', verbose=False)
Bases:
objectBase Data class: For an observation of interferometer, we should have: Antenna, Frequency, Visibility Funcation, UVW
- add_data_set(obstime, inttime, baselines, visibilities, flags=None, weights=None, pol='XX', source=None)
Create a UVData object to store a collection of visibilities.
- close()
Close out the file.
- static parse_time(ref_time)
Given a time as either a integer, float, string, or datetime object, convert it to a string in the formation ‘YYYY-MM-DDTHH:MM:SS’.
- set_frequency(freq, channel_width)
Given a numpy array of frequencies, set the relevant common observation parameters and add an entry to the self.freq list.
- set_stokes(polList)
Given a list of Stokes parameters, update the object’s parameters.
- write()
Fill in the file will all of the required supporting metadata.
- class Observatory(name, lon, lat, alt)
Bases:
objectObservatory class. Contains the location of the observatory.
- class Stand(stand_id, x, y, z)
Bases:
objectObject to store the information (location and ID) about a stand. Stores stand:
ID number (id)
Position relative to the center stake in meters (x,y,z)
- The x, y, and z positions can also be accessed through subscripts:
Stand[0] = x Stand[1] = y Stand[2] = z
karabo.util.ska_sdp_datamodels.visibility.msv2supp module
Source: https://gitlab.com/ska-telescope/sdp/ska-sdp-datamodels Copyright: SKAO License: Apache License 2.0
MeasurementSets V2 Reference Codes Based on Python-casacore
karabo.util.ska_sdp_datamodels.visibility.vis_io_ms module
Source: https://gitlab.com/ska-telescope/sdp/ska-sdp-datamodels Copyright: SKAO License: Apache License 2.0
Base functions to create and export Visibility from/into Measurement Set files. They take definitions of columns from msv2.py and interact with Casacore.
- export_visibility_to_ms(msname, vis_list, source_name=None)
Minimal Visibility to MS converter
The MS format is much more general than the SDP Visibility so we cut many corners. This requires casacore to be installed. If not an exception ModuleNotFoundError is raised.
Write a list of Visibility’s to a MS file, split by field and spectral window
- Parameters:
msname – File name of MS
vis_list – list of Visibility
source_name – Source name to use
ack – Ask casacore to acknowledge each table operation
- Returns:
- import_visibility_from_ms(msname, ack=False, datacolumn='DATA')
Read Measurement Set fields and spectral windows as SDP visibilities.
The pinned ska-sdp-datamodels release does not yet provide its later MS reader. This reader covers the single-field/spectral-window inputs supported by the SDP imager while returning a list so unsupported multi-block inputs can be rejected explicitly by the caller.
Module contents
Measurement Set I/O vendored from ska_sdp_datamodels v0.3.1.
Karabo currently pins ska-sdp-datamodels v0.1.3, whose visibility package
does not yet provide the Measurement Set export API used here. Remove this
vendored package and import ska_sdp_datamodels.visibility directly once a
newer data-model release has been validated as a separate dependency upgrade.