casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::MSLister Class Reference

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

#include <MSLister.h>

Public Member Functions

 MSLister ()
 Null constructor. More...
 
 MSLister (const MeasurementSet &ms, LogIO &os)
 Construct from a MeasurementSet (set pointer), set formatting string, and initialise listing with os. More...
 
 MSLister (MSLister &other)
 Copy constructor, this will initialise the MSLister's MS with other's MS. More...
 
MSListeroperator= (MSLister &other)
 Assignment, this will initialise the MSLister's MS with other's MS. More...
 
 ~MSLister ()
 Destructor. More...
 
Bool setNewOS (LogIO &os)
 Change or set the OS this MSLister uses. More...
 
Bool setMS (MeasurementSet &ms)
 Change or set the MS this MSLister refers to, and reinitialise the MSLister object. More...
 
void setPage (const uInt width=120, const uInt height=20)
 Page size for various formats, output devices (default for landscape printing). More...
 
void setFormat (const uInt ndec=2)
 Format for output, ie data display precision. More...
 
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) More...
 
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. More...
 
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. More...
 

Private Member Functions

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

Private Attributes

MeasurementSetpMS_p
 Pointer to the MS. More...
 
MeasurementSetpMSSel_p
 
LogIO logStream_p
 Output stream. More...
 
const String dashline_p
 A formatting string for convenience. More...
 
MSSelector mss_p
 The MSSelector object used in list() etc. More...
 
Matrix< IntchanList_p
 List of channels. More...
 
Bool multiChan_p
 True if listing multiple channels. More...
 
uInt npols_p
 Pol counters. More...
 
Vector< Stringpols_p
 SpW/Pol info from subtables. More...
 
Vector< Doublefreqs_p
 
Vector< Intspwins_p
 SpWId map from DDIs: More...
 
Bool multiSpw_p
 True if listing multiple spws. More...
 
Vector< IntindexPols_p
 Polarization indexing variables; for polarization (correlation) selection. More...
 
uInt nIndexPols_p
 
uInt wTime_p
 Field width variables. More...
 
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) More...
 
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) More...
 
Int precUVDist_p
 
Int precUVW_p
 
Int precAmpl_p
 
Int precPhase_p
 
Int precWeight_p
 
Int pageWidth_p
 Page params. More...
 
Int pageHeight_p
 
Int nDecimal_p
 
String date_p
 
String lastdate_p
 
Vector< Stringitems_p
 for assigning desired columns from the ms More...
 
Bool doFld_p
 Bools for column showing and to identify FLOAT_DATA column of single dish. More...
 
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". More...
 
Record ranges_p
 The Record object containing the MSSelector ranges. More...
 
Record dataRecords_p
 The conversion of the above to a regular Record object. More...
 

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

casacore::MSLister::MSLister ( )

Null constructor.

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

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

casacore::MSLister::MSLister ( MSLister other)

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

casacore::MSLister::~MSLister ( )

Destructor.

Member Function Documentation

void casacore::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 casacore::MSLister::clearFlags ( )
private

Clear the formatting flags.

Int casacore::MSLister::columnWidth ( const Vector< String antNames)
private

Calculate column width for a Vector<String>

void casacore::MSLister::getRanges ( const MeasurementSet ms)
private

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

void casacore::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 casacore::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 casacore::MSLister::listColumnHeader ( ostream &  myout)
private

Column header line for pagination of output.

void casacore::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 casacore::MSLister::listHeader ( )
private

A preamble of abbreviated MSSummary information.

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

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

void casacore::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 casacore::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 casacore::MSLister::setFormat ( const uInt  ndec = 2)

Format for output, ie data display precision.

Bool casacore::MSLister::setMS ( MeasurementSet ms)

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

Do this after setNewOS() if doing both.

Bool casacore::MSLister::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.

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

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

void casacore::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

Matrix<Int> casacore::MSLister::chanList_p
private

List of channels.

Definition at line 253 of file MSLister.h.

const String casacore::MSLister::dashline_p
private

A formatting string for convenience.

Definition at line 247 of file MSLister.h.

Vector<String> casacore::MSLister::dataColSel
private

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.

Record casacore::MSLister::dataRecords_p
private

The conversion of the above to a regular Record object.

Definition at line 311 of file MSLister.h.

String casacore::MSLister::date_p
private

Definition at line 292 of file MSLister.h.

Bool casacore::MSLister::doChn_p
private

Definition at line 298 of file MSLister.h.

Bool casacore::MSLister::doFld_p
private

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

Definition at line 298 of file MSLister.h.

Bool casacore::MSLister::doSpW_p
private

Definition at line 298 of file MSLister.h.

Vector<Double> casacore::MSLister::freqs_p
private

Definition at line 262 of file MSLister.h.

