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

a Miriad visibility dataset reader More...

#include <MirVisReader.h>

Inheritance diagram for MirVisReader:
MirTypeAssert

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::StringgetName ()
 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...
 
MirDataRecordgetRecord (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...
 
MirHisReaderopenHistory ()
 create and return a new pointer to a history reader. More...
 
ConstMirPolSetupgetDefaultPolSetup ()
 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 ()
 

Private Attributes

casacore::String inname_p
 info that doesn't change during life of filler More...
 
casacore::Int uv_handle_p
 
casacore::uInt debug
 
casacore::LogIO log_p
 
casacore::List< MirFreqSetup * > fsetups_p
 variable information worth caching More...
 
casacore::List< MirSource * > sources_p
 
casacore::List< casacore::Stringtelescopes_p
 
MirPolSetup pol_p
 
casacore::Int maxchan_p
 
casacore::Int maxwide_p
 
casacore::Int maxspect_p
 
casacore::Int narray_p
 
casacore::Int nrec_p
 
casacore::Int nobs_p
 
casacore::Int nscan_p
 
casacore::Int badnsyst_p
 
casacore::Int badwsyst_p
 
casacore::Int firstmode_p
 
casacore::Double starttime_p
 
casacore::Double endtime_p
 
wideConventions wideconv_p
 
casacore::Block< MirDataRecord * > buf_p
 read state More...
 
casacore::Int nintrec_p
 
casacore::Int maxrec_p
 
casacore::Int nnarr_p
 
casacore::Int nwide_p
 
casacore::Double time_p
 
MirVarHandlervarhandler_p
 
casacore::Bool varupd_p
 
casacore::Bool hasmore_p
 
casacore::Bool dowide_p
 
casacore::Bool verbose_p
 
casacore::Bool previewed_p
 
casacore::Bool scanned_p
 

Additional Inherited Members

- Static Private Attributes inherited from MirTypeAssert
static casacore::Bool ok
 

Detailed Description

a Miriad visibility dataset reader

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Etymology

Class name is short for Miriad visibility reader.

Motivation

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.

Synopsis

This class is used to extract data from a Miriad visibility dataset.

Example

To Do

Definition at line 251 of file MirVisReader.h.

Member Enumeration Documentation

Enumerator
NONE 
BIMA 
MIRIAD 
MIXED 
NCONV 

Definition at line 253 of file MirVisReader.h.

Constructor & Destructor Documentation

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

Member Function Documentation

void MirVisReader::briefscan ( )
private
void MirVisReader::checkIsMiriadDataset ( const casacore::String name)
throw (casacore::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 338 of file MirVisReader.h.

References buf_p, and nintrec_p.

casacore::Bool MirVisReader::Debug ( casacore::Int  level)
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.

void MirVisReader::fullscan ( casacore::Int  scanlim,
casacore::Int  obslim 
)
private

full and brief scanning of the data–should only be called from preview()

casacore::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 305 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(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.

const casacore::String& MirVisReader::getName ( )
inline

return the Miriad dataset name

Definition at line 312 of file MirVisReader.h.

References inname_p.

casacore::Int MirVisReader::getNumRecs ( )
inline

return the number of records buffered for the current integration

Definition at line 332 of file MirVisReader.h.

References nintrec_p.

MirDataRecord* MirVisReader::getRecord ( casacore::Int  i)
inline

return the correlation data for the i-th buffered record.

Definition at line 335 of file MirVisReader.h.

References buf_p.

const casacore::List<MirSource*>& MirVisReader::getSourceList ( )
inline

return the list of sources

Definition at line 367 of file MirVisReader.h.

References sources_p.

casacore::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 329 of file MirVisReader.h.

References time_p.

void MirVisReader::handleVarChanges ( ::FillMetadata fm,
casacore::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 344 of file MirVisReader.h.

References uv_handle_p.

void MirVisReader::preview ( casacore::Int  scanlim,
casacore::Int  obslim,
casacore::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.

void MirVisReader::preview ( casacore::Bool  scan = true)
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().

casacore::Bool MirVisReader::previewed ( )
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.

void MirVisReader::resizeBufferFor ( casacore::Int  nrec = 0,
casacore::Int  nnarrow = 0,
casacore::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 ( casacore::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 299 of file MirVisReader.h.

References debug.

Referenced by MirFiller::setDebugLevel().

void MirVisReader::setTelescope ( casacore::String  name)
inlineprivate
casacore::Bool MirVisReader::verbose ( )
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.

References debug, and verbose_p.

Member Data Documentation

casacore::Int MirVisReader::badnsyst_p
private

Definition at line 269 of file MirVisReader.h.

casacore::Int MirVisReader::badwsyst_p
private

Definition at line 269 of file MirVisReader.h.

casacore::Block<MirDataRecord *> MirVisReader::buf_p
private

read state

Definition at line 275 of file MirVisReader.h.

Referenced by clearMarks(), and getRecord().

casacore::uInt MirVisReader::debug
private

Definition at line 259 of file MirVisReader.h.

Referenced by Debug(), getDebugLevel(), setDebugLevel(), and verbose().

casacore::Bool MirVisReader::dowide_p
private

Definition at line 279 of file MirVisReader.h.

casacore::Double MirVisReader::endtime_p
private

Definition at line 271 of file MirVisReader.h.

casacore::Int MirVisReader::firstmode_p
private

Definition at line 270 of file MirVisReader.h.

casacore::List<MirFreqSetup*> MirVisReader::fsetups_p
private

variable information worth caching

Definition at line 263 of file MirVisReader.h.

casacore::Bool MirVisReader::hasmore_p
private

Definition at line 279 of file MirVisReader.h.

casacore::String MirVisReader::inname_p
private

info that doesn't change during life of filler

Definition at line 257 of file MirVisReader.h.

Referenced by getName().

casacore::LogIO MirVisReader::log_p
private

Definition at line 260 of file MirVisReader.h.

casacore::Int MirVisReader::maxchan_p
private

Definition at line 267 of file MirVisReader.h.

casacore::Int MirVisReader::maxrec_p
private

Definition at line 276 of file MirVisReader.h.

casacore::Int MirVisReader::maxspect_p
private

Definition at line 267 of file MirVisReader.h.

casacore::Int MirVisReader::maxwide_p
private

Definition at line 267 of file MirVisReader.h.

casacore::Int MirVisReader::narray_p
private

Definition at line 267 of file MirVisReader.h.

casacore::Int MirVisReader::nintrec_p
private

Definition at line 276 of file MirVisReader.h.

Referenced by clearMarks(), and getNumRecs().

casacore::Int MirVisReader::nnarr_p
private

Definition at line 276 of file MirVisReader.h.

casacore::Int MirVisReader::nobs_p
private

Definition at line 268 of file MirVisReader.h.

casacore::Int MirVisReader::nrec_p
private

Definition at line 267 of file MirVisReader.h.

casacore::Int MirVisReader::nscan_p
private

Definition at line 268 of file MirVisReader.h.

casacore::Int MirVisReader::nwide_p
private

Definition at line 276 of file MirVisReader.h.

MirPolSetup MirVisReader::pol_p
private

Definition at line 266 of file MirVisReader.h.

Referenced by getDefaultPolSetup().

casacore::Bool MirVisReader::previewed_p
private

Definition at line 279 of file MirVisReader.h.

Referenced by previewed().

casacore::Bool MirVisReader::scanned_p
private

Definition at line 279 of file MirVisReader.h.

casacore::List<MirSource*> MirVisReader::sources_p
private

Definition at line 264 of file MirVisReader.h.

Referenced by getSourceList().

casacore::Double MirVisReader::starttime_p
private

Definition at line 271 of file MirVisReader.h.

casacore::List<casacore::String> MirVisReader::telescopes_p
private

Definition at line 265 of file MirVisReader.h.

Referenced by setTelescope().

casacore::Double MirVisReader::time_p
private

Definition at line 277 of file MirVisReader.h.

Referenced by getTime().

casacore::Int MirVisReader::uv_handle_p
private

Definition at line 258 of file MirVisReader.h.

Referenced by openHistory().

MirVarHandler* MirVisReader::varhandler_p
private

Definition at line 278 of file MirVisReader.h.

casacore::Bool MirVisReader::varupd_p
private

Definition at line 279 of file MirVisReader.h.

casacore::Bool MirVisReader::verbose_p
private

Definition at line 279 of file MirVisReader.h.

Referenced by verbose().

wideConventions MirVisReader::wideconv_p
private

Definition at line 272 of file MirVisReader.h.


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