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

SDMDataObject:: declarations. More...

#include <SDMDataObject.h>

Classes

class  AutoDataBinaryPart
 A subclass of binaryPart to describe the autodata. More...
 
class  Baseband
 SDMDataObject::Baseband:: declarations. More...
 
class  BinaryPart
 SDMDataObject::BinaryPart:: declarations. More...
 
class  DataStruct
 SDMDataObject::DataStruct:: declarations. More...
 
class  SpectralWindow
 SDMDataObject::SpectralWindow:: declarations. More...
 
class  ZeroLagsBinaryPart
 A subclass of binaryPart to describe the zeroLags. More...
 

Public Member Functions

 SDMDataObject ()
 
 SDMDataObject (unsigned long long startTime, const std::string &dataOID, unsigned int dimensionality, const std::string &execBlockUID, unsigned int execBlockNum, unsigned int scanNum, unsigned int subscanNum, unsigned int numAntenna, CorrelationModeMod::CorrelationMode correlatorMode, const SDMDataObject::DataStruct &dataStruct)
 
 SDMDataObject (unsigned long long startTime, const std::string &dataOID, unsigned int dimensionality, unsigned int numTime, const std::string &execBlockUID, unsigned int execBlockNum, unsigned int scanNum, unsigned int subscanNum, unsigned int numAntenna, const SDMDataObject::DataStruct &dataStruct)
 
std::string title () const
 Returns the title of the SDMDataObject. More...
 
void title (const std::string &value)
 
const ByteOrderbyteOrder () const
 Returns the byte order of the binary parts. More...
 
unsigned long long startTime () const
 Returns the start time. More...
 
void startTime (unsigned long long value)
 
unsigned int numTime () const
 Returns the number of (sub) integrations. More...
 
void numTime (unsigned int value)
 
std::string dataOID () const
 Returns the dataOID. More...
 
void dataOID (const std::string &value)
 
std::string execBlockUID () const
 Returns the UID of the ExecBlock. More...
 
void execBlockUID (const std::string &value)
 
unsigned int execBlockNum () const
 Returns the number of the ExecBlock. More...
 
void execBlockNum (unsigned int value)
 
unsigned int scanNum () const
 Returns the number of the scan. More...
 
void scanNum (unsigned int value)
 
unsigned int subscanNum () const
 Returns the number of the subscan. More...
 
void subscanNum (int value)
 
std::string projectPath () const
 Returns the project path. More...
 
std::vector< std::string > projectPaths () const
 Returns the projects paths of all the data subsets present in this SDMDataObject. More...
 
unsigned int numAntenna () const
 Returns the number of antenna. More...
 
void numAntenna (unsigned int value)
 
CorrelationModeMod::CorrelationMode correlationMode () const
 Returns the correlation mode. More...
 
OptionalSpectralResolutionType spectralResolutionType () const
 Returns the spectral resolution. More...
 
ProcessorTypeMod::ProcessorType processorType () const
 Returns the processor type. More...
 
CorrelatorTypeMod::CorrelatorType correlatorType () const
 Returns the correlator type. More...
 
bool isTP () const
 Returns true if the data are total power data and false otherwise. More...
 
bool isWVR () const
 Returns true if the data are wvr data and false otherwise. More...
 
bool isCorrelation () const
 Returns true if the data are correlator data and false otherwise. More...
 
