The UVDAT Subsystem for Reading UV Data: mirtask.uvdat

Foo.

mirtask.uvdat API Reference

This section presents a detailed API reference for the mirtask.uvdat module.

mirtask.uvdat.read(saveFlags=False, maxchan=4096)

Read in data via the UVDAT subsystem.

Parameters:
  • saveFlags (bool) – whether to rewrite the flags of the dataset(s) as it/they are being read
  • maxchan (int) – the maximum number of spectral channels that can be read in at once
Return type:

generator of (handle, preamble, data, flags)

Returns:

generator yielding UV data records

Read in data with the UVDAT subsystem. The system must have previously been initialized, typically in a call to mirtask.keys.KeySpec.process() after configuration with mirtask.keys.KeySpec.uvdat().

The return value is a generator that yields tuples of (handle, preamble, data, flags), where handle is a UVDatDataSet corresponding to the dataset being read, and preamble, data, and flags are the usual UV data arrays. For speed, the identities of the arrays do not change from iteration to iteration, but their contents do.

mirtask.uvdat.setupAndRead(toread, uvdOptions, saveFlags, nopass=False, nocal=False, nopol=False, select=None, line=None, stokes=None, ref=None, maxchan=4096)

Set up the UVDAT subsystem manually and read in the data.

Parameters:
  • toread (stringable or iterable of stringable) – the name(s) of the dataset or datasets to read
  • uvdOptions (str) – extra options controlling the behavior of the UVDAT subsytem
  • saveFlags (bool) – whether to rewrite the flags of the dataset(s) as it/they are being read
  • nopass (bool) – whether to avoid applying bandpass calibration even if possible
  • nocal (bool) – whether to avoid applying gain calibration even if possible
  • nopol (bool) – whether to avoid applying polarization calibration even if possible
  • select (str or None) – standard UV data selection string
  • line (str or None) – standard channel processing string
  • stokes (str or None) – standard Stokes parameter processing string
  • ref (str or None) – standard reference line specification string
  • maxchan (int) – the maximum number of spectral channels that can be read in at once
Return type:

generator of (handle, preamble, data, flags)

Returns:

generator yielding UV data records

Set up the UVDAT subsytem with explicitly-specified parameters and read in the data.

The argument toread specifies which dataset or datasets to read. If it is a non-string iterable, the stringification of each of its values is treated as a dataset to read. Otherwise, its stringification is treated as the dataset to read. Escaping is not supported by MIRIAD, so if toread = 'a,b', MIRIAD will interpret this as a direction to read two datasets named “a” and “b”.

The return value is a generator that yields tuples of (handle, preamble, data, flags), where handle is a UVDatDataSet corresponding to the dataset being read, and preamble, data, and flags are the usual UV data arrays. For speed, the identities of the arrays do not change from iteration to iteration, but their contents do.

Optional features of the UVDAT subsystem may be enabled by including their control characters in the contents of uvdOptions:

Character Feature behavior
p Planet rotation and scaling corrections should be applied.
w UVW coordinates should be returned in wavelength units, not nanoseconds. (Beware when writing these data to new UV datasets, as the output routines expect the values to be in nanoseconds.)
1 (The character is the number one.) Average the data down to one channel.
x The input data must be cross-correlations.
a The input data must be autocorrelations.
b The input must be exactly one UV dataset (not multiple).
3 The “preamble” returned while reading data will always have 5 elements and include the w coordinate.
mirtask.uvdat.inputSets()

Retrieve handles to the datasets to be read by the UVDAT subsystem.

Return type:generator of UVDatDataSet
Returns:handles to the datasets to by read by the UVDAT system

Generates a sequence of UVDatDataSet objects allowing access to the datasets that would be read by the UVDAT subsystem.

If you plan on reading the UV data associated with these handles, you should instead use read().

See also singleInputSet() in the case that you know there is exactly one input dataset.

mirtask.uvdat.singleInputSet()

Get a UVDatDataSet object representing the input UV dataset.

Return type:UVDatDataSet
Returns:a UV data dataset

Retrieves a UVDatDataSet object corresponding to the dataset to be read by the UVDAT subsystem.

If you want to read the UV data associated with this handle, use read() or setupAndRead().

The subsystem can accept more than one input dataset generically, but you should only call this function if UVDAT has been initialized to read only one dataset. You can ensure this condition by passing the b option to setupAndRead() or mirtask.keys.KeySpec.uvdat(). If you don’t want to or can’t enforce this condition, use inputSets().

class mirtask.uvdat.UVDatDataSet(tno)
Synopsis :a handle to a UV dataset being read with the UVDAT subsystem

This class is a subclass of mirtask.UVDataSet with extra code to invoke the correct lifecycle functions associated with MIRIAD’s UVDAT subsystem. It should transparently behave like a mirtask.UVDataSet from the Python programmer’s perspective.

You should not construct a UVDatDataSet yourself.

mirtask.uvdat.getNPol()

Return the number of simultaneous polarizations being returned by readData. Zero indicates that this number could not be determined.

mirtask.uvdat.getPols()

Return the polarizations being returned by readData, an array of the size returned by getNPol (). Zeros indicate an error. Polarization values are as in FITS and are defined in mirtask.util.POL_??.

mirtask.uvdat.getPol()

Return the last Stokes parameter returned by readData. May vary from one visibility to another.

mirtask.uvdat.getNChan()

Return the number of channels being processed.

mirtask.uvdat.getNFiles()

Return the number of files being processed.

mirtask.uvdat.getVisNum()

Get the serial number of the current UV record.

Returns:the serial number
Return type:int

Counting begins at zero. The return value may vary from what mirtask.UVDataSet.getCurrentVisNum() returns if polarization processing is active, because the underlying data records may be merged.

mirtask.uvdat.getVariance()

Return the variance of the current visibility.

mirtask.uvdat.getJyPerK()

Return the Jansky-per-Kelvin value of the current visibility.

mirtask.uvdat.getCurrentName()

Get the path of the file currently being processed.

Returns:the path of the file currently being processed
Return type:string

Maps to a call of MIRIAD’s UVDATGTA function with an “object” of “name”.

mirtask.uvdat.getLinetype()

Get the linetype of the current record.

Returns:the linetype
Return type:string

The linetype is one of “channel”, “velocity”, “felocity”, “wide”, or “” (if not explicitly specified on the commandline). Maps to a call of MIRIAD’s UVDATGTA function with an “object” of “ltype”.

Table Of Contents

Previous topic

MIRIAD-Style Argument Handling: mirtask.keys

Next topic

Utilities for Command-Line Programs: mirtask.cliutil

This Page