casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::MSLister Class Reference

List visibility records from a Measurement Set. More...

#include <MSLister.h>

List of all members.

Public Member Functions

 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.
MSListeroperator= (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.
Bool setMS (MeasurementSet &ms)
 Change or set the MS this MSLister refers to, and reinitialise the MSLister object.
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 &options="", const String &datacolumn="", const String &field="", const String &spw="", const String &antenna="", const String &timerange="", const String &correlation="", const String &scan="", const String &feed="", const String &array="", const String &observation="", const String &uvrange="", const String &average="", const bool showflags=False, const String &msSelect="", const long pagerows=50, const String &listfile="")
 List the visibilities, with optional data selection and output specification.
void selectvis (const String &timerange="", const String &spw="", const String &scan="", const String &field="", const String &baseline="", const String &uvrange="", const String &chanmode="none", const Int &nchan=1, const Int &start=0, const Int &step=1, const MRadialVelocity &mStart=MRadialVelocity(), const MRadialVelocity &mStep=MRadialVelocity(), const String &correlation="", const String &array="", const String &observation="", const String &msSelect="")
 Set uv-data selection via MSSelection.

Private Member Functions

void initList ()
 Initialise the listing.
void listHeader ()
 A preamble of abbreviated MSSummary information.
void getRanges (const MeasurementSet &ms)
 Get the ranges of a fixed set of MS key attributes.
void listData (const int pageRows=50, const String listfile="")
 Most of the heavy lifting is in here.
void listColumnHeader (ostream &myout)
 Column header line for pagination of output.
void _polarizationSetup (const uInt selPolID)
 Setup class polarization information for specified MS.
void polarizationParse (String correlation)
 Parse the correlation parameter value; fill indexPols_p to output selected polarizations.
Int columnWidth (const Vector< String > antNames)
 Calculate column width for a Vector<String>
void clearFlags ()
 Clear the formatting flags.

Private Attributes

MeasurementSetpMS_p
 Pointer to the MS.
MeasurementSetpMSSel_p
LogIO logStream_p
 Output stream.
const String dashline_p
 A formatting string for convenience.
MSSelector mss_p
 The MSSelector object used in list() etc.
Matrix< IntchanList_p
 List of channels.
Bool multiChan_p
 True if listing multiple channels.
uInt npols_p
 Pol counters.
Vector< Stringpols_p
 SpW/Pol info from subtables.
Vector< Doublefreqs_p
Vector< Intspwins_p
 SpWId map from DDIs:
Bool multiSpw_p
 True if listing multiple spws.
Vector< IntindexPols_p
 Polarization indexing variables; for polarization (correlation) selection.
uInt nIndexPols_p
uInt wTime_p
 Field width variables.
uInt wAnt1_p
uInt wAnt2_p
uInt wIntrf_p
uInt wUVDist_p
uInt wUVW_p
uInt wFld_p
uInt wSpW_p
uInt wChn_p
uInt wAmpl_p
uInt wPhase_p
uInt wWeight_p
uInt wVis_p
uInt wFlag_p
uInt wTotal_p
uInt oTime_p
 Order of magnitude control (digits to left of decimal, including sign)
uInt oUVDist_p
uInt oUVW_p
uInt oAmpl_p
uInt oPhase_p
uInt oWeight_p
Int precTime_p
 Precision control (digits to right of decimal point) (precTime_p includes hhmmss, so 7 yields hh:mm:ss.s)
Int precUVDist_p
Int precUVW_p
Int precAmpl_p
Int precPhase_p
Int precWeight_p
Int pageWidth_p
 Page params.
Int pageHeight_p
Int nDecimal_p
String date_p
String lastdate_p
Vector< Stringitems_p
 for assigning desired columns from the ms
Bool doFld_p
 Bools for column showing and to identify FLOAT_DATA column of single dish.
Bool doSpW_p
Bool doChn_p
Bool is_float
Vector< StringdataColSel
 Data selections data --> "amplitude", "phase" corrected --> "corrected_amplitude", "corrected_phase" model --> "model_amplitude", "model_phase" residual --> "residual_amplitude", "residual_phase".
Record ranges_p
 The Record object containing the MSSelector ranges.
Record dataRecords_p
 The conversion of the above to a regular Record object.

Detailed Description

List visibility records from a Measurement Set.

Intended use:

Public interface

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 all the data, with default output options
        myList.list();
       // List only selected data, with specified output options
       datacolumn = 'corrected'; spw = '3:5~10'; timerange = '<13:34:25.1';
       scan = '5'; pagerows = 10; listfile = 'myList.list.out';
       // ... define any other parameters, then call function ..\.
       myList.list(options, datacolumn, field, spw, antenna, timerange,
                   correlation, scan, feed, array, uvrange, average, 
                   showflags, msselect, pagerows, listfile);

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

Definition at line 120 of file MSLister.h.


Constructor & Destructor Documentation

Null constructor.

casa::MSLister::MSLister ( const MeasurementSet ms,
LogIO os 
)

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

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

Destructor.


Member Function Documentation

void casa::MSLister::_polarizationSetup ( const uInt  selPolID) [private]

Setup class polarization information for specified MS.

pols_p holds the polarization names contained in the MS in the same order that the polarization data are listed in the main table.

void casa::MSLister::clearFlags ( ) [private]

Clear the formatting flags.

Int casa::MSLister::columnWidth ( const Vector< String antNames) [private]

Calculate column width for a Vector<String>

void casa::MSLister::getRanges ( const MeasurementSet ms) [private]

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

