casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SDMDataObject.h
Go to the documentation of this file.
1 #ifndef SDMDataObject_CLASS
2 #define SDMDataObject_CLASS
3 
4 #include <string>
5 #include <set>
6 #include <vector>
7 #include <map>
8 #include <sstream>
9 
10 #ifdef WITHOUT_ACS
11 #else
12 #include "almaEnumerations_IFC.h"
13 #endif
14 
16 
27 
28 #ifndef WITHOUT_BOOST
29 #include <boost/regex.hpp>
30 #else
31 #include <regex>
32 #endif
33 
34 #ifdef REG_BASIC
35 #undef REG_BASIC
36 #endif
37 
38 #ifdef REG_EXTENDED
39 #undef REG_EXTENDED
40 #endif
41 
42 #ifdef REG_ICASE
43 #undef REG_ICASE
44 #endif
45 
46 #ifdef REG_NOSUB
47 #undef REG_NOSUB
48 #endif
49 
50 #ifdef REG_NEWLINE
51 #undef REG_NEWLINE
52 #endif
53 
54 #ifdef REG_NOTBOL
55 #undef REG_NOTBOL
56 #endif
57 
58 #ifdef REG_NOTEOL
59 #undef REG_NOTEOL
60 #endif
61 
62 #ifdef REG_STARTEND
63 #undef REG_STARTEND
64 #endif
65 
66 #ifdef REG_NOERROR
67 #undef REG_NOERROR
68 #endif
69 
70 #ifdef REG_NOMATCH
71 #undef REG_NOMATCH
72 #endif
73 
74 #ifdef REG_BADPAT
75 #undef REG_BADPAT
76 #endif
77 
78 #ifdef REG_ECOLLATE
79 #undef REG_ECOLLATE
80 #endif
81 
82 #if defined(__APPLE__)
83 #include <machine/endian.h>
84 #else
85 #include <endian.h>
86 #endif
87 
113 namespace asdmbinaries {
114 
118  const int SCHEMAVERSION=2;
119 
120 
125 
126  public:
131 
136  SDMDataObjectException(const std::string& m);
137 
141  virtual ~SDMDataObjectException();
142 
147  std::string getMessage() const;
148 
149  protected:
150  std::string message;
151 
152  };
153 
154  inline SDMDataObjectException::SDMDataObjectException() : message ("SDMDataObjectReaderException") {}
155  inline SDMDataObjectException::SDMDataObjectException(const std::string& m) : message(m) {}
157  inline std::string SDMDataObjectException::getMessage() const {
158  return "SDMDataObjectException : " + message;
159  }
160 
170  template<class Enum, class EnumHelper>
171  class Optional {
172  private:
173  bool present_;
174  Enum literal_;
175 
176  public:
183  present_=false;
184  }
185 
194  literal_ = literal;
195  present_ = true;
196  }
197 
203  bool present() const { return present_; }
204 
213  Enum literal() const { return literal_; }
214  };
215 
222 
223 
228  class ByteOrder {
229  public:
230  static const ByteOrder* Little_Endian; /*< A unique object to represent a little endian byte order. */
231  static const ByteOrder* Big_Endian; /*< A unique object to represent a big endian byte order. */
232  static const ByteOrder* Machine_Endianity; /*< A unique object storing the endianity of the machine. */
233 
242  std::string toString() const ;
243 
244  private:
245  std::string name_;
246 
247  ByteOrder(const std::string & name);
248  virtual ~ByteOrder();
249  static const ByteOrder* machineEndianity();
250  };
251 
252  // forward declarations.
253  class SDMDataSubset;
254  class SDMDataObject;
255 
256 
257 
258  class SDMDataObjectReader;
259 
260  // SDMDataObject:: declarations
261  //
262 
325  friend class SDMDataObjectReader;
326  friend class SDMDataObjectWriter;
327  friend class HeaderParser;
328  friend class SDMDataSubset;
330 
331  public:
332 
333  // SDMDataObject::SpectralWindow:: declarations
334  //
348  friend class SDMDataObject;
349  friend class DataStruct;
350  friend class Baseband;
351  friend class HeaderParser;
352 
353  private:
354  std::vector<StokesParameterMod::StokesParameter> crossPolProducts_;
355  std::vector<StokesParameterMod::StokesParameter> sdPolProducts_;
357  unsigned int numSpectralPoint_;
358  unsigned int numBin_;
359  NetSidebandMod::NetSideband sideband_;
360  std::string strSw_;
361  std::string strImage_;
362  void strSw(const std::string& s);
363  const std::string & strSw() const;
364  void strImage(const std::string& s);
365  const std::string & strImage() const;
366 
368 
369  void owner(const SDMDataObject* o);
370 
371  public:
377  SpectralWindow();
378 
379 
383  virtual ~SpectralWindow();
384 
388  SpectralWindow(const std::vector<StokesParameterMod::StokesParameter>& crossPolProducts,
389  float scaleFactor,
390  unsigned int numSpectralPoint,
391  unsigned int numBin,
392  NetSidebandMod::NetSideband sideband);
393 
397  SpectralWindow(const std::vector<StokesParameterMod::StokesParameter>& sdPolProducts,
398  unsigned int numSpectralPoint,
399  unsigned numBin,
400  NetSidebandMod::NetSideband sideband);
401 
405  SpectralWindow(const std::vector<StokesParameterMod::StokesParameter>& crossPolProducts,
406  const std::vector<StokesParameterMod::StokesParameter>& sdPolProduct,
407  float scaleFactor,
408  unsigned int numSpectralPoint,
409  unsigned int numBin,
410  NetSidebandMod::NetSideband sideband);
411 
418  const std::vector<StokesParameterMod::StokesParameter>& crossPolProducts() const;
419  //void crossPolProducts(const vector<StokesParameter>& value);
420 
427  const std::vector<StokesParameterMod::StokesParameter>& sdPolProducts() const;
428  //void sdPolProducts(const vector<StokesParameter>& value);
429 
437  float scaleFactor() const;
438  //void scaleFactor(float value);
439 
444  unsigned int numSpectralPoint() const;
445  //void numSpectralPoint(unsigned int value);
446 
453  unsigned int numBin() const;
454  //void numBin(unsigned int value);
455 
461  NetSidebandMod::NetSideband sideband() const;
462 
463  }; // SpectralWindow::
464 
465 
466  // SDMDataObject::Baseband:: declarations
467  //
478  class Baseband {
479  friend class SDMDataObject;
480  friend class DataStruct;
481  friend class HeaderParser;
482 
483  private:
484  BasebandNameMod::BasebandName name_;
485  std::vector<SpectralWindow> spectralWindows_;
486 
488 
489  void owner(const SDMDataObject* o);
490 
491  public:
497  Baseband();
498 
502  ~Baseband();
503 
507  Baseband(BasebandNameMod::BasebandName name, const std::vector<SpectralWindow>& spectralWindows);
508 
513  BasebandNameMod::BasebandName name() const;
514  //void ref(BasebandName value);
515 
520  const std::vector<SpectralWindow>& spectralWindows() const;
521  void spectralWindows(const std::vector<SpectralWindow>& value);
522  }; // Baseband::
523 
524 
525  // SDMDataObject::BinaryPart:: declarations
526  //
544  class BinaryPart {
545  friend class DataStruct;
546  friend class SDMDataObject;
547  friend class HeaderParser;
548  friend class SDMDataObjectWriter;
549 
550  protected:
551  unsigned int size_;
552  std::vector<AxisNameMod::AxisName> axes_;
553 
555 
556  void owner(const SDMDataObject* o);
557  public:
558 
562  BinaryPart();
563 
567  virtual ~BinaryPart();
568 
572  BinaryPart( unsigned int size,
573  const std::vector<AxisNameMod::AxisName>& axes);
574 
579  virtual unsigned int size() const;
580  // virtual void size (unsigned int value);
581 
588  virtual const std::vector<AxisNameMod::AxisName>& axes() const ;
589  // virtual void axes (const vector<AxisName>& axes);
590  }; // BinaryPart::
591 
600  friend class DataStruct;
601  friend class SDMDataObject;
602  friend class HeaderParser;
603  friend class SDMDataObjectWriter;
604 
605  protected:
607 
608  public:
613 
618 
622  AutoDataBinaryPart(unsigned int size,
623  const std::vector<AxisNameMod::AxisName>& axes,
624  bool normalized);
625 
630  virtual bool normalized() const;
631 
632  }; // AutoDataBinaryPart
633 
642  friend class DataStruct;
643  friend class SDMDataObject;
644  friend class HeaderParser;
645  friend class SDMDataObjectWriter;
646 
647  protected:
648  CorrelatorTypeMod::CorrelatorType correlatorType_;
649 
650  public:
651 
656 
661 
665  ZeroLagsBinaryPart(unsigned int size,
666  const std::vector<AxisNameMod::AxisName>& axes,
667  CorrelatorTypeMod::CorrelatorType correlatorType);
668 
673  virtual CorrelatorTypeMod::CorrelatorType correlatorType() const;
674  };
675 
676  // SDMDataObject::DataStruct:: declarations
677  //
687  class DataStruct {
688  friend class SDMDataObject;
689  friend class HeaderParser;
690  friend class SDMDataObjectWriter;
691 
692  public:
698  DataStruct();
699 
703  virtual ~DataStruct();
704 
724  DataStruct(const std::vector<AtmPhaseCorrectionMod::AtmPhaseCorrection>& apc,
725  const std::vector<Baseband>& basebands,
726  const BinaryPart& flags,
727  const BinaryPart& actualTimes,
730  const BinaryPart& crossData,
732 
733 
738  const std::vector<AtmPhaseCorrectionMod::AtmPhaseCorrection>& apc() const;
739  // void apc(const vector<AtmPhaseCorrectionMod::AtmPhaseCorrection>& value);
740 
745  const std::vector<Baseband>& basebands() const;
746  // void basebands(const vector<Baseband>& value);
747 
752  const BinaryPart& flags() const;
753  // void flags(const BinaryPart& value);
754 
759  const BinaryPart& actualTimes() const;
760  // void actualTimes(const BinaryPart& value);
761 
762 
767  const BinaryPart& actualDurations() const;
768  // void actualDurations(const BinaryPart& value);
769 
770 
775  const ZeroLagsBinaryPart& zeroLags() const;
776  // void zeroLags(const BinaryPart& value);
777 
778 
783  const BinaryPart& crossData() const;
784  // void crossData(const BinaryPart& value);
785 
786 
791  const AutoDataBinaryPart& autoData() const;
792  // void autoData(const BinaryPart& value);
793 
806  void imageSPW(unsigned int ibb,
807  unsigned int ispw1,
808  unsigned int ispw2);
809 
821  const SpectralWindow* imageSPW(unsigned int ibb,
822  unsigned int ispw) const;
823 
836  void imageOfSPW(unsigned int ibb,
837  unsigned int ispw1,
838  unsigned int ispw2);
839 
840 
852  const SpectralWindow* imageOfSPW(unsigned int ibb,
853  unsigned int ispw) const;
854 
855 
856  private:
857  std::vector<AtmPhaseCorrectionMod::AtmPhaseCorrection> apc_;
858  std::vector<Baseband> basebands_;
865 
867  void owner(const SDMDataObject* o);
868 
869  std::map<std::string, std::string> imageSPW_;
870  std::map<std::string, std::string> imageOfSPW_;
871 
872  void checkCoordinate(unsigned int ibb, unsigned int ispw) const;
873  bool associatedSPW(unsigned int ibb,
874  unsigned int ispw1,
875  unsigned int ispw2);
876 
877  void divorceSPW(unsigned int ibb, unsigned int ispw) ;
878 
879  }; //DataStruct::
880 
881  SDMDataObject();
882  SDMDataObject(unsigned long long startTime,
883  const std::string& dataOID,
884  unsigned int dimensionality,
885  const std::string& execBlockUID,
886  unsigned int execBlockNum,
887  unsigned int scanNum,
888  unsigned int subscanNum,
889  unsigned int numAntenna,
890  CorrelationModeMod::CorrelationMode correlatorMode,
892 
893  SDMDataObject(unsigned long long startTime,
894  const std::string& dataOID,
895  unsigned int dimensionality,
896  unsigned int numTime,
897  const std::string& execBlockUID,
898  unsigned int execBlockNum,
899  unsigned int scanNum,
900  unsigned int subscanNum,
901  unsigned int numAntenna,
903 
908  std::string title() const;
909  void title(const std::string& value) ;
910 
915  const ByteOrder* byteOrder() const;
916 
921  unsigned long long startTime() const;
922  void startTime(unsigned long long value);
923 
929  unsigned int numTime() const;
930  void numTime(unsigned int value);
931 
936  std::string dataOID() const;
937  void dataOID(const std::string& value);
938 
939 
944  std::string execBlockUID() const;
945  void execBlockUID(const std::string& value);
946 
951  unsigned int execBlockNum() const;
952  void execBlockNum (unsigned int value );
953 
958  unsigned int scanNum() const;
959  void scanNum( unsigned int value);
960 
965  unsigned int subscanNum() const;
966  void subscanNum(int value);
967 
972  std::string projectPath() const;
973 
979  std::vector<std::string> projectPaths() const;
980 
985  unsigned int numAntenna() const;
986  void numAntenna (unsigned int value);
987 
992  CorrelationModeMod::CorrelationMode correlationMode() const;
993 
994 
1004 
1009  ProcessorTypeMod::ProcessorType processorType() const;
1010 
1011 
1018  CorrelatorTypeMod::CorrelatorType correlatorType() const;
1019 
1026  bool isTP() const ;
1027 
1034  bool isWVR() const ;
1035 
1042  bool isCorrelation() const;
1043 
1049  bool hasPackedData() const;
1050 
1055  const DataStruct& dataStruct() const;
1056  void dataStruct(const DataStruct& dataStruct);
1057 
1058 
1068  const std::vector<SDMDataSubset>& sdmDataSubsets() const;
1069 
1075  const std::vector<SDMDataSubset>& corrDataSubsets() const;
1076  void corrDataSubsets(const std::vector<SDMDataSubset>& value);
1077 
1086  const SDMDataSubset& sdmDataSubset(const std::string& projectPath) const;
1087 
1088 
1097  bool aborted() const ;
1098 
1109  unsigned long long abortTime() const ;
1110 
1111 
1112 
1123  std::string abortReason() const ;
1124 
1125 
1131  const SDMDataSubset& tpDataSubset() const;
1132  void tpDataSubset(const SDMDataSubset& value);
1133 
1138  std::string toString() const;
1139 
1144  void done();
1145 
1152  unsigned int dimensionality() const;
1153 
1154  private:
1155 
1156  static std::vector<std::string> correlationModeRefs;
1157  static std::vector<std::string> axes;
1158  static std::vector<std::string> types;
1159  static std::vector<std::string> apcs;
1160 
1161  const static bool _init;
1162  static bool init();
1163 
1164  // Is the SDMDataObject actually properly filled with valid data.
1165  bool valid_;
1166 
1167  // Global header variables.
1168  std::string title_;
1169 
1171 
1173 
1174  long long startTime_;
1175 
1176  std::string dataOID_;
1177 
1178  unsigned int dimensionality_;
1179 
1180  unsigned int numTime_;
1181 
1182  std::string execBlockUID_;
1183 
1184  unsigned int execBlockNum_;
1185 
1186  unsigned int scanNum_;
1187 
1188  unsigned int subscanNum_;
1189 
1190  unsigned int numAntenna_;
1191 
1192  CorrelationModeMod::CorrelationMode correlationMode_;
1193 
1195 
1196  ProcessorTypeMod::ProcessorType processorType_;
1197 
1199 
1200  std::map<std::string, unsigned int> str2index_;
1201 
1202  std::vector<SDMDataSubset> dataSubsets_;
1203 
1204  bool aborted_;
1205 
1206  unsigned long long int abortTime_;
1207  std::string abortReason_;
1208 
1209  void append(const SDMDataSubset& value);
1210 
1211 
1220  void dimensionality( unsigned int value );
1221 
1228  bool inTitle(const std::string& what) const;
1229 
1233  void owns();
1234 
1235 
1240  std::string toXML() ;
1241  void toXML(const BinaryPart& binaryPart, const std::string& elementName, std::ostringstream& oss) const;
1242  void toXML(const AutoDataBinaryPart& autoDataBinaryPart, const std::string& elementName, std::ostringstream& oss) const;
1243  void toXML(const ZeroLagsBinaryPart& zeroLagsBinaryPart, const std::string& elementName, std::ostringstream& oss) const;
1244  void spectralWindowsToXML(const std::vector<Baseband>& basebands, unsigned int ibb, std::ostringstream& oss) const;
1245  void basebandsToXML(std::ostringstream& oss) const;
1246  void dataStructToXML(std::ostringstream& oss) ;
1247 
1248  void updateIdImageSPW();
1249 
1250 #ifndef WITHOUT_BOOST
1251  const static boost::regex SPWID;
1252 #else
1253  const static std::regex SPWID;
1254 #endif
1255 
1256  };
1257  // SDMDataObject::
1258 
1259  // SDMDataSubset:: declarations
1260  //
1269  friend class SDMDataObject;
1270  friend class SDMDataObjectReader;
1272  friend class SDMDataObjectWriter;
1274  friend class TPSubsetHeaderParser;
1275 
1276  public:
1277 
1278  /*
1279  * An empty constructor.
1280  */
1282 
1284  unsigned long long time,
1285  unsigned long long interval,
1286  const std::vector<float>& autoData);
1287 
1288  /*
1289  * A copy constructor.
1290  */
1291  SDMDataSubset(const SDMDataSubset & sdmDataSubset);
1292 
1293  /*
1294  * Overloading =
1295  */
1296  SDMDataSubset& operator= (const SDMDataSubset& sdmDataSubset);
1297 
1298  /*
1299  * The destructor.
1300  */
1301  virtual ~SDMDataSubset();
1302 
1303  const SDMDataObject* owner() const;
1304 
1305  unsigned int integrationNum() const;
1306 
1307  unsigned int subintegrationNum() const;
1308 
1317  std::string projectPath() const;
1318 
1326  unsigned long long time() const;
1327 
1332  unsigned long long interval() const;
1333 
1334 
1339  std::string toString(unsigned int N = 10 )const ;
1340 
1341  void binAttachToXML(const std::string& name, std::ostringstream& oss);
1342  void tpBinAttachToXML(std::ostringstream& oss);
1343  void corrBinAttachToXML(std::ostringstream& oss);
1344 
1345  void toXML(std::ostringstream& oss) const;
1346 
1351  std::string toXML();
1352 
1353 
1361  unsigned long int actualDurations(const ACTUALDURATIONSTYPE* & ptr) const;
1362 
1369  uint64_t actualDurationsPosition() const;
1370 
1378  unsigned long int actualTimes(const ACTUALTIMESTYPE* & ptr) const;
1379 
1386  uint64_t actualTimesPosition() const;
1387 
1395  unsigned long int autoData(const AUTODATATYPE* & ptr) const ;
1396 
1403  uint64_t autoDataPosition() const;
1404 
1412  unsigned long int crossData(const SHORTCROSSDATATYPE* & ptr) const;
1413 
1414 
1422  unsigned long int crossData(const INTCROSSDATATYPE* & ptr) const;
1423 
1431  unsigned long int crossData(const FLOATCROSSDATATYPE* & ptr) const;
1432 
1439  uint64_t crossDataPosition() const;
1440 
1446  PrimitiveDataTypeMod::PrimitiveDataType crossDataType() const;
1447 
1448  void crossDataType(PrimitiveDataTypeMod::PrimitiveDataType value);
1449 
1457  unsigned long int flags(const FLAGSTYPE* &ptr) const;
1458 
1465  uint64_t flagsPosition() const;
1466 
1474  unsigned long int zeroLags(const ZEROLAGSTYPE* & ptr) const;
1475 
1482  uint64_t zeroLagsPosition() const;
1483 
1488  bool aborted() const ;
1489 
1495  unsigned long long abortTime() const;
1496 
1502  std::string abortReason() const;
1503 
1504 
1505 
1506  private:
1508  unsigned int integrationNum_;
1509  unsigned int subintegrationNum_;
1510  CorrelationModeMod::CorrelationMode ref_;
1511  unsigned long long time_;
1512  unsigned long long interval_;
1513  std::string dataStruct_;
1514  std::string flagsREF_;
1515  std::string actualTimesREF_;
1516  std::string actualDurationsREF_;
1517  std::string zeroLagsREF_;
1518  std::string crossDataREF_;
1519  PrimitiveDataTypeMod::PrimitiveDataType crossDataType_;
1520  std::string autoDataREF_;
1521 
1523  unsigned long int nActualTimes_;
1526  unsigned long int nActualDurations_;
1529  unsigned long int nZeroLags_;
1532  unsigned long int nFlags_;
1533  uint64_t flagsPosition_;
1537  unsigned long int nCrossData_;
1540  unsigned long int nAutoData_;
1542 
1543  std::string xsiType() const;
1544 
1545  bool aborted_;
1546  unsigned long long int abortTime_;
1547  std::string abortReason_;
1548 
1549  };
1550  // SDMDataSubset:: declarations
1551 
1552 
1553  // Utils:: declarations
1554  //
1555  class Utils {
1556  public:
1557  static void invalidCall(const std::string & methodName, const SDMDataObject* sdmDataObject);
1558  static std::string quote(const std::string& s);
1559  static std::string quote(bool b);
1560  static std::string quote(int i);
1561  static std::string quote(unsigned int i);
1562  static std::string quote(long long l);
1563  static std::string quote(float f);
1564  static std::string quote(const std::set<std::string>& s);
1565  static std::string quote(const std::vector<std::string>& s);
1566  template<class Enum, class EnumHelper> static std::string quote(Enum l) {
1567  std::ostringstream oss;
1568  oss << "\"";
1569  oss << EnumHelper::name(l);
1570  oss << "\"";
1571  return oss.str();
1572  }
1573 
1574  template<class Enum, class EnumHelper> static std::string quote(const std::vector<Enum>& v_l) {
1575  std::ostringstream oss;
1576  oss << "\"";
1577 
1578  if (v_l.size() > 0)
1579  oss << EnumHelper::name(v_l.at(0));
1580 
1581  for (unsigned int i = 1; i < v_l.size(); i++)
1582  oss << " " << EnumHelper::name(v_l.at(i));
1583  oss << "\"";
1584  return oss.str();
1585  }
1586 
1587  template<class Enum, class EnumHelper> static std::string toString(Enum l) {
1588  std::ostringstream oss;
1589  oss << EnumHelper::name(l);
1590  return oss.str();
1591  }
1592 
1593  template<class Enum, class EnumHelper> static std::string toString(const std::vector<Enum>& v_l) {
1594  std::ostringstream oss;
1595 
1596  if (v_l.size() > 0)
1597  oss << EnumHelper::name(v_l.at(0));
1598 
1599  for (unsigned int i = 1; i < v_l.size(); i++)
1600  oss << " " << EnumHelper::name(v_l.at(i));
1601  return oss.str();
1602  }
1603 
1607  template<class Enum, class EnumHelper> static std::vector<Enum> enumvec(const std::string& strliterals) {
1608  std::vector<Enum> result;
1609 
1610  std::string strliteral;
1611  std::istringstream iss(strliterals);
1612 
1613  while (iss >> strliteral)
1614  result.push_back(EnumHelper::literal(strliteral));
1615 
1616  return result;
1617  }
1618 
1619 
1620  static void toXML(const std::string& elementName, int value, std::ostringstream& oss);
1621  static void toXML(const std::string& elementName, unsigned int value, std::ostringstream& oss);
1622  static void toXML(const std::string& elementName, long long value, std::ostringstream& oss);
1623  static void toXML(const std::string& elementName, unsigned long long value, std::ostringstream& oss);
1624  static void oXML(const std::string& elementName, std::ostringstream& oss);
1625  static void cXML(const std::string& elementName, std::ostringstream& oss);
1626 
1635  template<class Enum, class EnumHelper> static void toXML(const std::string& elementName, Enum value, std::ostringstream& oss) {
1636  oss << "<" << elementName << ">" << EnumHelper::name(value) << "</" << elementName << ">" << std::endl;
1637  }
1638 
1639 #define QUOTE Utils::quote
1640 #define TOSTRING Utils::toString
1641 #define TOXML Utils::toXML
1642 #define OXML Utils::oXML
1643 #define CXML Utils::cXML
1644  };
1645 }
1646 #endif // SDMDataObject_CLASS
std::string toXML()
Returns an XML representation of this SDMDataSubset.
unsigned int numBin() const
void numSpectralPoint(unsigned int value);
SDMDataObject:: declarations.
std::string xsiType() const
unsigned long long interval_
std::map< std::string, unsigned int > str2index_
void corrBinAttachToXML(std::ostringstream &oss)
uint64_t actualTimesPosition() const
Returns the position (0-based, relative to the beginning of the file) of this part when it has been r...
float FLOATCROSSDATATYPE
Type of cross data when those are encoded as 32bits float.
const std::string & strSw() const
const ZeroLagsBinaryPart & zeroLags() const
void actualDurations(const BinaryPart&amp; value);
static void invalidCall(const std::string &methodName, const SDMDataObject *sdmDataObject)
std::string abortReason() const
Returns the reason why the [sub]integration was aborted.
static std::string quote(Enum l)
static const ByteOrder * Little_Endian
void owner(const SDMDataObject *o)
virtual unsigned int size() const
Returns the size of a binary attachment as a number of values (e.g.
std::string projectPath() const
Returns the project path of this SDMDataSubset.
const std::vector< StokesParameterMod::StokesParameter > & crossPolProducts() const
Returns the vector of polarization products (for the interferometric data).
CorrelatorTypeMod::CorrelatorType correlatorType_
int16_t SHORTCROSSDATATYPE
Type of cross data when those are encoded as 16bits unsigned integers.
static std::vector< std::string > apcs
static std::string toString(const std::vector< Enum > &v_l)
uint64_t autoDataPosition() const
Returns the position (0-based, relative to the beginning of the file) of this part when it has been r...
static const ByteOrder * machineEndianity()
unsigned long int nAutoData_
void spectralWindowsToXML(const std::vector< Baseband > &basebands, unsigned int ibb, std::ostringstream &oss) const
bool associatedSPW(unsigned int ibb, unsigned int ispw1, unsigned int ispw2)
const std::vector< SDMDataSubset > & corrDataSubsets() const
Returns the binary data as a sequence of integrations.
float scaleFactor() const
void sdPolProducts(const vector&lt;StokesParameter&gt;&amp; value);
SDMDataObject::Baseband:: declarations.
CorrelationModeMod::CorrelationMode correlationMode_
Optional< SpectralResolutionTypeMod::SpectralResolutionType, CSpectralResolutionType > OptionalSpectralResolutionType
A typedef definition for an optional spectral resolution type.
std::string getMessage() const
Returns the message associated to this exception.
std::string title() const
Returns the title of the SDMDataObject.
Baseband()
An empty constructor.
unsigned int subintegrationNum() const
bool isTP() const
Returns true if the data are total power data and false otherwise.
const std::vector< SpectralWindow > & spectralWindows() const
void ref(BasebandName value);
unsigned long long abortTime() const
Returns the time, as an unsigned long long, at which the observation has been aborted.
std::string toString() const
Returns a string representation of this.
unsigned long int nZeroLags_
void checkCoordinate(unsigned int ibb, unsigned int ispw) const
void basebandsToXML(std::ostringstream &oss) const
const AUTODATATYPE * autoData_
unsigned int integrationNum() const
unsigned long long int abortTime_
A class to embed optional information.
static const ByteOrder * Big_Endian
unsigned long long time_
unsigned long int flags(const FLAGSTYPE *&ptr) const
Set ptr to the adress of the array of flags and returns the number of flags.
unsigned long long abortTime() const
Returns the time when the [sub]integration has been declared aborted.
const ACTUALTIMESTYPE * actualTimes_
std::vector< StokesParameterMod::StokesParameter > crossPolProducts_
static std::string quote(const std::vector< Enum > &v_l)
OptionalSpectralResolutionType spectralResolutionType() const
Returns the spectral resolution.
unsigned int subscanNum() const
Returns the number of the subscan.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
Optional(Enum literal)
The full constructor.
void done()
Makes this SDMDataObject unusable.
unsigned long long interval() const
Returns the duration of the subscan in the case of total power data.
float AUTODATATYPE
Type of auto data.
unsigned int numTime() const
Returns the number of (sub) integrations.
unsigned long long time() const
Returns the midpoint of :
SDMDataSubset:: declarations.
A general class to write MIME messages containing ALMA binary data.
unsigned long int autoData(const AUTODATATYPE *&ptr) const
Set ptr to the adress of the array of AutoData and returns the number of AutoData.
static void toXML(const std::string &elementName, Enum value, std::ostringstream &oss)
A generic utility to XML&#39;ize a literal as the content of an XML element.
Optional()
The empty constructor.
std::vector< StokesParameterMod::StokesParameter > sdPolProducts_
std::vector< SpectralWindow > spectralWindows_
const ByteOrder * byteOrder_
NetSidebandMod::NetSideband sideband_
static void oXML(const std::string &elementName, std::ostringstream &oss)
const std::vector< SDMDataSubset > & sdmDataSubsets() const
Return all the SDMDataSubsets contained in this.
int64_t ACTUALTIMESTYPE
Type of actual times.
bool valid_
Is the SDMDataObject actually properly filled with valid data.
A subclass of binaryPart to describe the autodata.
unsigned int scanNum() const
Returns the number of the scan.
void tpBinAttachToXML(std::ostringstream &oss)
unsigned int numAntenna() const
Returns the number of antenna.
std::string projectPath() const
Returns the project path.
SDMDataObject::SpectralWindow:: declarations.
const BinaryPart & actualDurations() const
void actualTimes(const BinaryPart&amp; value);
const std::vector< AtmPhaseCorrectionMod::AtmPhaseCorrection > & apc() const
Returns the radiometric atmospheric phase correction codes.
void append(const SDMDataSubset &value)
int32_t INTCROSSDATATYPE
Type of cross data when those are encoded as 32bits unsigned integers.
A subclass of binaryPart to describe the zeroLags.
std::vector< AtmPhaseCorrectionMod::AtmPhaseCorrection > apc_
const BinaryPart & flags() const
void basebands(const vector&lt;Baseband&gt;&amp; value);
OptionalSpectralResolutionType spectralResolutionType_
SDMDataSubset(SDMDataObject *owner=0)
const ByteOrder * byteOrder() const
Returns the byte order of the binary parts.
unsigned long int zeroLags(const ZEROLAGSTYPE *&ptr) const
Set ptr to the adress of the array of ZeroLags and returns the number of ZeroLags.
bool present() const
Test of presence.
static std::string toString(Enum l)
const std::string & strImage() const
A class to represent an exception thrown during an access to an SDMDataObject.
void binAttachToXML(const std::string &name, std::ostringstream &oss)
Enum literal() const
Returns the optional value.
uint64_t crossDataPosition() const
Returns the position (0-based, relative to the beginning of the file) of this part when it has been r...
unsigned int dimensionality() const
Dimensionality of the binary content.
std::string toString(unsigned int N=10) const
Returns a description of this SDMDataSubset.
bool aborted() const
Returns true if the observation has been aborted.
SDMDataSubset & operator=(const SDMDataSubset &sdmDataSubset)
static std::string quote(const std::string &s)
unsigned long int nCrossData_
static const ByteOrder * Machine_Endianity
unsigned long int nActualTimes_
std::string toXML()
Returns an XML representation of the global header of this SDMDataObject.
void owner(const SDMDataObject *o)
static const boost::regex SPWID
unsigned long int actualTimes(const ACTUALTIMESTYPE *&ptr) const
Set ptr to the adress of the array of ActualTimes and returns the number of ActualTimes.
uint32_t FLAGSTYPE
Type of flags.
PrimitiveDataTypeMod::PrimitiveDataType crossDataType_
std::string execBlockUID() const
Returns the UID of the ExecBlock.
virtual CorrelatorTypeMod::CorrelatorType correlatorType() const
Returns the correlator type.
A class to represent byte order information.
const ZEROLAGSTYPE * zeroLags_
static void cXML(const std::string &elementName, std::ostringstream &oss)
class CorrSubsetHeaderParser
const std::vector< StokesParameterMod::StokesParameter > & sdPolProducts() const
void crossPolProducts(const vector&lt;StokesParameter&gt;&amp; value);
const SDMDataSubset & tpDataSubset() const
Returns the binary data for a subscan.
virtual ~SDMDataObjectException()
The destructor.
std::string toString() const
Returns a string representation of the global header of this SDMDataObject.
static std::vector< std::string > axes
ByteOrder(const std::string &name)
const SHORTCROSSDATATYPE * shortCrossData_
ProcessorTypeMod::ProcessorType processorType_
std::vector< AxisNameMod::AxisName > axes_
uint64_t actualDurationsPosition() const
Returns the position (0-based, relative to the beginning of the file) of this part when it has been r...
void owner(const SDMDataObject *o)
bool isWVR() const
Returns true if the data are wvr data and false otherwise.
bool aborted() const
Returns true if and only if this corresponds to an aborted [sub]integration.
unsigned int numSpectralPoint() const
void scaleFactor(float value);
PrimitiveDataTypeMod::PrimitiveDataType crossDataType() const
Return the type of cross data values.
BasebandNameMod::BasebandName name() const
Returns the name of the baseband.
void dataStructToXML(std::ostringstream &oss)
const SDMDataSubset & sdmDataSubset(const std::string &projectPath) const
Returns a reference to a SDMDataSubset given its projectPath.
std::string dataOID() const
Returns the dataOID.
void divorceSPW(unsigned int ibb, unsigned int ispw)
bool isCorrelation() const
Returns true if the data are correlator data and false otherwise.
A class to read a MIME message containing ALMA binary data and provide a view on these binary data th...
uInt N
Axis number.
Definition: ArrayAccessor.h:60
NetSidebandMod::NetSideband sideband() const
void numBin(unsigned int value);
unsigned int execBlockNum() const
Returns the number of the ExecBlock.
const AutoDataBinaryPart & autoData() const
void crossData(const BinaryPart&amp; value);
void imageOfSPW(unsigned int ibb, unsigned int ispw1, unsigned int ispw2)
Defines an association &quot;spw1 is image of spw2&quot; between two spectral windows spw1 and spw2...
void imageSPW(unsigned int ibb, unsigned int ispw1, unsigned int ispw2)
void autoData(const BinaryPart&amp; value);
TableExprNode regex(const TableExprNode &node)
Functions for regular expression matching and pattern matching.
Definition: ExprNode.h:1440
const FLOATCROSSDATATYPE * floatCrossData_
void owner(const SDMDataObject *o)
const int SCHEMAVERSION
The XML schema version of the XML instances that those classes claim to be compatible with...
std::map< std::string, std::string > imageSPW_
const ACTUALDURATIONSTYPE * actualDurations_
std::string abortReason() const
Returns the reason, as a string, why the observation has been aborted.
float ZEROLAGSTYPE
Type of zero lags.
virtual ~BinaryPart()
The destructor.
bool hasPackedData() const
hasPackedData returns true if all the integrations are grouped in one subset for all the timestamps a...
static std::vector< std::string > correlationModeRefs
const BinaryPart & actualTimes() const
void flags(const BinaryPart&amp; value);
CorrelationModeMod::CorrelationMode correlationMode() const
Returns the correlation mode.
unsigned long long int abortTime_
BinaryPart()
An empty constructor.
std::vector< std::string > projectPaths() const
Returns the projects paths of all the data subsets present in this SDMDataObject. ...
static std::vector< Enum > enumvec(const std::string &strliterals)
A generic utility to return a vector of &lt;Enum&gt; out of a string of &lt;Enum&gt; literals separated by space ...
SDMDataObjectException()
An empty contructor.
const SDMDataObject * owner() const
BasebandNameMod::BasebandName name_
std::map< std::string, std::string > imageOfSPW_
CorrelationModeMod::CorrelationMode ref_
SDMDataObject::BinaryPart:: declarations.
const DataStruct & dataStruct() const
Returns the structure of the data.
unsigned long int actualDurations(const ACTUALDURATIONSTYPE *&ptr) const
Set ptr to the adress of the array of ActualDurations and returns the number of actualDurations.
bool inTitle(const std::string &what) const
Returns true is the string passed as an argument is found in the title of this.
std::vector< SDMDataSubset > dataSubsets_
DataStruct()
An empty constructor.
static std::vector< std::string > types
const BinaryPart & crossData() const
void zeroLags(const BinaryPart&amp; value);
void owns()
Declares itself as the owner of all its parts.
const std::vector< Baseband > & basebands() const
void apc(const vector&lt;AtmPhaseCorrectionMod::AtmPhaseCorrection&gt;&amp; value);
uint64_t zeroLagsPosition() const
Returns the position (0-based, relative to the beginning of the file) of this part when it has been r...
CorrelatorTypeMod::CorrelatorType correlatorType() const
Returns the correlator type.
virtual const std::vector< AxisNameMod::AxisName > & axes() const
virtual void size (unsigned int value);
uint64_t flagsPosition() const
Returns the position (0-based, relative to the beginning of the file) of this part when it has been r...
virtual ~SpectralWindow()
The destructor.
unsigned long int crossData(const SHORTCROSSDATATYPE *&ptr) const
Set ptr to the adress of the array of short int CrossData and returns the number of short int CrossDa...
const INTCROSSDATATYPE * longCrossData_
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
unsigned long long startTime() const
Returns the start time.
std::string title_
Global header variables.
SDMDataObject::DataStruct:: declarations.
virtual bool normalized() const
Returns true (resp.false) if auto data are normalized (resp.
ProcessorTypeMod::ProcessorType processorType() const
Returns the processor type.
virtual ~DataStruct()
The destructor.
int64_t ACTUALDURATIONSTYPE
Type of actual durations.
static void toXML(const std::string &elementName, int value, std::ostringstream &oss)
unsigned long int nActualDurations_