bool hasPackedData () const
 hasPackedData returns true if all the integrations are grouped in one subset for all the timestamps and conversely false if there is one subset per integration (i.e. More...
 
const DataStructdataStruct () const
 Returns the structure of the data. More...
 
void dataStruct (const DataStruct &dataStruct)
 
const std::vector
< SDMDataSubset > & 
sdmDataSubsets () const
 Return all the SDMDataSubsets contained in this. More...
 
const std::vector
< SDMDataSubset > & 
corrDataSubsets () const
 Returns the binary data as a sequence of integrations. More...
 
void corrDataSubsets (const std::vector< SDMDataSubset > &value)
 
const SDMDataSubsetsdmDataSubset (const std::string &projectPath) const
 Returns a reference to a SDMDataSubset given its projectPath. More...
 
bool aborted () const
 Returns true if the observation has been aborted. More...
 
unsigned long long abortTime () const
 Returns the time, as an unsigned long long, at which the observation has been aborted. More...
 
std::string abortReason () const
 Returns the reason, as a string, why the observation has been aborted. More...
 
const SDMDataSubsettpDataSubset () const
 Returns the binary data for a subscan. More...
 
void tpDataSubset (const SDMDataSubset &value)
 
std::string toString () const
 Returns a string representation of the global header of this SDMDataObject. More...
 
void done ()
 Makes this SDMDataObject unusable. More...
 
unsigned int dimensionality () const
 Dimensionality of the binary content. More...
 

Private Member Functions

void append (const SDMDataSubset &value)
 
void dimensionality (unsigned int value)
 Returns the "dimensionality" of this SDMDataObject. More...
 
bool inTitle (const std::string &what) const
 Returns true is the string passed as an argument is found in the title of this. More...
 
void owns ()
 Declares itself as the owner of all its parts. More...
 
std::string toXML ()
 Returns an XML representation of the global header of this SDMDataObject. More...
 
void toXML (const BinaryPart &binaryPart, const std::string &elementName, std::ostringstream &oss) const
 
void toXML (const AutoDataBinaryPart &autoDataBinaryPart, const std::string &elementName, std::ostringstream &oss) const
 
void toXML (const ZeroLagsBinaryPart &zeroLagsBinaryPart, const std::string &elementName, std::ostringstream &oss) const
 
void spectralWindowsToXML (const std::vector< Baseband > &basebands, unsigned int ibb, std::ostringstream &oss) const
 
void basebandsToXML (std::ostringstream &oss) const
 
void dataStructToXML (std::ostringstream &oss)
 
void updateIdImageSPW ()
 

Static Private Member Functions

static bool init ()
 

Private Attributes

bool valid_
 Is the SDMDataObject actually properly filled with valid data. More...
 
std::string title_
 Global header variables. More...
 
const ByteOrderbyteOrder_
 
int schemaVersion_
 
long long startTime_
 
std::string dataOID_
 
unsigned int dimensionality_
 
unsigned int numTime_
 
std::string execBlockUID_
 
unsigned int execBlockNum_
 
unsigned int scanNum_
 
unsigned int subscanNum_
 
unsigned int numAntenna_
 
CorrelationModeMod::CorrelationMode correlationMode_
 
OptionalSpectralResolutionType spectralResolutionType_
 
ProcessorTypeMod::ProcessorType processorType_
 
DataStruct dataStruct_
 
std::map< std::string,
unsigned int > 
str2index_
 
std::vector< SDMDataSubsetdataSubsets_
 
bool aborted_
 
unsigned long long int abortTime_
 
std::string abortReason_
 

Static Private Attributes

static std::vector< std::string > correlationModeRefs
 
static std::vector< std::string > axes
 
static std::vector< std::string > types
 
static std::vector< std::string > apcs
 
static const bool _init
 
static const boost::regex SPWID
 

Friends

class SDMDataObjectStreamReader
 
class SDMDataObjectReader
 
class SDMDataObjectWriter
 
class HeaderParser
 
class SDMDataSubset
 
class CorrSubsetHeaderParser
 

Detailed Description

SDMDataObject:: declarations.

 A class to represent ALMA binary data.
 Three situations can be handled by this class:
 <ul>
 <li> Correlator data </li>
 <li> Total power data </li>
 <li> WVR data </li>
 </ul>

 At the time of writing:
 <ul>
 <li> Correlator data (isCorrelation() returns true) are stored in an SDMDataObject which is organized as a global header containing descriptive informations
 valid for all the recorded binary data, followed by a sequence of SDMDataSubsets - local header, binary data pairs - . Each SDMDataSubset
 corresponds to one integration and the full SDMDataObject corresponds to one subscan  (hasPackedData returns false).

 <li> Total Power (TP) data (isTP() returns true) are stored like Correlator data i.e in a sequence of SDMDataSubsets (hasPackedData() returns false) <b>or</b> for TP data recorded before Cycle 3 
 in a SDMDataObject containing the global header followed by <b>one unique</b> SDMDataSubset containing the data recorded during the whole subscan (hasPackedData() returns true). 
 </li>

 <li> WVR data (isWVR() returns true) are stored in an SDMDataObject organized as one global header followed by <b>one unique</b> SDMDataSubset containing the data recorded during the whole subscan (hasPackedData() returns true). 

 <ul> 

 An instance of an SDMDataObject is never created explicitely by calling some constructors or setters methods. Instances
 of SDMDataObject are rather created implicitely :
 <ul>
 <li> on output, while creating a MIME message containing ALMA binary data by using the class SDMDataObjectWriter; actual parameters passed to methods of this class are assembled together to

form an SDMDataObject which is in turn converted into a MIME message, on input, while reading a MIME message containing ALMA binary data by using the class SDMDataObjectReader; the result of the parsing of the MIME message is returned in an SDMDataObject.

Accessing the different parts of an SDMDataObject.

We give here a quick list of the method which allows to retrieve the different parts of an SDMDataObject :

Definition at line 323 of file SDMDataObject.h.

Constructor & Destructor Documentation

asdmbinaries::SDMDataObject::SDMDataObject ( )
asdmbinaries::SDMDataObject::SDMDataObject ( unsigned long long  startTime,
const std::string &  dataOID,
unsigned int  dimensionality,
const std::string &  execBlockUID,
unsigned int  execBlockNum,
unsigned int  scanNum,
unsigned int  subscanNum,
unsigned int  numAntenna,
CorrelationModeMod::CorrelationMode  correlatorMode,
const SDMDataObject::DataStruct dataStruct 
)
asdmbinaries::SDMDataObject::SDMDataObject ( unsigned long long  startTime,
const std::string &  dataOID,
unsigned int  dimensionality,
unsigned int  numTime,
const std::string &  execBlockUID,
unsigned int  execBlockNum,
unsigned int  scanNum,
unsigned int  subscanNum,
unsigned int  numAntenna,
const SDMDataObject::DataStruct dataStruct 
)

Member Function Documentation

bool asdmbinaries::SDMDataObject::aborted ( ) const

Returns true if the observation has been aborted.

This method must be used on an SDMDataObject containing correlator data,otherwise a SDMDataObjectException is thrown.

Returns
a bool.
Exceptions
SDMDataObjectException.
std::string asdmbinaries::SDMDataObject::abortReason ( ) const

Returns the reason, as a string, why the observation has been aborted.

The returned value is significant only if the observation has been aborted, therefore the method must always be used in conjuction with the aborted method. This method must be used on an SDMDataObject containing correlator data, otherwise a SDMDataObjectException is thrown.

Returns
a string.
Exceptions
SDMDataObjectException
unsigned long long asdmbinaries::SDMDataObject::abortTime ( ) const

Returns the time, as an unsigned long long, at which the observation has been aborted.

The returned value is significant only if the observation has been aborted, therefore the method must always be used in conjuction with the aborted method. This method must be used on an SDMDataObject containing correlator data, otherwise a SDMDataObjectException is thrown.

Returns
an unsigned long long.
Exceptions
SDMDataObjectException
void asdmbinaries::SDMDataObject::append ( const SDMDataSubset value)
private
void asdmbinaries::SDMDataObject::basebandsToXML ( std::ostringstream &  oss) const
private
const ByteOrder* asdmbinaries::SDMDataObject::byteOrder ( ) const

Returns the byte order of the binary parts.

Returns
a pointer of a ByteOrder instance.
const std::vector<SDMDataSubset>& asdmbinaries::SDMDataObject::corrDataSubsets ( ) const

Returns the binary data as a sequence of integrations.

This method must be used only when the SDMDataObject contains correlator data (i.e. isCorrelation() == true)

Returns
a reference to a vector of SDMDataSubset.
void asdmbinaries::SDMDataObject::corrDataSubsets ( const std::vector< SDMDataSubset > &  value)
CorrelationModeMod::CorrelationMode asdmbinaries::SDMDataObject::correlationMode ( ) const

Returns the correlation mode.

Returns
a value from enumeration CorrelationMode.
CorrelatorTypeMod::CorrelatorType asdmbinaries::SDMDataObject::correlatorType ( ) const

Returns the correlator type.

Returns
a value from the enumeration CorrelatorType if processorType == CORRELATOR else an SDMDataObjectException is thrown.
Exceptions
SDMDataException
std::string asdmbinaries::SDMDataObject::dataOID ( ) const

Returns the dataOID.

Returns
a string.
void asdmbinaries::SDMDataObject::dataOID ( const std::string &  value)
const DataStruct& asdmbinaries::SDMDataObject::dataStruct ( ) const

Returns the structure of the data.

Returns
a reference to a DataStruct.
void asdmbinaries::SDMDataObject::dataStruct ( const DataStruct dataStruct)
void asdmbinaries::SDMDataObject::dataStructToXML ( std::ostringstream &  oss)
private
unsigned int asdmbinaries::SDMDataObject::dimensionality ( ) const

Dimensionality of the binary content.

== 0 all data are grouped in one subset == 1 data are spread over a sequence of subsets, usually along the time axis with one integration (i.e. one timestamp) per subset.

void asdmbinaries::SDMDataObject::dimensionality ( unsigned int  value)
private

Returns the "dimensionality" of this SDMDataObject.

A value of

  • 0 corresponds to total power data.
  • 1 corresponds to correlator data.
void asdmbinaries::SDMDataObject::done ( )

Makes this SDMDataObject unusable.

After a call to this method any request to this instance will generate an exception.

unsigned int asdmbinaries::SDMDataObject::execBlockNum ( ) const

Returns the number of the ExecBlock.

Returns
an unsigned int.
void asdmbinaries::SDMDataObject::execBlockNum ( unsigned int  value)
std::string asdmbinaries::SDMDataObject::execBlockUID ( ) const

Returns the UID of the ExecBlock.

Returns
a string.
void asdmbinaries::SDMDataObject::execBlockUID ( const std::string &  value)
bool asdmbinaries::SDMDataObject::hasPackedData ( ) const

hasPackedData returns true if all the integrations are grouped in one subset for all the timestamps and conversely false if there is one subset per integration (i.e.

per timestamp). Equivalent to the method dimensionality as follows : "hasPackedData returns true is equivalent to dimensionality returns 0"

static bool asdmbinaries::SDMDataObject::init ( )
staticprivate
bool asdmbinaries::SDMDataObject::inTitle ( const std::string &  what) const
private

Returns true is the string passed as an argument is found in the title of this.

The search is case insensitive.

Parameters
what,thestring to be looked for in the title of this.
Returns
true if and only if s is found in the title of this.
bool asdmbinaries::SDMDataObject::isCorrelation ( ) const

Returns true if the data are correlator data and false otherwise.

Returns
a bool.
Note
data are considered as correlator data if SpectralResolutionType != BASEBAND_WIDE.
bool asdmbinaries::SDMDataObject::isTP ( ) const

Returns true if the data are total power data and false otherwise.

Returns
a bool.
Note
data are considered as total power data if title contains the words "Total Power".
bool asdmbinaries::SDMDataObject::isWVR ( ) const

Returns true if the data are wvr data and false otherwise.

Returns
a bool.
Note
data are considered as WVR data if title contains the acronym "WVR".
unsigned int asdmbinaries::SDMDataObject::numAntenna ( ) const

Returns the number of antenna.

Returns
an unsigned int.
void asdmbinaries::SDMDataObject::numAntenna ( unsigned int  value)
unsigned int asdmbinaries::SDMDataObject::numTime ( ) const

Returns the number of (sub) integrations.

Returns
an unsigned int.
void asdmbinaries::SDMDataObject::numTime ( unsigned int  value)
void asdmbinaries::SDMDataObject::owns ( )
private

Declares itself as the owner of all its parts.

ProcessorTypeMod::ProcessorType asdmbinaries::SDMDataObject::processorType ( ) const

Returns the processor type.

Returns
a value from the enumeration ProcessorType.
std::string asdmbinaries::SDMDataObject::projectPath ( ) const

Returns the project path.

The project path is a string of the form "/<s>execBlockNum</s>/<s>scanNum</s>/<s>subscanNum</s>"

std::vector<std::string> asdmbinaries::SDMDataObject::projectPaths ( ) const

Returns the projects paths of all the data subsets present in this SDMDataObject.

Returns
a vector of string.
unsigned int asdmbinaries::SDMDataObject::scanNum ( ) const

Returns the number of the scan.

Returns
an unsigned int.
void asdmbinaries::SDMDataObject::scanNum ( unsigned int  value)
const SDMDataSubset& asdmbinaries::SDMDataObject::sdmDataSubset ( const std::string &  projectPath) const

Returns a reference to a SDMDataSubset given its projectPath.

Parameters
projectPatha string containing the project path of the SDMDataSubset.
Returns
a pointer to an SDMDataSubset.
Exceptions
SDMDataObjectException.
const std::vector<SDMDataSubset>& asdmbinaries::SDMDataObject::sdmDataSubsets ( ) const

Return all the SDMDataSubsets contained in this.

Returns
a reference on the vector of SDMDataSubsets contained in this instance of SDMDataObject. It's the responsibility of the user to determine what's in the element(s) of this vector from what's returned by a call to the method hasPackedData. If packedData returns true then the vector contains only one element containing all the data (typically this happens for WVR data), conversely if it returns false then the vector may have more than one element and the data are distributed over the elements on the basis of one integration per element.
OptionalSpectralResolutionType asdmbinaries::SDMDataObject::spectralResolutionType ( ) const

Returns the spectral resolution.

Due to this optional nature, the spectral resolution type is not returned directly as a literal of the enumeration SpectralResolutionType, but as an instance of the class OptionalSpectralResolutionType. This instance can be queried to check if the spectral resolution type information is present and if it is its value as an SpectralResolutionType literal.

Returns
a value from enumeration SpectralResolutionType.
void asdmbinaries::SDMDataObject::spectralWindowsToXML ( const std::vector< Baseband > &  basebands,
unsigned int  ibb,
std::ostringstream &  oss 
) const
private
unsigned long long asdmbinaries::SDMDataObject::startTime ( ) const

Returns the start time.

Returns
a long long.
void asdmbinaries::SDMDataObject::startTime ( unsigned long long  value)
unsigned int asdmbinaries::SDMDataObject::subscanNum ( ) const

Returns the number of the subscan.

Returns
an unsigned int.
void asdmbinaries::SDMDataObject::subscanNum ( int  value)
std::string asdmbinaries::SDMDataObject::title ( ) const

Returns the title of the SDMDataObject.

Returns
a string.
void asdmbinaries::SDMDataObject::title ( const std::string &  value)
std::string asdmbinaries::SDMDataObject::toString ( ) const

Returns a string representation of the global header of this SDMDataObject.

Returns
a string.
std::string asdmbinaries::SDMDataObject::toXML ( )
private

Returns an XML representation of the global header of this SDMDataObject.

Returns
a string.
void asdmbinaries::SDMDataObject::toXML ( const BinaryPart binaryPart,
const std::string &  elementName,
std::ostringstream &  oss 
) const
private
void asdmbinaries::SDMDataObject::toXML ( const AutoDataBinaryPart autoDataBinaryPart,
const std::string &  elementName,
std::ostringstream &  oss 
) const
private
void asdmbinaries::SDMDataObject::toXML ( const ZeroLagsBinaryPart zeroLagsBinaryPart,
const std::string &  elementName,
std::ostringstream &  oss 
) const
private
const SDMDataSubset& asdmbinaries::SDMDataObject::tpDataSubset ( ) const

Returns the binary data for a subscan.

This method must be used only when the SDMDataObject contains total power data (i.e. isTP() == true)

Returns
a reference to an SDMDataSubset.
void asdmbinaries::SDMDataObject::tpDataSubset ( const SDMDataSubset value)
void asdmbinaries::SDMDataObject::updateIdImageSPW ( )
private

Friends And Related Function Documentation

friend class CorrSubsetHeaderParser
friend

Definition at line 329 of file SDMDataObject.h.

friend class HeaderParser
friend

Definition at line 327 of file SDMDataObject.h.

friend class SDMDataObjectReader
friend

Definition at line 325 of file SDMDataObject.h.

friend class SDMDataObjectStreamReader
friend

Definition at line 324 of file SDMDataObject.h.

friend class SDMDataObjectWriter
friend

Definition at line 326 of file SDMDataObject.h.

friend class SDMDataSubset
friend

Definition at line 328 of file SDMDataObject.h.

Member Data Documentation

const bool asdmbinaries::SDMDataObject::_init
staticprivate

Definition at line 1161 of file SDMDataObject.h.

bool asdmbinaries::SDMDataObject::aborted_
private

Definition at line 1204 of file SDMDataObject.h.

std::string asdmbinaries::SDMDataObject::abortReason_
private

Definition at line 1207 of file SDMDataObject.h.

unsigned long long int asdmbinaries::SDMDataObject::abortTime_
private

Definition at line 1206 of file SDMDataObject.h.

std::vector<std::string> asdmbinaries::SDMDataObject::apcs
staticprivate

Definition at line 1159 of file SDMDataObject.h.

std::vector<std::string> asdmbinaries::SDMDataObject::axes
staticprivate

Definition at line 1157 of file SDMDataObject.h.

const ByteOrder* asdmbinaries::SDMDataObject::byteOrder_
private

Definition at line 1170 of file SDMDataObject.h.

CorrelationModeMod::CorrelationMode asdmbinaries::SDMDataObject::correlationMode_
private

Definition at line 1192 of file SDMDataObject.h.

std::vector<std::string> asdmbinaries::SDMDataObject::correlationModeRefs
staticprivate

Definition at line 1156 of file SDMDataObject.h.

std::string asdmbinaries::SDMDataObject::dataOID_
private

Definition at line 1176 of file SDMDataObject.h.

DataStruct asdmbinaries::SDMDataObject::dataStruct_
private

Definition at line 1198 of file SDMDataObject.h.

std::vector<SDMDataSubset> asdmbinaries::SDMDataObject::dataSubsets_
private

Definition at line 1202 of file SDMDataObject.h.

unsigned int asdmbinaries::SDMDataObject::dimensionality_
private

Definition at line 1178 of file SDMDataObject.h.

unsigned int asdmbinaries::SDMDataObject::execBlockNum_
private

Definition at line 1184 of file SDMDataObject.h.

std::string asdmbinaries::SDMDataObject::execBlockUID_
private

Definition at line 1182 of file SDMDataObject.h.

unsigned int asdmbinaries::SDMDataObject::numAntenna_
private

Definition at line 1190 of file SDMDataObject.h.

unsigned int asdmbinaries::SDMDataObject::numTime_
private

Definition at line 1180 of file SDMDataObject.h.

ProcessorTypeMod::ProcessorType asdmbinaries::SDMDataObject::processorType_
private

Definition at line 1196 of file SDMDataObject.h.

unsigned int asdmbinaries::SDMDataObject::scanNum_
private

Definition at line 1186 of file SDMDataObject.h.

int asdmbinaries::SDMDataObject::schemaVersion_
private

Definition at line 1172 of file SDMDataObject.h.

OptionalSpectralResolutionType asdmbinaries::SDMDataObject::spectralResolutionType_
private

Definition at line 1194 of file SDMDataObject.h.

const boost::regex asdmbinaries::SDMDataObject::SPWID
staticprivate

Definition at line 1251 of file SDMDataObject.h.

long long asdmbinaries::SDMDataObject::startTime_
private

Definition at line 1174 of file SDMDataObject.h.

std::map<std::string, unsigned int> asdmbinaries::SDMDataObject::str2index_
private

Definition at line 1200 of file SDMDataObject.h.

unsigned int asdmbinaries::SDMDataObject::subscanNum_
private

Definition at line 1188 of file SDMDataObject.h.

std::string asdmbinaries::SDMDataObject::title_
private

Global header variables.

Definition at line 1168 of file SDMDataObject.h.

std::vector<std::string> asdmbinaries::SDMDataObject::types
staticprivate

Definition at line 1158 of file SDMDataObject.h.

bool asdmbinaries::SDMDataObject::valid_
private

Is the SDMDataObject actually properly filled with valid data.

Definition at line 1165 of file SDMDataObject.h.


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