void casa::MSLister::initList ( ) [private]

Initialise the listing.

initList() does things that need to be done once per MS: declares and initialises the private MSSelector object, and gets all the attribute ranges up front.

void casa::MSLister::list ( const String options = "",
const String datacolumn = "",
const String field = "",
const String spw = "",
const String antenna = "",
const String timerange = "",
const String correlation = "",
const String scan = "",
const String feed = "",
const String array = "",
const String observation = "",
const String uvrange = "",
const String average = "",
const bool  showflags = False,
const String msSelect = "",
const long  pagerows = 50,
const String listfile = "" 
)

List the visibilities, with optional data selection and output specification.

void casa::MSLister::listColumnHeader ( ostream &  myout) [private]

Column header line for pagination of output.

void casa::MSLister::listData ( const int  pageRows = 50,
const String  listfile = "" 
) [private]

Most of the heavy lifting is in here.

Get the data records and list them.

void casa::MSLister::listHeader ( ) [private]

A preamble of abbreviated MSSummary information.

MSLister& casa::MSLister::operator= ( MSLister other)

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

void casa::MSLister::polarizationParse ( String  correlation) [private]

Parse the correlation parameter value; fill indexPols_p to output selected polarizations.

If correlation is empty, all polarizations are selected.

void casa::MSLister::selectvis ( const String timerange = "",
const String spw = "",
const String scan = "",
const String field = "",
const String baseline = "",
const String uvrange = "",
const String chanmode = "none",
const Int nchan = 1,
const Int start = 0,
const Int step = 1,
const MRadialVelocity mStart = MRadialVelocity(),
const MRadialVelocity mStep = MRadialVelocity(),
const String correlation = "",
const String array = "",
const String observation = "",
const String msSelect = "" 
)

Set uv-data selection via MSSelection.

void casa::MSLister::setFormat ( const uInt  ndec = 2)

Format for output, ie data display precision.

Change or set the MS this MSLister refers to, and reinitialise the MSLister object.

Do this after setNewOS() if doing both.

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.

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

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

void casa::MSLister::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)


Member Data Documentation

List of channels.

Definition at line 253 of file MSLister.h.

A formatting string for convenience.

Definition at line 247 of file MSLister.h.

Data selections data --> "amplitude", "phase" corrected --> "corrected_amplitude", "corrected_phase" model --> "model_amplitude", "model_phase" residual --> "residual_amplitude", "residual_phase".

Definition at line 305 of file MSLister.h.

The conversion of the above to a regular Record object.

Definition at line 311 of file MSLister.h.

Definition at line 292 of file MSLister.h.

Definition at line 298 of file MSLister.h.

Bools for column showing and to identify FLOAT_DATA column of single dish.

Definition at line 298 of file MSLister.h.

Definition at line 298 of file MSLister.h.

Definition at line 262 of file MSLister.h.

Polarization indexing variables; for polarization (correlation) selection.

Definition at line 270 of file MSLister.h.

Definition at line 298 of file MSLister.h.

for assigning desired columns from the ms

Definition at line 295 of file MSLister.h.

Definition at line 292 of file MSLister.h.

Output stream.

Definition at line 244 of file MSLister.h.

The MSSelector object used in list() etc.

Definition at line 250 of file MSLister.h.

True if listing multiple channels.

Definition at line 255 of file MSLister.h.

True if listing multiple spws.

Definition at line 267 of file MSLister.h.

Definition at line 291 of file MSLister.h.

Definition at line 271 of file MSLister.h.

Pol counters.

Definition at line 258 of file MSLister.h.

Definition at line 281 of file MSLister.h.

Definition at line 281 of file MSLister.h.

Order of magnitude control (digits to left of decimal, including sign)

Definition at line 280 of file MSLister.h.

Definition at line 280 of file MSLister.h.

Definition at line 280 of file MSLister.h.

Definition at line 282 of file MSLister.h.

Definition at line 291 of file MSLister.h.

Page params.

Definition at line 291 of file MSLister.h.

Pointer to the MS.

Definition at line 240 of file MSLister.h.

Definition at line 241 of file MSLister.h.

SpW/Pol info from subtables.

Definition at line 261 of file MSLister.h.

Definition at line 287 of file MSLister.h.

Definition at line 287 of file MSLister.h.

Precision control (digits to right of decimal point) (precTime_p includes hhmmss, so 7 yields hh:mm:ss.s)

Definition at line 286 of file MSLister.h.

Definition at line 286 of file MSLister.h.

Definition at line 286 of file MSLister.h.

Definition at line 288 of file MSLister.h.

The Record object containing the MSSelector ranges.

Definition at line 308 of file MSLister.h.

SpWId map from DDIs:

Definition at line 265 of file MSLister.h.

Definition at line 276 of file MSLister.h.

Definition at line 274 of file MSLister.h.

Definition at line 274 of file MSLister.h.

Definition at line 275 of file MSLister.h.

Definition at line 276 of file MSLister.h.

Definition at line 275 of file MSLister.h.

Definition at line 274 of file MSLister.h.

Definition at line 276 of file MSLister.h.

Definition at line 275 of file MSLister.h.

Field width variables.

Definition at line 274 of file MSLister.h.

Definition at line 277 of file MSLister.h.

Definition at line 274 of file MSLister.h.

Definition at line 274 of file MSLister.h.

Definition at line 276 of file MSLister.h.

Definition at line 276 of file MSLister.h.


The documentation for this class was generated from the following file: