a Miriad visibility dataset reader More...
#include <MirVisReader.h>
Public Types | |
enum | wideConventions { NONE, BIMA, MIRIAD, MIXED, NCONV } |
Public Member Functions | |
MirVisReader (const String &mirfile, Bool doscan=True, Int dbg=0, Bool dopreview=True) | |
construct a reader. | |
~MirVisReader () | |
destroy the reader | |
void | setDebugLevel (Int level) |
set the debugging level which controls the amount of debugging messages that are printed to the terminal (as opposed to the logger). | |
Int | getDebugLevel () const |
set the debugging level which controls the amount of debugging messages that are printed to the terminal. | |
Bool | Debug (Int level) |
return true if the debugging level is at least as high as a given level. | |
const String & | getName () |
return the Miriad dataset name | |
void | reset (MirVarHandler *filler=NULL, Bool verbose=False, Bool dowide=True, Int maxrec=0) |
rewind the input dataset and prepare for a new reading. | |
Int | readIntegration (::FillMetadata &fm) |
read in the data for a single timestamp. | |
Double | getTime () |
return the (AIPS++-referenced) timestamp for the current buffered records. | |
Int | getNumRecs () |
return the number of records buffered for the current integration | |
MirDataRecord * | getRecord (Int i) |
return the correlation data for the i-th buffered record. | |
void | clearMarks () |
set the marked data item for each MirDataRecord to False | |
MirHisReader * | openHistory () |
create and return a new pointer to a history reader. | |
ConstMirPolSetup & | getDefaultPolSetup () |
return the basic characteristics of the input dataset as a Record. | |
const List< MirSource * > & | getSourceList () |
return the list of sources | |
Protected Member Functions | |
void | preview (Int scanlim, Int obslim, Bool scan=True) |
peek into the contents of the dataset to cache important information. | |
void | preview (Bool scan=True) |
peek into the contents of the dataset to cache important information. | |
Bool | previewed () |
return True if this dataset has been previewed | |
Private Member Functions | |
Bool | verbose () |
return the basic characteristics of the input dataset as a Record. | |
void | checkIsMiriadDataset (const String &name) throw (AipsError) |
check to be sure that the given name points to a readable miriad dataset. | |
void | resizeBufferFor (Int nrec=0, Int nnarrow=0, Int nwide=0) |
resize the data buffer for a new read. | |
void | fullscan (Int scanlim, Int obslim) |
full and brief scanning of the data--should only be called from preview() | |
void | briefscan () |
void | handleVarChanges (::FillMetadata &fm, Double time) |
update the given FillMetadata container with updated variable values. | |
void | setTelescope (String name) |
add to a cached list of telescopes | |
Private Attributes | |
String | inname_p |
info that doesn't change during life of filler | |
Int | uv_handle_p |
uInt | debug |
LogIO | log_p |
List< MirFreqSetup * > | fsetups_p |
variable information worth caching | |
List< MirSource * > | sources_p |
List< String > | telescopes_p |
MirPolSetup | pol_p |
Int | maxchan_p |
Int | maxwide_p |
Int | maxspect_p |
Int | narray_p |
Int | nrec_p |
Int | nobs_p |
Int | nscan_p |
Int | badnsyst_p |
Int | badwsyst_p |
Int | firstmode_p |
Double | starttime_p |
Double | endtime_p |
wideConventions | wideconv_p |
Block< MirDataRecord * > | buf_p |
read state | |
Int | nintrec_p |
Int | maxrec_p |
Int | nnarr_p |
Int | nwide_p |
Double | time_p |
MirVarHandler * | varhandler_p |
Bool | varupd_p |
Bool | hasmore_p |
Bool | dowide_p |
Bool | verbose_p |
Bool | previewed_p |
Bool | scanned_p |
a Miriad visibility dataset reader
Public interface
Class name is short for Miriad visibility reader.
MSes filled from Miriad data feature multiple windows of differing shapes. Performance during MS reads can be aided by collecting together MS table records of the same shape (e.g. of the same window). MirFiller accomplishes this by reading all baselines from a single timestamp at once, so that they written out in order of spectral window. This class provides a container for holding the data from different baselines. It also encapsulates all the knowledge needed for reading Miriad data.
This class is used to extract data from a Miriad visibility dataset.
Definition at line 247 of file MirVisReader.h.
Definition at line 249 of file MirVisReader.h.
MirVisReader::MirVisReader | ( | const String & | mirfile, | |
Bool | doscan = True , |
|||
Int | dbg = 0 , |
|||
Bool | dopreview = True | |||
) |
construct a reader.
mirfile is the name of Miriad dataset. If dopreview is False, the previewing of the dataset's contents will be delayed. If doscan is True (and dopreview is True), the entire input dataset will be read to take an accounting of its contents; set this to False to prevent this for a very large file (see also preview()). dbg is the default debug level to set; this value is passed to setDebugLevel().
MirVisReader::~MirVisReader | ( | ) |
destroy the reader
void MirVisReader::briefscan | ( | ) | [private] |
void MirVisReader::checkIsMiriadDataset | ( | const String & | name | ) | throw (AipsError) [private] |
check to be sure that the given name points to a readable miriad dataset.
If not, throw an exception.
void MirVisReader::clearMarks | ( | ) | [inline] |
set the marked data item for each MirDataRecord to False
Definition at line 334 of file MirVisReader.h.
References buf_p, casacore::False, and nintrec_p.
Bool MirVisReader::Debug | ( | Int | level | ) | [inline] |
return true if the debugging level is at least as high as a given level.
Definition at line 305 of file MirVisReader.h.
References debug.
void MirVisReader::fullscan | ( | Int | scanlim, | |
Int | obslim | |||
) | [private] |
full and brief scanning of the data--should only be called from preview()
Int MirVisReader::getDebugLevel | ( | ) | const [inline] |
set the debugging level which controls the amount of debugging messages that are printed to the terminal.
A value of zero or less means that no extra messages will be printed; increasing values will increase the amount of messages.
Definition at line 301 of file MirVisReader.h.
References debug.
ConstMirPolSetup& MirVisReader::getDefaultPolSetup | ( | ) | [inline] |
return the basic characteristics of the input dataset as a Record.
If scan is True, the entire file will be scanned (if necessary) to all the information; otherwise, an incomplete description may be given based on just the first record. If verbose is True, a summary is sent to the logger. Note that this function may force a call to preview() if it has not already been called. PJT GlishRecord summary(Bool verbose=True, Bool scan=True);
return the basic characteristics of the input dataset as a Record. A scanning of the entire file will be forced so that the number of scans and observations can be counted with the given limits: scanlim is the maximum time gap in seconds allowed between records of the same scan; obslim is maximum gap in seconds between records of the same observation. If verbose is True, a summary is sent to the logger. PJT GlishRecord summary(Int scanlim, Int obslim, Bool verbose=True);
get the full list of polarization correlation types seen thus far
Definition at line 360 of file MirVisReader.h.
References pol_p.
const String& MirVisReader::getName | ( | ) | [inline] |
Int MirVisReader::getNumRecs | ( | ) | [inline] |
return the number of records buffered for the current integration
Definition at line 328 of file MirVisReader.h.
References nintrec_p.
MirDataRecord* MirVisReader::getRecord | ( | Int | i | ) | [inline] |
return the correlation data for the i-th buffered record.
Definition at line 331 of file MirVisReader.h.
References buf_p.
const List<MirSource*>& MirVisReader::getSourceList | ( | ) | [inline] |
Double MirVisReader::getTime | ( | ) | [inline] |
return the (AIPS++-referenced) timestamp for the current buffered records.
This is only correct after a call to readIntegration().
Definition at line 325 of file MirVisReader.h.
References time_p.
void MirVisReader::handleVarChanges | ( | ::FillMetadata & | fm, | |
Double | time | |||
) | [private] |
update the given FillMetadata container with updated variable values.
If a VarHandler was provide via reset(), signal the changes to it. fm is the FillMetadata container to update, and time is the current timestamp.
MirHisReader* MirVisReader::openHistory | ( | ) | [inline] |
create and return a new pointer to a history reader.
The caller should delete the reader when finished with it.
Definition at line 340 of file MirVisReader.h.
References uv_handle_p.
void MirVisReader::preview | ( | Bool | scan = True |
) | [inline, protected] |
peek into the contents of the dataset to cache important information.
If scan is True (the default), the dataset will be read through to gather the information; otherwise, limited information will be gleaned from the first record. One can set scan=False for very large datasets to avoid this overhead. Five minutes and four hours are used for the scan and observation gap limit (when scan=True).
Definition at line 384 of file MirVisReader.h.
References preview().
Referenced by preview().
void MirVisReader::preview | ( | Int | scanlim, | |
Int | obslim, | |||
Bool | scan = True | |||
) | [protected] |
peek into the contents of the dataset to cache important information.
scanlim and obslim are used for counting the number of observations and scans in the dataset. scanlim is the maximum time gap in seconds allowed between records of the same scan; obslim is maximum gap in seconds between records of the same observation. If scan is True (the default), the dataset will be read through to gather the information; otherwise, limited information will be gleaned from the first record and scanlim and obslim will be ignored. One can set scan=False for very large datasets to avoid this overhead.
Bool MirVisReader::previewed | ( | ) | [inline, protected] |
return True if this dataset has been previewed
Definition at line 387 of file MirVisReader.h.
References previewed_p.
Int MirVisReader::readIntegration | ( | ::FillMetadata & | fm | ) |
read in the data for a single timestamp.
fm is the container to use to store retrieved metadata.
void MirVisReader::reset | ( | MirVarHandler * | filler = NULL , |
|
Bool | verbose = False , |
|||
Bool | dowide = True , |
|||
Int | maxrec = 0 | |||
) |
rewind the input dataset and prepare for a new reading.
filler is the object that will handle updates to variables; if NULL, no handler will be alerted when variables change. If dowide is True, the wideband data will be read in, too. maxrec is the maximum number of records to read per timestamp; if maxrec<=0, it will adjust dynamically to the number of baselines being processed.
void MirVisReader::resizeBufferFor | ( | Int | nrec = 0 , |
|
Int | nnarrow = 0 , |
|||
Int | nwide = 0 | |||
) | [private] |
resize the data buffer for a new read.
Values less than or equal to zero mean keep previous value.
void MirVisReader::setDebugLevel | ( | Int | level | ) | [inline] |
set the debugging level which controls the amount of debugging messages that are printed to the terminal (as opposed to the logger).
A value of zero or less will cause no extra messages to be printed; increasing values will increase the amount of messages.
Definition at line 295 of file MirVisReader.h.
References debug.
Referenced by MirFiller::setDebugLevel().
void MirVisReader::setTelescope | ( | String | name | ) | [inline, private] |
add to a cached list of telescopes
Definition at line 435 of file MirVisReader.h.
References telescopes_p.
Bool MirVisReader::verbose | ( | ) | [inline, private] |
return the basic characteristics of the input dataset as a Record.
If verbose is True, a summary is sent to the logger. scan specifies the conditions under which the entire dataset may get read as a result of this request: if scan < 0, the dataset will not be read; if scan=0, it will only be read if it hasn't already (using scanlim and obslim if necessary; if scan > 0, the dataset will be read and scanlim and obslim will be used to count scans and observations. scanlim is the maximum time gap in seconds allowed between records of the same scan; obslim is maximum gap in seconds between records of the same observation. GlishRecord summary(Bool verbose, Int scan, Int scanlim, Int obslim);
return the contents of a MirPolSetup list as a GlishArray static GlishArray toGlishArray(ConstMirPolSetup &pol);
return the contents of a String List as a GlishArray static GlishArray toGlishArray(const List<String>& list); return true if this reader should be verbose in its messages. This will be true if the verbose option is enabled or the debug level is greater than 1.
Definition at line 414 of file MirVisReader.h.
Int MirVisReader::badnsyst_p [private] |
Definition at line 265 of file MirVisReader.h.
Int MirVisReader::badwsyst_p [private] |
Definition at line 265 of file MirVisReader.h.
Block<MirDataRecord *> MirVisReader::buf_p [private] |
read state
Definition at line 271 of file MirVisReader.h.
Referenced by clearMarks(), and getRecord().
uInt MirVisReader::debug [private] |
Definition at line 255 of file MirVisReader.h.
Referenced by Debug(), getDebugLevel(), setDebugLevel(), and verbose().
Bool MirVisReader::dowide_p [private] |
Definition at line 275 of file MirVisReader.h.
Double MirVisReader::endtime_p [private] |
Definition at line 267 of file MirVisReader.h.
Int MirVisReader::firstmode_p [private] |
Definition at line 266 of file MirVisReader.h.
List<MirFreqSetup*> MirVisReader::fsetups_p [private] |
variable information worth caching
Definition at line 259 of file MirVisReader.h.
Bool MirVisReader::hasmore_p [private] |
Definition at line 275 of file MirVisReader.h.
String MirVisReader::inname_p [private] |
info that doesn't change during life of filler
Definition at line 253 of file MirVisReader.h.
Referenced by getName().
LogIO MirVisReader::log_p [private] |
Definition at line 256 of file MirVisReader.h.
Int MirVisReader::maxchan_p [private] |
Definition at line 263 of file MirVisReader.h.
Int MirVisReader::maxrec_p [private] |
Definition at line 272 of file MirVisReader.h.
Int MirVisReader::maxspect_p [private] |
Definition at line 263 of file MirVisReader.h.
Int MirVisReader::maxwide_p [private] |
Definition at line 263 of file MirVisReader.h.
Int MirVisReader::narray_p [private] |
Definition at line 263 of file MirVisReader.h.
Int MirVisReader::nintrec_p [private] |
Definition at line 272 of file MirVisReader.h.
Referenced by clearMarks(), and getNumRecs().
Int MirVisReader::nnarr_p [private] |
Definition at line 272 of file MirVisReader.h.
Int MirVisReader::nobs_p [private] |
Definition at line 264 of file MirVisReader.h.
Int MirVisReader::nrec_p [private] |
Definition at line 263 of file MirVisReader.h.
Int MirVisReader::nscan_p [private] |
Definition at line 264 of file MirVisReader.h.
Int MirVisReader::nwide_p [private] |
Definition at line 272 of file MirVisReader.h.
MirPolSetup MirVisReader::pol_p [private] |
Definition at line 262 of file MirVisReader.h.
Referenced by getDefaultPolSetup().
Bool MirVisReader::previewed_p [private] |
Definition at line 275 of file MirVisReader.h.
Referenced by previewed().
Bool MirVisReader::scanned_p [private] |
Definition at line 275 of file MirVisReader.h.
List<MirSource*> MirVisReader::sources_p [private] |
Definition at line 260 of file MirVisReader.h.
Referenced by getSourceList().
Double MirVisReader::starttime_p [private] |
Definition at line 267 of file MirVisReader.h.
List<String> MirVisReader::telescopes_p [private] |
Definition at line 261 of file MirVisReader.h.
Referenced by setTelescope().
Double MirVisReader::time_p [private] |
Definition at line 273 of file MirVisReader.h.
Referenced by getTime().
Int MirVisReader::uv_handle_p [private] |
Definition at line 254 of file MirVisReader.h.
Referenced by openHistory().
MirVarHandler* MirVisReader::varhandler_p [private] |
Definition at line 274 of file MirVisReader.h.
Bool MirVisReader::varupd_p [private] |
Definition at line 275 of file MirVisReader.h.
Bool MirVisReader::verbose_p [private] |
Definition at line 275 of file MirVisReader.h.
Referenced by verbose().
wideConventions MirVisReader::wideconv_p [private] |
Definition at line 268 of file MirVisReader.h.