MSLister.h

Classes

MSLister -- List visibility records from a Measurement Set (full description)

class MSLister

Interface

Public Members
MSLister()
MSLister (const MeasurementSet& ms, LogIO& os)
MSLister (MSLister& other)
MSLister& operator=(MSLister& other)
~MSLister()
Bool setNewOS (LogIO& os)
Bool setMS (MeasurementSet& ms)
void setPage (const uInt width=120, const uInt height=20)
void setFormat (const uInt ndec=2)
void setPrecision ( const Int precTime=1, const Int precUVDist=0, const Int precAmpl=3, const int precPhase=1, const Int precWeight=0 )
void list (const String timeStart, const String timeStop)
void list (Double& timeStart, Double& timeStop)
void list()
Bool selectTime (Double& timeStart, Double& timeStop)
Private Members
void initList()
void listHeader()
void getRanges()
void listData()
void listColumnHeader()
void clearFlags()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

The name comes from being a Lister for a MS.

Synopsis

MSs containing (u,v) data consist of amplitudes and phases for each baseline and sample time, typically sorted in TB order. These visibilities sometimes need to be examined one record at a time in a text-based format, giving the user access to their raw data. This class provides that access in a choice of several formats.

Example

	// Define an MS
	MeasurementSet myMS(fileName);
	// Define an output stream
	LogIO myLog;
	// Construct the Lister object
	MSLister myList(myMS,myLog);
	// List all data
	myList.list();

	// Send the next output to a new location
	LogIO newLog;
	setNewOS(newLog);
	// List only part of the data (the list() method accepts either
	// Double or String time inputs)
	Double timeStart=4e9, timeStop=4.0001e9;
	// ...or...
	String timeStart=yyyy/mm/dd[/hh[:mm[:ss]]];
      String timeStop=yyyy/mm/dd[/hh[:mm[:ss]]];
	myList.list(timeStart,timeStop);
An MSLister object is constructed from a MS object, and then logged to the supplied LogIO object. A new LogIO object is defined for a more restricted listing.

Caution Note that if the MS goes out of scope, this class will retrieve rubbish (probably giving runtime errors) as it just maintains a pointer to the image.

Motivation

The viewing of the raw data is a basic capability that is commonly required.

To Do

Member Description

MSLister()

Null constructor

MSLister (const MeasurementSet& ms, LogIO& os)

Construct from a MeasurementSet (set pointer), set formatting string, and initialise listing with os.

MSLister (MSLister& other)

Copy constructor, this will initialise the MSLister's MS with other's MS

MSLister& operator=(MSLister& other)

Assignment, this will initialise the MSLister's MS with other's MS

~MSLister()

Destructor

Bool setNewOS (LogIO& os)

Change or set the OS this MSLister uses. Do this before setMS() if doing both. This method avoids having to reconstruct the MSLister object if you change your mind about the output destination.

Bool setMS (MeasurementSet& ms)

Change or set the MS this MSLister refers to, and reinitialise the MSLister object. Do this after setNewOS() if doing both.

void setPage (const uInt width=120, const uInt height=20)

Page size for various formats, output devices (default for landscape printing).

void setFormat (const uInt ndec=2)

Format for output, ie data display precision.

void setPrecision ( const Int precTime=1, const Int precUVDist=0, const Int precAmpl=3, const int precPhase=1, const Int precWeight=0 )

User choices for list precision (sensible defaults): (time precision for user interface is fraction of sec)

void list (const String timeStart, const String timeStop)

Overall listing (3 versions). Do the actual work: list MS records to the logger. Also provided are versions of list() that accept time limits in either String or Double format.

First version to list only data for times in given range, converting input Strings to Double times.

void list (Double& timeStart, Double& timeStop)

Second version to list only data for times in given range.

void list()

Third version to list data for all (possibly previously selected) times.

Bool selectTime (Double& timeStart, Double& timeStop)

Select only within the given time range, with sanity checks.

void initList()

Initialise the listing. initList() does things that need to be done once per MS: initialises the pagination/formatting, lists some header information, declares and initialises the private MSSelector object, and gets all the attribute ranges up front.

void listHeader()

A preamble of abbreviated MSSummary information.

void getRanges()

Get the ranges of a fixed set of MS key attributes.

void listData()

Most of the heavy lifting is in here. Get the data records and list them.

void listColumnHeader()

Column header line for pagination of output.

void clearFlags()

Clear the formatting flags