casa
$Rev:20696$
|
List visibility records from a Measurement Set. More...
#include <MSLister.h>
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. | |
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. | |
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 | |
MeasurementSet * | pMS_p |
Pointer to the MS. | |
MeasurementSet * | pMSSel_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< Int > | chanList_p |
List of channels. | |
Bool | multiChan_p |
True if listing multiple channels. | |
uInt | npols_p |
Pol counters. | |
Vector< String > | pols_p |
SpW/Pol info from subtables. | |
Vector< Double > | freqs_p |
Vector< Int > | spwins_p |
SpWId map from DDIs: | |
Bool | multiSpw_p |
True if listing multiple spws. | |
Vector< Int > | indexPols_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< String > | items_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< String > | dataColSel |
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. |
List visibility records from a Measurement Set.
Public interface
The name comes from being a Lister for a MS.
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.
// 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;
The viewing of the raw data is a basic capability that is commonly required.
MSLister::list
are not funcational presently. Definition at line 120 of file MSLister.h.
Null constructor.
casa::MSLister::MSLister | ( | const MeasurementSet & | ms, |
LogIO & | os | ||
) |
Construct from a MeasurementSet (set pointer), set formatting string, and initialise listing with os.
casa::MSLister::MSLister | ( | MSLister & | other | ) |
Copy constructor, this will initialise the MSLister's MS with other's MS.
Destructor.
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.
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.
Bool casa::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 casa::MSLister::setNewOS | ( | LogIO & | os | ) |
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)
Matrix<Int> casa::MSLister::chanList_p [private] |
List of channels.
Definition at line 253 of file MSLister.h.
const String casa::MSLister::dashline_p [private] |
A formatting string for convenience.
Definition at line 247 of file MSLister.h.
Vector<String> casa::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 casa::MSLister::dataRecords_p [private] |
The conversion of the above to a regular Record object.
Definition at line 311 of file MSLister.h.
String casa::MSLister::date_p [private] |
Definition at line 292 of file MSLister.h.
Bool casa::MSLister::doChn_p [private] |
Definition at line 298 of file MSLister.h.
Bool casa::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 casa::MSLister::doSpW_p [private] |
Definition at line 298 of file MSLister.h.
Vector<Double> casa::MSLister::freqs_p [private] |
Definition at line 262 of file MSLister.h.
Vector<Int> casa::MSLister::indexPols_p [private] |
Polarization indexing variables; for polarization (correlation) selection.
Definition at line 270 of file MSLister.h.
Bool casa::MSLister::is_float [private] |
Definition at line 298 of file MSLister.h.
Vector<String> casa::MSLister::items_p [private] |
for assigning desired columns from the ms
Definition at line 295 of file MSLister.h.
String casa::MSLister::lastdate_p [private] |
Definition at line 292 of file MSLister.h.
LogIO casa::MSLister::logStream_p [private] |
Output stream.
Definition at line 244 of file MSLister.h.
MSSelector casa::MSLister::mss_p [private] |
The MSSelector object used in list() etc.
Definition at line 250 of file MSLister.h.
Bool casa::MSLister::multiChan_p [private] |
True if listing multiple channels.
Definition at line 255 of file MSLister.h.
Bool casa::MSLister::multiSpw_p [private] |
True if listing multiple spws.
Definition at line 267 of file MSLister.h.
Int casa::MSLister::nDecimal_p [private] |
Definition at line 291 of file MSLister.h.
uInt casa::MSLister::nIndexPols_p [private] |
Definition at line 271 of file MSLister.h.
uInt casa::MSLister::npols_p [private] |
Pol counters.
Definition at line 258 of file MSLister.h.
uInt casa::MSLister::oAmpl_p [private] |
Definition at line 281 of file MSLister.h.
uInt casa::MSLister::oPhase_p [private] |
Definition at line 281 of file MSLister.h.
uInt casa::MSLister::oTime_p [private] |
Order of magnitude control (digits to left of decimal, including sign)
Definition at line 280 of file MSLister.h.
uInt casa::MSLister::oUVDist_p [private] |
Definition at line 280 of file MSLister.h.
uInt casa::MSLister::oUVW_p [private] |
Definition at line 280 of file MSLister.h.
uInt casa::MSLister::oWeight_p [private] |
Definition at line 282 of file MSLister.h.
Int casa::MSLister::pageHeight_p [private] |
Definition at line 291 of file MSLister.h.
Int casa::MSLister::pageWidth_p [private] |
Page params.
Definition at line 291 of file MSLister.h.
MeasurementSet* casa::MSLister::pMS_p [private] |
Pointer to the MS.
Definition at line 240 of file MSLister.h.
MeasurementSet* casa::MSLister::pMSSel_p [private] |
Definition at line 241 of file MSLister.h.
Vector<String> casa::MSLister::pols_p [private] |
SpW/Pol info from subtables.
Definition at line 261 of file MSLister.h.
Int casa::MSLister::precAmpl_p [private] |
Definition at line 287 of file MSLister.h.
Int casa::MSLister::precPhase_p [private] |
Definition at line 287 of file MSLister.h.
Int casa::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 casa::MSLister::precUVDist_p [private] |
Definition at line 286 of file MSLister.h.
Int casa::MSLister::precUVW_p [private] |
Definition at line 286 of file MSLister.h.
Int casa::MSLister::precWeight_p [private] |
Definition at line 288 of file MSLister.h.
Record casa::MSLister::ranges_p [private] |
The Record object containing the MSSelector ranges.
Definition at line 308 of file MSLister.h.
Vector<Int> casa::MSLister::spwins_p [private] |
SpWId map from DDIs:
Definition at line 265 of file MSLister.h.
uInt casa::MSLister::wAmpl_p [private] |
Definition at line 276 of file MSLister.h.
uInt casa::MSLister::wAnt1_p [private] |
Definition at line 274 of file MSLister.h.
uInt casa::MSLister::wAnt2_p [private] |
Definition at line 274 of file MSLister.h.
uInt casa::MSLister::wChn_p [private] |
Definition at line 275 of file MSLister.h.
uInt casa::MSLister::wFlag_p [private] |
Definition at line 276 of file MSLister.h.
uInt casa::MSLister::wFld_p [private] |
Definition at line 275 of file MSLister.h.
uInt casa::MSLister::wIntrf_p [private] |
Definition at line 274 of file MSLister.h.
uInt casa::MSLister::wPhase_p [private] |
Definition at line 276 of file MSLister.h.
uInt casa::MSLister::wSpW_p [private] |
Definition at line 275 of file MSLister.h.
uInt casa::MSLister::wTime_p [private] |
Field width variables.
Definition at line 274 of file MSLister.h.
uInt casa::MSLister::wTotal_p [private] |
Definition at line 277 of file MSLister.h.
uInt casa::MSLister::wUVDist_p [private] |
Definition at line 274 of file MSLister.h.
uInt casa::MSLister::wUVW_p [private] |
Definition at line 274 of file MSLister.h.
uInt casa::MSLister::wVis_p [private] |
Definition at line 276 of file MSLister.h.
uInt casa::MSLister::wWeight_p [private] |
Definition at line 276 of file MSLister.h.