DOms.h

Classes

ms -- Implementation of the ms DO (full description)

class ms: public ApplicationObject

Types

enum methods

NROW = 0
ISWRITABLE
OPEN
CLOSE
NAME
COMMAND
TOFITS
SUMMARY
RANGE
LISTER
SELECTINIT
SELECT
SELECTTAQL
SELECTCHANNEL
SELECTPOLARIZATION
GETDATA
PUTDATA
ITERINIT
ITERORIGIN
ITERNEXT
ITEREND
CREATEFLAGHISTORY
RESTOREFLAGS
SAVEFLAGS
FLAGLEVEL
FILLBUFFER
DIFFBUFFER
GETBUFFER
CLIPBUFFER
SETBUFFERFLAGS
WRITEBUFFERFLAGS
CLEARBUFFER
CONCATENATE
SPLIT
NUM_METHODS

Interface

Public Members
ms(MeasurementSet& thems)
ms(const String& msfile, const String& fitsfile, Bool readonly, Bool lock, Int obstype)
~ms()
uInt nrow(Bool selected=False) const
Bool iswritable() const
void open(const String& msfile, Bool readonly, Bool lock)
void close()
String name() const
ObjectID command(const String& msfile, const String& command, Bool readonly) const
void tofits(const String& fitsfile, const String& column, Vector<Int>& fieldids, Vector<Int>& spectralwindowids, Int startchan, Int nchan, Int chanstep, Bool writeSysCal, Bool multiSource, Bool combineSpw, Bool writeStation) const
void summary(GlishRecord& header, Bool verbose) const
GlishRecord range(const Vector<String>& items, Bool useflags, Int blockSizeMB=10)
void lister(String starttime, String stoptime) const
Bool selectinit(const Vector<Int>& ddId, Bool reset)
Bool select(const GlishRecord& items)
Bool selecttaql(const String& msselect)
Bool selectchannel(Int nChan, Int start, Int width, Int inc)
Bool selectpolarization(const Vector<String>& wantedPol)
GlishRecord getdata(const Vector<String>& items, Bool ifraxis, Int ifraxisgap, Int increment, Bool average)
Bool putdata(const GlishRecord& items)
Bool iterinit(const Vector<String>& columns, Double interval, Int maxrows, Bool adddefaultsortcolumns)
Bool iterorigin()
Bool iternext()
Bool iterend()
Bool createflaghistory(Int numlevel)
Bool restoreflags(Int level)
Bool saveflags(Bool newlevel)
Int flaglevel()
Bool fillbuffer(const String& item, Bool ifraxis)
GlishRecord diffbuffer(const String& direction, Int window, Bool domedian)
GlishRecord getbuffer()
Bool clipbuffer(Float pixellevel, Float timelevel, Float channellevel)
Bool setbufferflags(const GlishRecord& flags)
Bool writebufferflags()
Bool clearbuffer()
void concatenate(const String& msfile, Quantity& freqTol, Quantity& dirTol)
void split(String& outputMS, Vector<Int>& fieldids, Vector<Int>& spwids, Vector<Int>& nchan, Vector<Int>& start, Vector<Int>& step, String& which)
virtual String className() const
virtual Vector<String> methods() const
virtual Vector<String> noTraceMethods() const
virtual MethodResult runMethod(uInt which, ParameterSet& inputRecord, Bool runMethod)
Private Members
ms()
ms(const ms& other)
ms& operator=(const ms& other)
Bool detached() const

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

This is the Distributed Object for the MeasurementSet

Synopsis

This class is the interface to glish for the various MS related classes

Example

Motivation

It is handy to have all MS related operations together in one interface.

Thrown Exceptions

To Do

Member Description

ms(MeasurementSet& thems)

Create a ms object from a measurement set Table.

ms(const String& msfile, const String& fitsfile, Bool readonly, Bool lock, Int obstype)

Create a ms object from a uvfits file. The FITS file is read and translated into a measurement set table. The resultant table is then used. Set lock=True to permanently lock the measurement set table. Specify obstype to specify the tiling scheme (MSTileLayout::ObsType)

~ms()

The destructor is fairly trivial

uInt nrow(Bool selected=False) const

Returns the number of rows in the measurement set or zero if the ms is not attached to a table. If selected == True, return the number of rows in the currently selected table.

Bool iswritable() const

Returns True if the measurementset has been opened for writing

void open(const String& msfile, Bool readonly, Bool lock)

Close the current ms, and replace it with the supplied ms.

