Line data Source code
1 : #if !defined(_DATADESCRIPTIONSSET_H) 2 : 3 : #include <vector> 4 : #include <set> 5 : #include <map> 6 : 7 : #include <alma/Enumtcl/AtmPhaseCorrection.h> 8 : #include <alma/Enumtcl/CorrelationMode.h> 9 : #include <alma/Enumtcl/SidebandProcessingMode.h> 10 : 11 : #include <alma/ASDM/ASDMEntities.h> 12 : #include <alma/ASDMBinaries/SwitchCyclesList.h> 13 : //#include "DataBlock.h" 14 : 15 : namespace sdmbin { 16 : 17 : struct DataDescParams { 18 : unsigned int ddIdx; 19 : asdm::Tag scId; 20 : asdm::Tag spwId; 21 : asdm::Tag polId; 22 : unsigned int numChan; 23 : unsigned int numCorr; 24 : unsigned int numBin; 25 : }; 26 : 27 : 28 : /** Definition of the first level in the tree hierarchy: set of spectro-polarization descriptions, 29 : * basebands. 30 : */ 31 : class DataDescriptionsSet : public SwitchCyclesList 32 : { 33 : public: 34 : 35 : DataDescriptionsSet(); 36 : 37 : /** Define the first level in the tree hierarchy. 38 : * @pre the pointer to the SDM dataset is already known 39 : * @param v_switchCycleId a sequence of switchCycle identifiers, one per data description. It is not a set 40 : * @param v_dataDescriptionId the sequence of DataDescription identifiers. it is an ordered set 41 : * @param corrMode the correlation mode used: 42 : * - CROSS_ONLY if, in the data products, there are only visibilities (i.e. no auto-correlation data) 43 : * - AUTO-ONLY if, in the data products, there are only auto-correlations (i.e. no visibilities data) 44 : * - CROSS_AND_AUTO if , in the data products, there are both visibilities and auto-correlations 45 : * @param atmPhaseCodes the vector of atmospheric phase correction enumerators used: 46 : * - AP_UNCORRECTED 47 : * - AP_CORRECTED 48 : * - AP_MIXED 49 : * @post the first level of the tree hierarchy being defined 50 : * this class can be derived to set the second level (class BaselinesSet). 51 : * @note Use the alternate constructor 52 : * DataDescriptionsSet( SwitchCyclesList& , vector<int> , int , int , int); 53 : * if the data description identifiers are typed int. 54 : * @note Use the alternate constructor if the data description identifiers are 55 : * typed int. 56 : */ 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 : 61 : /** Define the first level in the tree hierarchy. 62 : * @pre the pointer to the SDM dataset is already known 63 : * @param datasetPtr the SDM dataset 64 : * @param switchCyclesList a switchCycle object 65 : * @param v_dataDescriptionIdArray the set of DataDescription identifiers 66 : * @param corrMode the correlation mode used: 67 : * - CROSS_ONLY 68 : * - AUTO-ONLY 69 : * - CROSS_AND_AUTO 70 : * @param atmPhaseCodes the vector of atmospheric phase correction enumerators used: 71 : * - AP_UNCORRECTED 72 : * - AP_CORRECTED 73 : * - AP_MIXED 74 : * @param bitSize (MAY BECOME OBSOLETE in the future since bitSize is now imposed to be the same for all spectral windows) 75 : * @post the first level of the tree hierarchy is now defined 76 : * @note Use the alternate constructor 77 : * DataDescriptionsSet( SwitchCyclesList& , vector<Tag> , int , int , int); 78 : * if the data description identifiers are with the asdm type Tag. 79 : */ 80 : DataDescriptionsSet( std::vector<int> v_switchCycleId, 81 : std::vector<int> v_dataDescriptionId, 82 : CorrelationModeMod::CorrelationMode corrMode, std::vector<AtmPhaseCorrectionMod::AtmPhaseCorrection> atmPhaseCodes); 83 : 84 : /** Copy constructor */ 85 : DataDescriptionsSet(const DataDescriptionsSet &); 86 : 87 : /** Destructor 88 : * @note use the default implementation 89 : */ 90 : virtual ~DataDescriptionsSet(); 91 : 92 : /** Get the baseband name of a given dataDescription 93 : * @param ndd The index (zero-based) of the dataDescription identifier 94 : * @exception ndd has an illegal value or is too large for the number of dataDescriptions in the ConfigDescription 95 : * @return The baseband number (one-based) 96 : */ 97 : BasebandNameMod::BasebandName getBasebandName(unsigned int ndd) ; 98 : 99 : /** Get the baseband number of a given dataDescription 100 : * @param ndd The index of the dataDescription identifier 101 : * @exception ndd has an illegal value or is too large for the number of dataDescriptions in the ConfigDescription 102 : * @return The baseband number (one-based) 103 : */ 104 : unsigned int getBasebandIndex(unsigned int ndd) ; 105 : 106 : /** Accessor to the number of basebands 107 : * @return the number of basebands \f$ N_{bb} \f$ 108 : */ 109 : unsigned int numBaseband(); 110 : 111 : /** Accessor to the number of steps for the baseband of a given dataDescription 112 : * @param ndd The index of the dataDescrition identifier in dataDescriptionIdArray 113 : * (2nd param. in the constructors). 114 : * @exception ndd is too large for the number of dataDescriptions in the ConfigDescription 115 : * @return Number of steps for the baseband of a given dataDescription 116 : */ 117 : unsigned int numBin(unsigned int ndd) ; 118 : 119 : /** Accessor to the number of polarization products of a given dataDescription 120 : * @param ndd The index of the dataDescrition identifier in dataDescriptionIdArray 121 : * (2nd param. in the constructors). 122 : * @exception ndd is too large for the number of dataDescriptions in the ConfigDescription 123 : * @return Number of polarization products depending on the correlation mode: 124 : * - if CROSS_ONLY this is \f$ N_{pp}^{oo} \f$, the number of polarization cross products 125 : * for the non-zero baselines. 126 : * - if AUTO_ONLY this number is \f$ N_{pp}^{o} \f$ for the case of "single-dish" data. 127 : * - if CROSS_AND_AUTO this is \f$ N_{pp}^{oo} \f$, the number of polarization cross products 128 : * for the non-zero baselines;\n use the method numSdPol(int) to get the 129 : * corresponding number \f$ N_{pp}^{o} \f$ for the zero baselines. 130 : * @note If it desired to get this number for a given baseband, use the method getNumPol(int bbNum). 131 : */ 132 : unsigned int numPol(unsigned int ndd) ; 133 : 134 : /** Accessor to the number of polarization cross-products of a given dataDescription 135 : * @param ndd The index (zero-based) of the dataDescription identifier in dataDescriptionIdArray 136 : * (2nd param. in the constructors). 137 : * @exception ndd has an illegal value or is too large for the number of dataDescriptions in the ConfigDescription 138 : * @return Number of products for the zero-baselines.\n 139 : * If correlationMode=CROSS_AND_AUTO, use the accessor numPol(unsigned int) to get the corresponding number 140 : * \f$ N_{pp}^{oo} \f$ of cross products for the non-zero baselines. 141 : * @note If it desired to get this number \f$ N_{pp}^{oo} \f$ for a given baseband, use the method 142 : * getNumSdPol(int bbNum). 143 : */ 144 : unsigned int numSdPol(unsigned int ndd) ; 145 : 146 : /** Accessor to the number of frequency channels of a given dataDescription 147 : * @param ndd The index of the dataDescription identifier in dataDescriptionIdArray 148 : * (2nd param. in the constructors). 149 : * @exception ndd is too large for the number of dataDescriptions in the ConfigDescription 150 : * @return Number of frequency channels (spectral points) for that dataDescription 151 : */ 152 : unsigned int numChan(unsigned int ndd) ; 153 : 154 : /** Accessor to get the spwtral window identifier of a given dataDescription 155 : * @param ndd The index of the dataDescription identifier in dataDescriptionIdArray 156 : * @exception ndd is too large for the number of dataDescriptions in the ConfigDescription 157 : * @return The spectral window identifier 158 : */ 159 : asdm::Tag getSpwId(unsigned int ndd) ; 160 : 161 : /** Accessor to the total frequency bandwidth of a given dataDescription 162 : * @param ndd The index (zero-based) of the dataDescription identifier dataDescriptionIdArray 163 : * (2nd param. in the constructors). 164 : * @exception ndd has an illegal value or is too large for the number of dataDescriptions in the ConfigDescription 165 : * @return Total spectral bandwidth (Hz) 166 : */ 167 : asdm::Frequency totBandwidth(unsigned int ndd) ; 168 : 169 : /** Size of the apc axis (can be only 1 or 2) 170 : * @return size of this axis (the 3rd inner most in the axis hierarchy) 171 : * @note 172 : * - atmospherePhaseCode=0 or 1 this size will be 1 173 : * - if atmospherePhaseCode=2 this size is 2 174 : * TODO tell in the SDM document that along this axis the first grid coordinate is for the uncorreceted data and the second 175 : * for the corrected data. 176 : */ 177 : unsigned int numApc(); 178 : 179 : /** Accessor to the atmospherePhaseCorrection 180 : * @param atmPhaseCorrectionIndex index (0-based) along the apc axis 181 : * @return the atmPhaseCorrection enumerator for that index 182 : * @note 183 : * return an empty enumeration if the index is outside the range along the apc axis 184 : * - AP_UNCORRECTED means the data product contain uncorrected data 185 : * - AP_CORRECTED means the data product contain corrected data 186 : * - AP_MIXED means in the data product contains some data having been corrected, the other not corrected, 187 : * the criterion for correcting or not being being based to some algorithm 188 : */ 189 : Enum<AtmPhaseCorrectionMod::AtmPhaseCorrection> atmPhaseCorrection(unsigned int atmPhaseCorrectionIndex); 190 : 191 : /** Get the index position along the apc axis 192 : * @param apc an AtmPhaseCorrection enumerator 193 : * @return The index position (0-based) along the apc axis 194 : * @exception -1 returned if the input apc value is not present on the apc axis 195 : */ 196 : unsigned int atmPhaseCorrectionIndex(AtmPhaseCorrectionMod::AtmPhaseCorrection apc) ; 197 : 198 : /** Provide the number of auto-correlations for a given dataDescription 199 : * \note would the dataDescription identifier for this index in ConfigDescription be for cross correlations, 200 : * the corresponding dataDescription for auto-correlations would actually be used 201 : * @param ndd The index (zero-based) of the dataDescription identifier in dataDescriptionIdArray 202 : * (2nd param. in the constructors). 203 : * @exception ndd has a value which is illegal or too large for the number of dataDescription used in the configuration 204 : * @return Number of auto-correlations for that dataDescription 205 : * @exception 0 returned (lax mode) if correlationMode=0. 206 : */ 207 : int numAutoData(unsigned int ndd) ; 208 : 209 : /** Provide the number of cross-correlations for a given dataDescription 210 : * @param ndd The index (zero-based) of the dataDescription identifier in dataDescriptionIdArray 211 : * @exception ndd has an illegal value or is too large for the number of dataDescriptions in the ConfigDescription 212 : * @return the number of cross-correlations for that dataDescription 213 : * @exception returns 0 if correlationMode=1. 214 : */ 215 : unsigned int numCrossData(unsigned int ndd) ; 216 : 217 : /** Provide the number of switchCycle phases cumulated over all the basebands in the configuration. 218 : * @return the sum \f$ \sum_{i=1}^{N_{bb}} N_{bin}(i) \f$ 219 : * @note In the software of the ALMA correlator subsystem the following constraint has been 220 : * set: the number of phases in the switching cycles (e.g. when using the frequency switch observing 221 : * mode) must be common to all dataDescriptions within a baseband but may be different from 222 : * baseband to baseband. 223 : */ 224 : unsigned int sumMetaDataIndex(); 225 : 226 : /** Provide the index for a given dataDescription in the meta-data tree 227 : * @param ndd The index (zero-based) of the dataDescription identifier in dataDescriptionIdArray, 228 : * the second parameter in the signature of the constructors. 229 : * @exception ndd has an illegal value or is too large for the number of dataDescriptions in the ConfigDescription 230 : * @return The index in the metadata tree 231 : */ 232 : unsigned int metaDataIndex(unsigned int ndd) ; 233 : 234 : /** Get the bitSize (actually the number of bytes, 2 or 4) used for the visibilities 235 : * @return The size (actually in number of bytes) 236 : * @note Since December 2005 only the cross data (the visibilities) may be represented 237 : * either with 2 bytes or 4 bytes words. The auto data are always represented using 238 : * 4 bytes. Furthermore the same representation must be used whatever the spectral 239 : * resolution or the baselines. Hence this getBitSize method no longer requires 240 : * input parameters.\n 241 : * Note that a visibility being a complex quantity it is represented using two words, 242 : * the first for the real part and the second for the imaginary part. Note also 243 : * that for single-dish (zero-baseline), the XY correlation product is also a complex 244 : * quantity while XX and YY are real quantities, these being represented using a 245 : * single word. 246 : */ 247 : /* int getBitSize(); */ 248 : 249 : /** Get the correlation mode used 250 : * @return The correlation mode: 251 : * - CROSS_ONLY 252 : * - AUTO_ONLY 253 : * - CROSS_AND_AUTO 254 : */ 255 : CorrelationModeMod::CorrelationMode getCorrelationMode(); 256 : 257 : /** Get the number of dataDescription 258 : * @return The number of dataDescription 259 : */ 260 : unsigned int getNumDataDescription(); 261 : 262 : /** Get the number of frequency channels for a given dataDescription 263 : * @param ndd The dataDescription number 264 : * @exception ndd equal or exeeding the number of dataDescription in the configuration setup 265 : * @return The number of channels (spectral points) for that dataDescription number (1-based) 266 : */ 267 : unsigned int getNumChan(unsigned int ndd) ; 268 : 269 : /** Get the number of Polarization Products given a baseband. 270 : * @param nbb The baseband index 271 : * @exception bbIndex is equal or exceeds number of basebands in the configuration or not baseband independent 272 : * @return The number of Polarization Products: 273 : * - if correlationMode=CROSS_ONLY number \f$ N_{pp}^{oo} \f$ of products for the non-zero baselines 274 : * - if correlationMode=AUTO_ONLY number \f$ N_{pp}^{o} \f$ of products for the zero-baselines 275 : * - if correlationMode=CROSS_AND_AUTO number \f$ N_{pp}^{oo} \f$ of products for the non-zero baselines; 276 : * \n 277 : * use the method getNumSdPol() to get \f$ N_{pp}^{o} \f$, the number of products for 278 : * the zero-baselines. 279 : * @note 280 : * To get number of products given a dataDescription use the method numPol(). 281 : * To get number of products given a basebandName, would that be constant per baseband, use getNumPol(BasebandName bbName) 282 : */ 283 : unsigned int getNumPol(unsigned int bbIndex) ; 284 : 285 : /** Get the number of Polarization Products given a baseband. 286 : * @param bbName The baseband index (0-based) 287 : * @return The number of Polarization Products: 288 : * - if CROSS_ONLY number \f$ N_{pp}^{oo} \f$ of products for the non-zero baselines 289 : * - if AUTO_ONLY number \f$ N_{pp}^{o} \f$ of products for the zero-baselines 290 : * - if CROSS_AND_AUTO number \f$ N_{pp}^{oo} \f$ of products for the non-zero baselines; 291 : * \n 292 : * use the method getNumSdPol() to get \f$ N_{pp}^{o} \f$, the number of products for 293 : * the zero-baselines. 294 : * @note 295 : * To get number of products given a dataDescription use the method numPol(). 296 : */ 297 : unsigned int getNumPol(BasebandNameMod::BasebandName bbName) ; 298 : 299 : /** Get the number of Polarization Products in the case of zero-baselines given a baseband. 300 : * @param bbIndex The baseband index 301 : * @exception not baseband independent 302 : * @return The number of Polarization Products \f$ N_{pp}^{o} \f$: 303 : * - if CROSS_ONLY the returned number is 0. 304 : * - if AUTO_ONLY this method is equivalent to the method getNumPol(). 305 : * - if CROSS_AND_AUTO use the method getNumPol() to get \f$ N_{pp}^{oo} \f$, 306 : * the corresponding number of products for the non-zero baselines. 307 : * - if the input baseband name does not belong to the configuration return 0 308 : * @note To get number of products given a dataDescription use the method numPol(). 309 : */ 310 : unsigned int getNumSdPol(unsigned int bbIndex) ; 311 : 312 : /** Get the number of Polarization Products in the case of zero-baselines given a baseband. 313 : * @param bbName The baseband index (0-based) 314 : * @return The number of Polarization Products \f$ N_{pp}^{o} \f$: 315 : * - if CROSS_ONLY the returned number is 0. 316 : * - if AUTO_ONLY this method is equivalent to the method getNumPol(). 317 : * - if CROSS_AND_AUTO use the method getNumPol() to get \f$ N_{pp}^{oo} \f$, 318 : * the corresponding number of products for the non-zero baselines. 319 : * - if the input baseband name does not belong to the configuration return 0 320 : * @note To get number of products given a dataDescription use the method numPol(). 321 : */ 322 : unsigned int getNumSdPol(BasebandNameMod::BasebandName bbName) ; 323 : 324 : /** Get the index of a dataDescription given its index in its parent baseband 325 : * @param bbIndex The baseband index 326 : * @exception bbIndex eqaul or exceeding the number of basebands used in the configuration 327 : * @param j The dataDescription index (zero-based) within that baseband 328 : * @exception j too large for the number of dataDescriptions in the given baseband 329 : * @return The index of the dataDescrition in the sequence of dataDescription in the 330 : * configDescription 331 : */ 332 : unsigned int getNdd(unsigned int bbIndex, unsigned int j) ; 333 : 334 : /** Get the index of a dataDescription given its index in its parent baseband 335 : * @param bbName The baseband name 336 : * @param j The dataDescription index (zero-based) within that baseband 337 : * @exception no such babseband name in the configuration or j too large for the number of dataDescriptions given that baseband 338 : * @return The index of the dataDescrition in the sequence of dataDescription in the 339 : * configDescription 340 : */ 341 : unsigned int getNdd(BasebandNameMod::BasebandName bbName, unsigned int j) ; 342 : 343 : /** Get the number of Spectral Windows in a given baseband identified by its index. 344 : * @param bbNum The baseband index (zero-based) 345 : * @exception bbNum illegal or exceeding the number of basebands used in the configuration 346 : * @return The number \f$ N_{sw} \f$ of spectral windows in the baseband 347 : */ 348 : unsigned int getNumSpw(unsigned int bbIndex) ; 349 : 350 : /** Get the number of Spectral Windows in a given baseband identified by its name. 351 : * @param bbName The baseband name 352 : * @return The number \f$ N_{sw} \f$ of spectral windows in the baseband 353 : * or 0 if baseband does not belong to the configuration 354 : */ 355 : unsigned int getNumSpw(BasebandNameMod::BasebandName bbName); 356 : 357 : /** Get the dataDescription index given a dataDescriptionId identifier 358 : * @param dataDescriptionId The dataDescriptionId identifier 359 : * @exception dataDescriptionId does not exist in the set of dataDescription identifiers in the configuration 360 : * @return The dataDescription index (0-based) 361 : */ 362 : unsigned int getDataDescriptionIndex( asdm::Tag dataDescriptionId) ; 363 : 364 : /** Get the size of the block of data for the auto-correlations originating from one antenna. \n 365 : * This size is determined according to the formula \n 366 : * 367 : * \f$ sizeof(float) \times \sum_{i=1}^{N_{bb}} \left( N_{bin}(i)~f(N_{pp}(i))~ \sum_{j=1}^{N_{sw}(i)} N_{sp}(j) \right) \f$ 368 : * \n 369 : * where, for pure single-dish, (i.e. correlationMode=1), \n 370 : \f$ 371 : f(N_{pp}(i)) = \left\| \begin{array} 372 : {r@{\quad if\quad}l} 373 : N_{pp}^{o}(i) & N_{pp}^{o}(i) \le 2 \\ 374 : 4 & N_{pp}^{o}(i)=3 \\ 375 : \end{array} \right. 376 : 377 : \f$ 378 : * \n 379 : * and for correlationMode=2 \n 380 : \f$ 381 : f(N_{pp}(i)) = \left\| \begin{array} 382 : {r@{\quad if\quad}l} 383 : N_{pp}^{oo}(i) & N_{pp}^{oo}(i) \le 2~~ (i.e.~1~re~if~N_{pp}^{oo}(i)=1, ~2~re~if~N_{pp}^{oo}(i)=2)\\ 384 : N_{pp}^{oo}(i) & N_{pp}^{oo}(i) = 4~~ (i.e.~3~re + 1~im,~standard~mode) \\ 385 : \end{array} \right. 386 : \f$ 387 : * 388 : */ 389 : unsigned long getAutoSize(); 390 : 391 : /** Get the size of the block of cross-correlation data for the ensemble of spectral windows 392 : * and a single non-zero baseline. \n 393 : * This size is determined according to the formula \n 394 : * \f$ 395 : sizeof(bitSize) \times 2 ~ N_{apc}~ 396 : \sum_{i=1}^{N_{bb}} ~\left( N_{bin}(i)~N_{pp}^{oo}(i) \sum_{j=1}^{N_{sw}(i)} N_{sp}(j) \right) 397 : \f$ 398 : * \n 399 : * where there is a factor 2 because a visibility is a complex.\n 400 : * 401 : * \f$ sizeof(bitSize)\f$=2 or 4 bytes (ref. note of Steeve). 402 : */ 403 : unsigned long getCrossSize(); 404 : 405 : /** Number of auto-correlations produce for one antenna. 406 : * \note If the number \f$N_{pp}^{o}\f$ of polarization products is 3 the cross product XY 407 : * counts for one data quantity.\n 408 : * To get this number of polarization products \f$N_{pp}^{o}\f$ see the method numSdPol(int ndd); 409 : * to get it for a given dataDescription index or the method getNumSdPol(int bbNum) for a 410 : * given baseband. 411 : */ 412 : unsigned long getNumAutoData(); 413 : 414 : /** Number of cross-correlations produced by one non-zero baseline for the set of dataDescriptions. 415 : * \note This number must be understood as the number complex values, one data value being 416 : * a complex quantity. 417 : */ 418 : unsigned long getNumCrossData(); 419 : 420 : /** Number of auto-correlations produced by one antenna for one dataDescription. 421 : * \param autoDataDescriptionId dataDescription identifier of the subset of auto-correlations 422 : * \exception autoDataDescriptionId (eventualy as infered from crossDataDescriptionId) does not exist 423 : * for the configuration setup 424 : * \note If the number \f$N_{pp}^{o}\f$ of polarization products is 3 the cross product XY 425 : * counts for one data quantity.\n 426 : * To get this number of polarization products \f$N_{pp}^{o}\f$ for a given dataDescription index 427 : * see the method numSdPol(int ndd); 428 : * to get it for a given baseband, would it be baseband-based, see the method getNumSdPol(int bbNum). 429 : */ 430 : unsigned long getNumAutoData(asdm::Tag autoDataDescriptionId) ; 431 : 432 : 433 : /** Number of cross-correlations produced by one non-zero baseline for a given dataDescription. 434 : * \param crossDataDescriptionId one of the dataDescription identifiers in the set used for the configuration setup 435 : * @exception crossDataDescriptionId does not exist in the set of dataDescription identifiers in the setup 436 : * configDescription setup 437 : * \note This number must be understood as the number complex values, one data value being 438 : * a complex quantity. 439 : */ 440 : unsigned long getNumCrossData(asdm::Tag crossDataDescriptionId) ; 441 : 442 : /** Get the array of dataDescriptionId identifiers for the auto-correlations 443 : * \param crossDataDescriptionId one of the dataDescription identifiers in the set used for the configuration setup 444 : * @exception crossDataDescriptionId does not exist in the set of dataDescription identifiers in the setup 445 : * @return The array of dataDescriptionId identifier for the auto-correlations 446 : * \note In the case correlationMode=2 this array of identifiers is only implicit in configDescription. 447 : * It is automaticly derived based on the input dataDescriptionId identifiers for the cross-correlations 448 : * (the second parameter in the signature of the constructor of this class). 449 : */ 450 : asdm::Tag getAutoDataDescriptionId(asdm::Tag crossDataDescriptionId) ; 451 : 452 : /** Get the array of dataDescriptionId identifiers for the cross-correlations 453 : * @return The array of dataDescriptionId identifier for the auto-correlations (zero-baselines) 454 : * \exception Would correlationMode=0 the returned vector would have a size of 0 455 : */ 456 : std::vector<asdm::Tag> getAutoDataDescriptionId(); 457 : 458 : /** Get the array of dataDescriptionId identifiers for the cross-correlations 459 : * @return The array of dataDescriptionId identifier for the cross-correlations 460 : * \exception would correlationMode=1 the returned vector would have a size of 0 461 : */ 462 : std::vector<asdm::Tag> getCrossDataDescriptionId(); 463 : 464 : 465 : protected: 466 : std::vector<asdm::Tag> v_dataDescriptionIdArray_;//!< the input array of dataDescription identifiers 467 : 468 : Enum<CorrelationModeMod::CorrelationMode> e_cm_; //!< Type-safe correlation mode 469 : CorrelationModeMod::CorrelationMode correlationMode_; //!< Correlation mode 470 : 471 : EnumSet<AtmPhaseCorrectionMod::AtmPhaseCorrection> es_apc_; //!< Atmospheric Phase Correction set 472 : std::vector<AtmPhaseCorrectionMod::AtmPhaseCorrection> v_atmPhaseCorrection_; //!< sequence of the Atmospheric Phase Correction values along the apc axis 473 : 474 : std::vector<unsigned int> v_numPol_; //!< number of cross-products (size numDataDesc_) 475 : std::vector<asdm::Tag> v_spwId_; //!< sequence of spectral window identifiers (size numDataDesc_) 476 : std::vector<unsigned int> v_numChan_; //!< sequence of nb of chan. i.e. spectral points (size numDataDesc_) 477 : std::vector<BasebandNameMod::BasebandName> v_basebandName_; //!< (size numDataDesc_), baseband name for every spectral window. 478 : std::vector<std::vector<int> > vv_nsp_; //!< Nb of chan. per dataDescription (size numBaseband) vectors 479 : std::map<BasebandNameMod::BasebandName,std::vector<DataDescParams> > m_bn_v_ddp_; //!< The sequence of dataDescParams in the different basebands 480 : std::map<asdm::Tag,BasebandNameMod::BasebandName> m_ddid_bbn_; //!< Association between the dataDescriptionId and the baseband name 481 : unsigned int numApc_; //!< APC axis size (can take the value 1 or 2 only) 482 : unsigned int numDataDescription_; //!< Explicit number of dataDescriptionId 483 : 484 : unsigned int sumMetaDataIndex_; //!< Sum of the elements of the vector v_metaDataIndex_ 485 : unsigned long sumAutoSize_; //!< Sum of the elements of the vector v_autoSize_ 486 : unsigned long sumCrossSize_; //!< Sum of the elements of the vector v_crossSize_ 487 : 488 : std::vector<unsigned int> v_metaDataIndex_; //!< Indices for positions for every dataDesc (size numDataDesc_) 489 : std::vector<unsigned long> v_cumulAutoSize_; //!< Number of bytes to skip for every dataDesc (size numDataDesc_) 490 : std::vector<unsigned long> v_cumulCrossSize_; //!< Number of bytes to skip for every dataDesc (size numDataDesc_) 491 : std::vector<unsigned long> v_numAutoData_; //!< Number of auto-correlations per antenna (size numDataDesc_) 492 : std::vector<unsigned long> v_numCrossData_; //!< Number of cross-correlations per antenna pair (size numDataDesc_) 493 : std::vector<unsigned long> v_autoSize_; //!< Size, in nb PDT values, for every dataDesc (size numDataDesc_) 494 : std::vector<unsigned long> v_crossSize_; //!< Size, in nb PDT values, for every dataDesc (size numDataDesc_) 495 : 496 : 497 : std::vector<asdm::Tag> v_crossDataDescriptionId_;//!< Vector of dataDecsritionId for the cross-correlations (size numDataDesc_) 498 : std::vector<asdm::Tag> v_autoDataDescriptionId_; //!< Vector of dataDecsritionId for the auto-correlations (size <= numDataDesc_) 499 : std::vector<bool> v_pairDataDescriptionId_; //!< true if crossDataDecsritionId assoc to autoDataDecsritionId (size numDataDesc_) 500 : 501 : 502 : std::vector<BasebandNameMod::BasebandName> v_basebandSet_; //!< Sequence of baseband names 503 : EnumSet<BasebandNameMod::BasebandName> e_basebandSet_; //!< Set of baseband names 504 : 505 : std::vector<unsigned int> v_numSpwPerBb_; //!< Number of spectral windows in every baseband 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 47543616 : 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 47543616 : return v_numBin_[ndd]; 520 : } 521 : 522 : } 523 : #define _DATADESCRIPTIONSSET_H 524 : #endif