casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DataDescriptionsSet.h
Go to the documentation of this file.
1 #if !defined(_DATADESCRIPTIONSSET_H)
2 
3 #include <vector>
4 #include <set>
5 #include <map>
6 
10 
11 #include <alma/ASDM/ASDMEntities.h>
13 //#include <alma/ASDM/DataBlock.h>
14 
15 namespace sdmbin {
16 
17  struct DataDescParams {
18  unsigned int ddIdx;
22  unsigned int numChan;
23  unsigned int numCorr;
24  unsigned int numBin;
25  };
26 
27 
32  {
33  public:
34 
36 
57  DataDescriptionsSet( asdm::ASDM* const datasetPtr, std::vector<asdm::Tag> v_switchCycleId,
58  std::vector<asdm::Tag> v_dataDescriptionId,
59  CorrelationModeMod::CorrelationMode corrMode, std::vector<AtmPhaseCorrectionMod::AtmPhaseCorrection> atmPhaseCodes);
60 
80  DataDescriptionsSet( std::vector<int> v_switchCycleId,
81  std::vector<int> v_dataDescriptionId,
82  CorrelationModeMod::CorrelationMode corrMode, std::vector<AtmPhaseCorrectionMod::AtmPhaseCorrection> atmPhaseCodes);
83 
86 
90  virtual ~DataDescriptionsSet();
91 
97  BasebandNameMod::BasebandName getBasebandName(unsigned int ndd) ;
98 
104  unsigned int getBasebandIndex(unsigned int ndd) ;
105 
109  unsigned int numBaseband();
110 
117  unsigned int numBin(unsigned int ndd) ;
118 
132  unsigned int numPol(unsigned int ndd) ;
133 
144  unsigned int numSdPol(unsigned int ndd) ;
145 
152  unsigned int numChan(unsigned int ndd) ;
153 
159  asdm::Tag getSpwId(unsigned int ndd) ;
160 
167  asdm::Frequency totBandwidth(unsigned int ndd) ;
168 
177  unsigned int numApc();
178 
189  Enum<AtmPhaseCorrectionMod::AtmPhaseCorrection> atmPhaseCorrection(unsigned int atmPhaseCorrectionIndex);
190 
196  unsigned int atmPhaseCorrectionIndex(AtmPhaseCorrectionMod::AtmPhaseCorrection apc) ;
197 
207  int numAutoData(unsigned int ndd) ;
208 
215  unsigned int numCrossData(unsigned int ndd) ;
216 
224  unsigned int sumMetaDataIndex();
225 
232  unsigned int metaDataIndex(unsigned int ndd) ;
233 
247 /* int getBitSize(); */
248 
255  CorrelationModeMod::CorrelationMode getCorrelationMode();
256 
260  unsigned int getNumDataDescription();
261 
267  unsigned int getNumChan(unsigned int ndd) ;
268 
283  unsigned int getNumPol(unsigned int bbIndex) ;
284 
297  unsigned int getNumPol(BasebandNameMod::BasebandName bbName) ;
298 
310  unsigned int getNumSdPol(unsigned int bbIndex) ;
311 
322  unsigned int getNumSdPol(BasebandNameMod::BasebandName bbName) ;
323 
332  unsigned int getNdd(unsigned int bbIndex, unsigned int j) ;
333 
341  unsigned int getNdd(BasebandNameMod::BasebandName bbName, unsigned int j) ;
342 
348  unsigned int getNumSpw(unsigned int bbIndex) ;
349 
355  unsigned int getNumSpw(BasebandNameMod::BasebandName bbName);
356 
362  unsigned int getDataDescriptionIndex( asdm::Tag dataDescriptionId) ;
363 
389  unsigned long getAutoSize();
390 
403  unsigned long getCrossSize();
404 
412  unsigned long getNumAutoData();
413 
418  unsigned long getNumCrossData();
419 
430  unsigned long getNumAutoData(asdm::Tag autoDataDescriptionId) ;
431 
432 
440  unsigned long getNumCrossData(asdm::Tag crossDataDescriptionId) ;
441 
450  asdm::Tag getAutoDataDescriptionId(asdm::Tag crossDataDescriptionId) ;
451 
456  std::vector<asdm::Tag> getAutoDataDescriptionId();
457 
462  std::vector<asdm::Tag> getCrossDataDescriptionId();
463 
464 
465  protected:
466  std::vector<asdm::Tag> v_dataDescriptionIdArray_;
467 
468  Enum<CorrelationModeMod::CorrelationMode> e_cm_;
469  CorrelationModeMod::CorrelationMode correlationMode_;
470 
471  EnumSet<AtmPhaseCorrectionMod::AtmPhaseCorrection> es_apc_;
472  std::vector<AtmPhaseCorrectionMod::AtmPhaseCorrection> v_atmPhaseCorrection_;
473 
474  std::vector<unsigned int> v_numPol_;
475  std::vector<asdm::Tag> v_spwId_;
476  std::vector<unsigned int> v_numChan_;
477  std::vector<BasebandNameMod::BasebandName> v_basebandName_;
478  std::vector<std::vector<int> > vv_nsp_;
479  std::map<BasebandNameMod::BasebandName,std::vector<DataDescParams> > m_bn_v_ddp_;
480  std::map<asdm::Tag,BasebandNameMod::BasebandName> m_ddid_bbn_;
481  unsigned int numApc_;
482  unsigned int numDataDescription_;
483 
484  unsigned int sumMetaDataIndex_;
485  unsigned long sumAutoSize_;
486  unsigned long sumCrossSize_;
487 
488  std::vector<unsigned int> v_metaDataIndex_;
489  std::vector<unsigned long> v_cumulAutoSize_;
490  std::vector<unsigned long> v_cumulCrossSize_;
491  std::vector<unsigned long> v_numAutoData_;
492  std::vector<unsigned long> v_numCrossData_;
493  std::vector<unsigned long> v_autoSize_;
494  std::vector<unsigned long> v_crossSize_;
495 
496 
497  std::vector<asdm::Tag> v_crossDataDescriptionId_;
498  std::vector<asdm::Tag> v_autoDataDescriptionId_;
499  std::vector<bool> v_pairDataDescriptionId_;
500 
501 
502  std::vector<BasebandNameMod::BasebandName> v_basebandSet_;
503  EnumSet<BasebandNameMod::BasebandName> e_basebandSet_;
504 
505  std::vector<unsigned int> v_numSpwPerBb_;
506 
507  private:
508 
509  void size(); // Method used by the constructor
510  void metaDataIndex(); // Method used by the constructor
511 
512  void mapScToBaseband(); // Method to map vectors of switchCycles to the basebandName.
513  };
514 
515  inline unsigned int DataDescriptionsSet::numBin(unsigned int ndd) { // throw(Error){
516  // if(ndd>=v_basebandName_.size())
517  // Error(SERIOUS,"The dataDescription index must be smaller than %d",
518  // v_basebandName_.size());
519  return v_numBin_[ndd];
520  }
521 
522 }
523 #define _DATADESCRIPTIONSSET_H
524 #endif
std::vector< unsigned long > v_numCrossData_
Number of cross-correlations per antenna pair (size numDataDesc_)
std::vector< unsigned long > v_autoSize_
Size, in nb PDT values, for every dataDesc (size numDataDesc_)
unsigned long getNumCrossData()
Number of cross-correlations produced by one non-zero baseline for the set of dataDescriptions.
std::vector< bool > v_pairDataDescriptionId_
true if crossDataDecsritionId assoc to autoDataDecsritionId (size numDataDesc_)
std::vector< asdm::Tag > v_spwId_
sequence of spectral window identifiers (size numDataDesc_)
std::map< BasebandNameMod::BasebandName, std::vector< DataDescParams > > m_bn_v_ddp_
The sequence of dataDescParams in the different basebands.
std::vector< asdm::Tag > getCrossDataDescriptionId()
Get the array of dataDescriptionId identifiers for the cross-correlations.
std::vector< unsigned long > v_numAutoData_
Number of auto-correlations per antenna (size numDataDesc_)
EnumSet< BasebandNameMod::BasebandName > e_basebandSet_
Set of baseband names.
std::vector< unsigned long > v_cumulCrossSize_
Number of bytes to skip for every dataDesc (size numDataDesc_)
unsigned int numBaseband()
Accessor to the number of basebands.
std::vector< int > v_numBin_
unsigned int numChan(unsigned int ndd)
Accessor to the number of frequency channels of a given dataDescription.
The ASDM class is the container for all tables.
Definition: ASDM.h:273
std::vector< asdm::Tag > v_crossDataDescriptionId_
Vector of dataDecsritionId for the cross-correlations (size numDataDesc_)
unsigned int numApc_
APC axis size (can take the value 1 or 2 only)
unsigned int atmPhaseCorrectionIndex(AtmPhaseCorrectionMod::AtmPhaseCorrection apc)
Get the index position along the apc axis.
std::vector< unsigned int > v_numChan_
sequence of nb of chan. i.e. spectral points (size numDataDesc_)
unsigned int numCrossData(unsigned int ndd)
Provide the number of cross-correlations for a given dataDescription.
unsigned int getNumChan(unsigned int ndd)
Get the number of frequency channels for a given dataDescription.
unsigned int numApc()
Size of the apc axis (can be only 1 or 2)
unsigned int getNumPol(unsigned int bbIndex)
Get the number of Polarization Products given a baseband.
std::vector< unsigned int > v_numSpwPerBb_
Number of spectral windows in every baseband.
unsigned int getDataDescriptionIndex(asdm::Tag dataDescriptionId)
Get the dataDescription index given a dataDescriptionId identifier.
BasebandNameMod::BasebandName getBasebandName(unsigned int ndd)
Get the baseband name of a given dataDescription.
unsigned int getNdd(unsigned int bbIndex, unsigned int j)
Get the index of a dataDescription given its index in its parent baseband.
unsigned long sumCrossSize_
Sum of the elements of the vector v_crossSize_.
virtual ~DataDescriptionsSet()
Destructor.
unsigned int numSdPol(unsigned int ndd)
Accessor to the number of polarization cross-products of a given dataDescription. ...
EnumSet< AtmPhaseCorrectionMod::AtmPhaseCorrection > es_apc_
Atmospheric Phase Correction set.
void mapScToBaseband()
SwitchCyclesList defines the abstract base type of a hierarchy.
Definition of the first level in the tree hierarchy: set of spectro-polarization descriptions, basebands.
std::vector< unsigned long > v_cumulAutoSize_
Number of bytes to skip for every dataDesc (size numDataDesc_)
asdm::Frequency totBandwidth(unsigned int ndd)
Accessor to the total frequency bandwidth of a given dataDescription.
Definition of the root of the tree hierarchy.
std::vector< unsigned long > v_crossSize_
Size, in nb PDT values, for every dataDesc (size numDataDesc_)
CorrelationModeMod::CorrelationMode correlationMode_
Correlation mode.
asdm::Tag getSpwId(unsigned int ndd)
Accessor to get the spwtral window identifier of a given dataDescription.
std::map< asdm::Tag, BasebandNameMod::BasebandName > m_ddid_bbn_
Association between the dataDescriptionId and the baseband name.
Enum< CorrelationModeMod::CorrelationMode > e_cm_
Type-safe correlation mode.
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
unsigned int getNumSpw(unsigned int bbIndex)
Get the number of Spectral Windows in a given baseband identified by its index.
int numAutoData(unsigned int ndd)
Provide the number of auto-correlations for a given dataDescription.
unsigned long sumAutoSize_
Sum of the elements of the vector v_autoSize_.
unsigned int numBin(unsigned int ndd)
Accessor to the number of steps for the baseband of a given dataDescription.
unsigned long getAutoSize()
Get the size of the block of data for the auto-correlations originating from one antenna.
std::vector< asdm::Tag > v_autoDataDescriptionId_
Vector of dataDecsritionId for the auto-correlations (size &lt;= numDataDesc_)
unsigned int sumMetaDataIndex()
Provide the number of switchCycle phases cumulated over all the basebands in the configuration.
std::vector< unsigned int > v_metaDataIndex_
Indices for positions for every dataDesc (size numDataDesc_)
std::vector< asdm::Tag > getAutoDataDescriptionId()
Get the array of dataDescriptionId identifiers for the cross-correlations.
std::vector< unsigned int > v_numPol_
number of cross-products (size numDataDesc_)
unsigned long getCrossSize()
Get the size of the block of cross-correlation data for the ensemble of spectral windows and a single...
unsigned long getNumAutoData()
Number of auto-correlations produce for one antenna.
unsigned int numPol(unsigned int ndd)
Accessor to the number of polarization products of a given dataDescription.
std::vector< BasebandNameMod::BasebandName > v_basebandSet_
Sequence of baseband names.
std::vector< std::vector< int > > vv_nsp_
Nb of chan. per dataDescription (size numBaseband) vectors.
unsigned int getNumDataDescription()
Get the number of dataDescription.
unsigned int numDataDescription_
Explicit number of dataDescriptionId.
std::vector< AtmPhaseCorrectionMod::AtmPhaseCorrection > v_atmPhaseCorrection_
sequence of the Atmospheric Phase Correction values along the apc axis
std::vector< asdm::Tag > v_dataDescriptionIdArray_
the input array of dataDescription identifiers
unsigned int getBasebandIndex(unsigned int ndd)
Get the baseband number of a given dataDescription.
The Frequency class implements a quantity of frequency in hertz.
Definition: Frequency.h:53
Enum< AtmPhaseCorrectionMod::AtmPhaseCorrection > atmPhaseCorrection(unsigned int atmPhaseCorrectionIndex)
Accessor to the atmospherePhaseCorrection.
unsigned int getNumSdPol(unsigned int bbIndex)
Get the number of Polarization Products in the case of zero-baselines given a baseband.
CorrelationModeMod::CorrelationMode getCorrelationMode()
Get the bitSize (actually the number of bytes, 2 or 4) used for the visibilities. ...
std::vector< BasebandNameMod::BasebandName > v_basebandName_
(size numDataDesc_), baseband name for every spectral window.
unsigned int sumMetaDataIndex_
Sum of the elements of the vector v_metaDataIndex_.