Vector<Int> casacore::MSLister::indexPols_p
private

Polarization indexing variables; for polarization (correlation) selection.

Definition at line 270 of file MSLister.h.

Bool casacore::MSLister::is_float
private

Definition at line 298 of file MSLister.h.

Vector<String> casacore::MSLister::items_p
private

for assigning desired columns from the ms

Definition at line 295 of file MSLister.h.

String casacore::MSLister::lastdate_p
private

Definition at line 292 of file MSLister.h.

LogIO casacore::MSLister::logStream_p
private

Output stream.

Definition at line 244 of file MSLister.h.

MSSelector casacore::MSLister::mss_p
private

The MSSelector object used in list() etc.

Definition at line 250 of file MSLister.h.

Bool casacore::MSLister::multiChan_p
private

True if listing multiple channels.

Definition at line 255 of file MSLister.h.

Bool casacore::MSLister::multiSpw_p
private

True if listing multiple spws.

Definition at line 267 of file MSLister.h.

Int casacore::MSLister::nDecimal_p
private

Definition at line 291 of file MSLister.h.

uInt casacore::MSLister::nIndexPols_p
private

Definition at line 271 of file MSLister.h.

uInt casacore::MSLister::npols_p
private

Pol counters.

Definition at line 258 of file MSLister.h.

uInt casacore::MSLister::oAmpl_p
private

Definition at line 281 of file MSLister.h.

uInt casacore::MSLister::oPhase_p
private

Definition at line 281 of file MSLister.h.

uInt casacore::MSLister::oTime_p
private

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

Definition at line 280 of file MSLister.h.

uInt casacore::MSLister::oUVDist_p
private

Definition at line 280 of file MSLister.h.

uInt casacore::MSLister::oUVW_p
private

Definition at line 280 of file MSLister.h.

uInt casacore::MSLister::oWeight_p
private

Definition at line 282 of file MSLister.h.

Int casacore::MSLister::pageHeight_p
private

Definition at line 291 of file MSLister.h.

Int casacore::MSLister::pageWidth_p
private

Page params.

Definition at line 291 of file MSLister.h.

MeasurementSet* casacore::MSLister::pMS_p
private

Pointer to the MS.

Definition at line 240 of file MSLister.h.

MeasurementSet* casacore::MSLister::pMSSel_p
private

Definition at line 241 of file MSLister.h.

Vector<String> casacore::MSLister::pols_p
private

SpW/Pol info from subtables.

Definition at line 261 of file MSLister.h.

Int casacore::MSLister::precAmpl_p
private

Definition at line 287 of file MSLister.h.

Int casacore::MSLister::precPhase_p
private

Definition at line 287 of file MSLister.h.

Int casacore::MSLister::precTime_p
private

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.

Int casacore::MSLister::precUVDist_p
private

Definition at line 286 of file MSLister.h.

Int casacore::MSLister::precUVW_p
private

Definition at line 286 of file MSLister.h.

Int casacore::MSLister::precWeight_p
private

Definition at line 288 of file MSLister.h.

Record casacore::MSLister::ranges_p
private

The Record object containing the MSSelector ranges.

Definition at line 308 of file MSLister.h.

Vector<Int> casacore::MSLister::spwins_p
private

SpWId map from DDIs:

Definition at line 265 of file MSLister.h.

uInt casacore::MSLister::wAmpl_p
private

Definition at line 276 of file MSLister.h.

uInt casacore::MSLister::wAnt1_p
private

Definition at line 274 of file MSLister.h.

uInt casacore::MSLister::wAnt2_p
private

Definition at line 274 of file MSLister.h.

uInt casacore::MSLister::wChn_p
private

Definition at line 275 of file MSLister.h.

uInt casacore::MSLister::wFlag_p
private

Definition at line 276 of file MSLister.h.

uInt casacore::MSLister::wFld_p
private

Definition at line 275 of file MSLister.h.

uInt casacore::MSLister::wIntrf_p
private

Definition at line 274 of file MSLister.h.

uInt casacore::MSLister::wPhase_p
private

Definition at line 276 of file MSLister.h.

uInt casacore::MSLister::wSpW_p
private

Definition at line 275 of file MSLister.h.

uInt casacore::MSLister::wTime_p
private

Field width variables.

Definition at line 274 of file MSLister.h.

uInt casacore::MSLister::wTotal_p
private

Definition at line 277 of file MSLister.h.

uInt casacore::MSLister::wUVDist_p
private

Definition at line 274 of file MSLister.h.

uInt casacore::MSLister::wUVW_p
private

Definition at line 274 of file MSLister.h.

uInt casacore::MSLister::wVis_p
private

Definition at line 276 of file MSLister.h.

uInt casacore::MSLister::wWeight_p
private

Definition at line 276 of file MSLister.h.


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