create_visibility_from_ms
- create_visibility_from_ms(msname, channum=None, start_chan=None, end_chan=None, ack=False, datacolumn='DATA', selected_sources=None, selected_dds=None, average_channels=False)[source]
Minimal MS to Visibility converter
The MS format is much more general than the RASCIL Visibility so we cut many corners. This requires casacore to be installed. If not an exception ModuleNotFoundError is raised.
Creates a list of Visibility’s, split by field and spectral window
Reading of a subset of channels is possible using either start_chan and end_chan or channnum. Using start_chan and end_chan is preferred since it only reads the channels required. Channum is more flexible and can be used to read a random list of channels.
- Parameters
msname – File name of MS
channum – range of channels e.g. range(17,32), default is None meaning all
start_chan – Starting channel to read
end_chan – End channel to read
ack – Ask casacore to acknowledge each table operation
datacolumn – MS data column to read DATA, CORRECTED_DATA, or MODEL_DATA
selected_sources – Sources to select
selected_dds – Data descriptors to select
average_channels – Average all channels read
- Returns
List of Visibility
For example:
selected_sources = ['1302+5748', '1252+5634'] bvis_list = create_visibility_from_ms('../../data/3C277.1_avg.ms', datacolumn='CORRECTED_DATA', selected_sources=selected_sources) sources = numpy.unique([bv.source for bv in bvis_list]) print(sources) ['1252+5634' '1302+5748']