void close()

Flush the ms to disk and detach from the ms file. All function calls after this will return default values.

String name() const

Return the file name of the measurement set.

ObjectID command(const String& msfile, const String& command, Bool readonly) const

Create a new ms from Table Query Language command.

void tofits(const String& fitsfile, const String& column, Vector<Int>& fieldids, Vector<Int>& spectralwindowids, Int startchan, Int nchan, Int chanstep, Bool writeSysCal, Bool multiSource, Bool combineSpw, Bool writeStation) const

Write the measurement set to the specified uv fits file???

void summary(GlishRecord& header, Bool verbose) const

Return a record with fields name and nrow containing the measurement set name, & number of rows. Also sends a more detailed summary of the measurement set to the logger.

GlishRecord range(const Vector<String>& items, Bool useflags, Int blockSizeMB=10)

Returns the ranges of the items specified in the Vector. When useflags is True, flagged data is excluded from the range. (Only the FLAG column is checked and only DATA related items are affected.) Set the blockSizeMB argument to set the memory buffer size in MB during operation - increase for large datasets on large memory machines.

void lister(String starttime, String stoptime) const

List the ms by rows in the logger, given start/stop times

Bool selectinit(const Vector<Int>& ddId, Bool reset)

Initialises the selected Measurement set to contain data with only the specified data description id. The ddId argument must be positive and the first data description id is numbered one. Setting ddId to zero will select all the entire MS if the data shape is constant otherwise it will select the first ddId and return False. Setting reset to True will discard all selections.

Bool select(const GlishRecord& items)

Makes a selection, you can use range to get a record with items, then restrict the range of them and feed it back to select.

Bool selecttaql(const String& msselect)

Makes a selection based on a TaQL string

Bool selectchannel(Int nChan, Int start, Int width, Int inc)

Select a range of channels

Bool selectpolarization(const Vector<String>& wantedPol)

Select a range of polarizations

GlishRecord getdata(const Vector<String>& items, Bool ifraxis, Int ifraxisgap, Int increment, Bool average)

get out the data items specified, add an interferometer axis if ifraxis is True, put a gap in the ifr axis whenever antenna1 changes with ifraxisgap >0, set increment to >1 to skip rows, set average to True to average data in the row or time direction.

Bool putdata(const GlishRecord& items)

put the data back in to the MS, generally the items arguments would be a modified version of the one returned by getdata.

Bool iterinit(const Vector<String>& columns, Double interval, Int maxrows, Bool adddefaultsortcolumns)

Initialise the iterator

Bool iterorigin()

Reset the iterator

Bool iternext()

Move the iteraror to the next chunk

Bool iterend()

Move the iterator to the end

Bool createflaghistory(Int numlevel)

Create the flag history

Bool restoreflags(Int level)

Restore the flag

Bool saveflags(Bool newlevel)

Save the flags

Int flaglevel()

return the flag level

Bool fillbuffer(const String& item, Bool ifraxis)

Fill the buffer

GlishRecord diffbuffer(const String& direction, Int window, Bool domedian)

Difference the buffer

GlishRecord getbuffer()

Get the buffer

Bool clipbuffer(Float pixellevel, Float timelevel, Float channellevel)

Clip the buffer

Bool setbufferflags(const GlishRecord& flags)

Set the buffer flags

Bool writebufferflags()

Write the buffer flags

Bool clearbuffer()

Clear the buffer

void concatenate(const String& msfile, Quantity& freqTol, Quantity& dirTol)

Append the specified measurement set to the current one. This copies all data.

void split(String& outputMS, Vector<Int>& fieldids, Vector<Int>& spwids, Vector<Int>& nchan, Vector<Int>& start, Vector<Int>& step, String& which)

Function to make a new ms which is a subset of current one

virtual String className() const

return the name of this object type the distributed object system. This function is required as part of the DO system

virtual Vector<String> methods() const

the returned vector contains the names of all the methods which may be used via the distributed object system. This function is required as part of the DO system

virtual Vector<String> noTraceMethods() const

the returned vector contains the names of all the methods which are to trivial to warrent automatic logging. This function is required as part of the DO system

virtual MethodResult runMethod(uInt which, ParameterSet& inputRecord, Bool runMethod)

Run the specified method. This is the function used by the distributed object system to invoke any of the specified member functions in thios class. This function is required as part of the DO system

ms()

ms(const ms& other)

ms& operator=(const ms& other)

enum methods

Bool detached() const