casa
5.7.0-16
|
a Miriad visibility dataset reader More...
#include <MirVisReader.h>
Public Types | |
enum | wideConventions { NONE, BIMA, MIRIAD, MIXED, NCONV } |
Public Member Functions | |
MirVisReader (const casacore::String &mirfile, casacore::Bool doscan=true, casacore::Int dbg=0, casacore::Bool dopreview=true) | |
construct a reader. More... | |
~MirVisReader () | |
destroy the reader More... | |
void | setDebugLevel (casacore::Int level) |
set the debugging level which controls the amount of debugging messages that are printed to the terminal (as opposed to the logger). More... | |
casacore::Int | getDebugLevel () const |
set the debugging level which controls the amount of debugging messages that are printed to the terminal. More... | |
casacore::Bool | Debug (casacore::Int level) |
return true if the debugging level is at least as high as a given level. More... | |
const casacore::String & | getName () |
return the Miriad dataset name More... | |
void | reset (MirVarHandler *filler=NULL, casacore::Bool verbose=false, casacore::Bool dowide=true, casacore::Int maxrec=0) |
rewind the input dataset and prepare for a new reading. More... | |
casacore::Int | readIntegration (::FillMetadata &fm) |
read in the data for a single timestamp. More... | |
casacore::Double | getTime () |
return the (AIPS++-referenced) timestamp for the current buffered records. More... | |
casacore::Int | getNumRecs () |
return the number of records buffered for the current integration More... | |
MirDataRecord * | getRecord (casacore::Int i) |
return the correlation data for the i-th buffered record. More... | |
void | clearMarks () |
set the marked data item for each MirDataRecord to false More... | |
MirHisReader * | openHistory () |
create and return a new pointer to a history reader. More... | |
ConstMirPolSetup & | getDefaultPolSetup () |
return the basic characteristics of the input dataset as a Record. More... | |
const casacore::List < MirSource * > & | getSourceList () |
return the list of sources More... | |
Protected Member Functions | |
void | preview (casacore::Int scanlim, casacore::Int obslim, casacore::Bool scan=true) |
peek into the contents of the dataset to cache important information. More... | |
void | preview (casacore::Bool scan=true) |
peek into the contents of the dataset to cache important information. More... | |
casacore::Bool | previewed () |
return true if this dataset has been previewed More... | |
Private Member Functions | |
casacore::Bool | verbose () |
return the basic characteristics of the input dataset as a Record. More... | |
void | checkIsMiriadDataset (const casacore::String &name) throw (casacore::AipsError) |
check to be sure that the given name points to a readable miriad dataset. More... | |
void | resizeBufferFor (casacore::Int nrec=0, casacore::Int nnarrow=0, casacore::Int nwide=0) |
resize the data buffer for a new read. More... | |
void | fullscan (casacore::Int scanlim, casacore::Int obslim) |
full and brief scanning of the data–should only be called from preview() More... | |
void | briefscan () |
void | handleVarChanges (::FillMetadata &fm, casacore::Double time) |
update the given FillMetadata container with updated variable values. More... | |
void | setTelescope (casacore::String name) |
add to a cached list of telescopes More... | |
Private Member Functions inherited from MirTypeAssert | |
MirTypeAssert () | |
Additional Inherited Members | |
Static Private Attributes inherited from MirTypeAssert | |
static casacore::Bool | ok |
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 casacore::MS reads can be aided by collecting together casacore::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 251 of file MirVisReader.h.
Enumerator | |
---|---|
NONE | |
BIMA | |
MIRIAD | |
MIXED | |
NCONV |
Definition at line 253 of file MirVisReader.h.
MirVisReader::MirVisReader | ( | const casacore::String & | mirfile, |
casacore::Bool | doscan = true , |
||
casacore::Int | dbg = 0 , |
||
casacore::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
|
private |
|
private |
check to be sure that the given name points to a readable miriad dataset.
If not, throw an exception.
|
inline |
set the marked data item for each MirDataRecord to false
Definition at line 338 of file MirVisReader.h.
|
inline |
return true if the debugging level is at least as high as a given level.
Definition at line 309 of file MirVisReader.h.
References debug.
|
private |
full and brief scanning of the data–should only be called from preview()
|
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 305 of file MirVisReader.h.
References debug.
|
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(casacore::Bool verbose=true, casacore::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(casacore::Int scanlim, casacore::Int obslim, casacore::Bool verbose=true);
get the full list of polarization correlation types seen thus far
Definition at line 364 of file MirVisReader.h.
References pol_p.
|
inline |
|
inline |
return the number of records buffered for the current integration
Definition at line 332 of file MirVisReader.h.
References nintrec_p.
|
inline |
return the correlation data for the i-th buffered record.
Definition at line 335 of file MirVisReader.h.
References buf_p.
|
inline |
|
inline |
return the (AIPS++-referenced) timestamp for the current buffered records.
This is only correct after a call to readIntegration().
Definition at line 329 of file MirVisReader.h.
References time_p.
|
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.
|
inline |
create and return a new pointer to a history reader.
The caller should delete the reader when finished with it.
Definition at line 344 of file MirVisReader.h.
References uv_handle_p.
|
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.
|
inlineprotected |
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 388 of file MirVisReader.h.
References preview().
Referenced by preview().
|
inlineprotected |
return true if this dataset has been previewed
Definition at line 391 of file MirVisReader.h.
References previewed_p.
casacore::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 , |
casacore::Bool | verbose = false , |
||
casacore::Bool | dowide = true , |
||
casacore::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.
|
private |
resize the data buffer for a new read.
Values less than or equal to zero mean keep previous value.
|
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 299 of file MirVisReader.h.
References debug.
Referenced by MirFiller::setDebugLevel().
|
inlineprivate |
add to a cached list of telescopes
Definition at line 439 of file MirVisReader.h.
References casacore::ListIter< t >::addRight(), casacore::ConstListIter< t >::atEnd(), casacore::ListIter< t >::getRight(), casa::name(), telescopes_p, and casacore::ConstListIter< t >::toStart().
|
inlineprivate |
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(casacore::Bool verbose, casacore::Int scan, casacore::Int scanlim, casacore::Int obslim);
return the contents of a MirPolSetup list as a GlishArray static GlishArray toGlishArray(ConstMirPolSetup &pol);
return the contents of a casacore::String casacore::List as a GlishArray static GlishArray toGlishArray(const casacore::List<casacore::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 418 of file MirVisReader.h.
|
private |
Definition at line 269 of file MirVisReader.h.
|
private |
Definition at line 269 of file MirVisReader.h.
|
private |
read state
Definition at line 275 of file MirVisReader.h.
Referenced by clearMarks(), and getRecord().
|
private |
Definition at line 259 of file MirVisReader.h.
Referenced by Debug(), getDebugLevel(), setDebugLevel(), and verbose().
|
private |
Definition at line 279 of file MirVisReader.h.
|
private |
Definition at line 271 of file MirVisReader.h.
|
private |
Definition at line 270 of file MirVisReader.h.
|
private |
variable information worth caching
Definition at line 263 of file MirVisReader.h.
|
private |
Definition at line 279 of file MirVisReader.h.
|
private |
info that doesn't change during life of filler
Definition at line 257 of file MirVisReader.h.
Referenced by getName().
|
private |
Definition at line 260 of file MirVisReader.h.
|
private |
Definition at line 267 of file MirVisReader.h.
|
private |
Definition at line 276 of file MirVisReader.h.
|
private |
Definition at line 267 of file MirVisReader.h.
|
private |
Definition at line 267 of file MirVisReader.h.
|
private |
Definition at line 267 of file MirVisReader.h.
|
private |
Definition at line 276 of file MirVisReader.h.
Referenced by clearMarks(), and getNumRecs().
|
private |
Definition at line 276 of file MirVisReader.h.
|
private |
Definition at line 268 of file MirVisReader.h.
|
private |
Definition at line 267 of file MirVisReader.h.
|
private |
Definition at line 268 of file MirVisReader.h.
|
private |
Definition at line 276 of file MirVisReader.h.
|
private |
Definition at line 266 of file MirVisReader.h.
Referenced by getDefaultPolSetup().
|
private |
Definition at line 279 of file MirVisReader.h.
Referenced by previewed().
|
private |
Definition at line 279 of file MirVisReader.h.
|
private |
Definition at line 264 of file MirVisReader.h.
Referenced by getSourceList().
|
private |
Definition at line 271 of file MirVisReader.h.
|
private |
Definition at line 265 of file MirVisReader.h.
Referenced by setTelescope().
|
private |
Definition at line 277 of file MirVisReader.h.
Referenced by getTime().
|
private |
Definition at line 258 of file MirVisReader.h.
Referenced by openHistory().
|
private |
Definition at line 278 of file MirVisReader.h.
|
private |
Definition at line 279 of file MirVisReader.h.
|
private |
Definition at line 279 of file MirVisReader.h.
Referenced by verbose().
|
private |
Definition at line 272 of file MirVisReader.h.