MSLister.h
Classes
- MSLister -- List visibility records from a Measurement Set (full description)
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()
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.
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
- The string->double conversion in list()
needs to default to prefix the correct "yyyy/mm/dd/" string if
not provided, or accept it if it is.
- The (pointer to the) MS is declared and used as non-const throughout
MSLister, because MSSelector requires it. MSSelector should be
changed to require a const MS since it claims not to change the MS
anyway. Then the pointer/MS should be made const here too.
- Add more sanity checks.
- Actually do something with the nDecimal_p number.
- There are more formatting options planned.
Member Description
Null constructor
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
Destructor
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.
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.
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.
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.
A preamble of abbreviated MSSummary information.
Get the ranges of a fixed set of MS key attributes.
Most of the heavy lifting is in here. Get the data records and list
them.
Column header line for pagination of output.
Clear the formatting flags