casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BaselinesSet.h
Go to the documentation of this file.
1 #if !defined(_BASELINESSET_H)
2 
8 
11 
12 
13 namespace sdmbin {
14 
18  {
19  public:
20  BaselinesSet();
21 
38  BaselinesSet( std::vector<asdm::Tag> v_antennaIdArray,
39  std::vector<int> v_feedIdArray,
40  std::vector<int> v_phasedArrayList,
41  std::vector<bool> v_antennaUsedArray,
42  DataDescriptionsSet& dataDescriptionsSet
43  );
44 
46  BaselinesSet(const BaselinesSet &);
47 
49  ~BaselinesSet();
50 
68  unsigned int transferId(unsigned int na, unsigned int ndd, unsigned int nbin);
69 
87  unsigned int transferId(unsigned int na, unsigned int nfe, unsigned int ndd, unsigned int nbin);
88 
100  unsigned int transferId(unsigned int na1, unsigned int na2, unsigned int ndd, unsigned int nbin, unsigned int napc);
101 
114  unsigned int transferId(unsigned int na1, unsigned int na2, unsigned int nfe, unsigned int ndd, unsigned int nbin, unsigned int napc);
115 
125  unsigned int baselineIndex( asdm::Tag antennaId) ;
126 
146  unsigned int baselineIndex( asdm::Tag antennaId1, asdm::Tag antennaId2) ;
147 
163  unsigned int baselineIndex( unsigned int na1, unsigned int na2) ;
164 
174  unsigned int antenna1(unsigned int baselineIndex) ;
175 
185  unsigned int antenna2(unsigned int baselineIndex) ;
186 
195  unsigned int feedIndex(asdm::Tag antennaId, int feedId) ;
196 
202  asdm::Tag getEffAntennaId(unsigned int na) ;
203 
207  unsigned int getNumAntennas();
208 
209 
222  int getFeedId(unsigned int na, unsigned int nfe) ;
223 
234  unsigned int getNumEffAntennas();
235 
240  unsigned int getNumBaselines();
241 
247  unsigned int getNumEffBaselines();
248 
260  unsigned int getNumPDTvalue(Enum<DataContentMod::DataContent> e_dc, EnumSet<AxisNameMod::AxisName> es_an, bool effective);
261 
262  private:
263  std::vector<asdm::Tag> v_AntennaIdArray_;
264  std::vector<int> v_FeedIdArray_;
265  std::vector<int> v_PhasedArrayList_;
266  unsigned int numFeeds_;
267  unsigned int numAntennas_;
268  unsigned int numEffAntennas_;
269  unsigned int numBaselines_;
270  unsigned int numEffBaselines_;
271  std::vector<asdm::Tag> v_effAntennaIdArray_;
272 
273  };
274 
275 
276  inline unsigned int BaselinesSet::transferId(unsigned int na1,unsigned int na2,unsigned int nfe, unsigned int ndd,unsigned int nbin,unsigned int napc){
277 
278  unsigned int baselineidx = baselineIndex(na1,na2); //cout << "baselineidx=" << baselineidx << endl;
279 
280  unsigned int v_cumulCrossSize_ndd=0; if(v_cumulCrossSize_.size()!=0)v_cumulCrossSize_ndd = v_cumulCrossSize_[ndd];
281  unsigned int v_crossSize_ndd=0; if(v_crossSize_.size()!=0) v_crossSize_ndd = v_crossSize_[ndd];
282 
283  unsigned int n =
284  baselineidx*numFeeds_*sumCrossSize_ + // /baseline
285  nfe*sumCrossSize_ + // /baseline/feed
286  v_cumulCrossSize_ndd + // /baseline/feed/datadesc
287  nbin*(v_crossSize_ndd/numBin(ndd)) + // /baseline/feed/datadesc/bin
288  napc*(v_crossSize_ndd/(numBin(ndd)*numApc_)); // /baseline/feed/datadesc/bin/napc
289 
290  return n;
291  }
292 
293  inline unsigned int BaselinesSet::baselineIndex( unsigned int na1, unsigned int na2) {
294  unsigned int iIdx = std::min (na1, na2);
295  unsigned int jIdx = std::max (na1, na2);
296  return jIdx * (jIdx - 1) / 2 + iIdx;
297  }
298 }
299 #define _BASELINESSET_H
300 #endif
unsigned int getNumEffBaselines()
Get the effective number of antenna pairs producing data.
#define max(a, b)
Definition: hio.h:44
std::vector< asdm::Tag > v_AntennaIdArray_
Input array set of antenna identifiers (size numAntennas_)
Definition: BaselinesSet.h:263
unsigned int numEffBaselines_
Effective number of antenna pairs.
Definition: BaselinesSet.h:270
std::vector< unsigned long > v_cumulCrossSize_
Number of bytes to skip for every dataDesc (size numDataDesc_)
#define min(a, b)
Definition: hio.h:45
unsigned int transferId(unsigned int na, unsigned int ndd, unsigned int nbin)
Transfer identifier for a given node in the tree hierarchy for auto-correlation data Transfer identif...
unsigned int getNumBaselines()
Get the number of antenna pairs if all the antennas in v_AntennaIdArray_ were used.
unsigned int getNumAntennas()
Number of antenna involved in the data if none would have been dropped.
~BaselinesSet()
Destructor (use the default implementation)
unsigned int numApc_
APC axis size (can take the value 1 or 2 only)
asdm::Tag getEffAntennaId(unsigned int na)
Antenna identifier from its index in the sequence of antenna restricted to those effectively producin...
unsigned int getNumPDTvalue(Enum< DataContentMod::DataContent > e_dc, EnumSet< AxisNameMod::AxisName > es_an, bool effective)
Get the number of primitive data values (i.e.
Definition of the second level (the top level) in the tree hierarchy: include the antenna baseline co...
Definition: BaselinesSet.h:17
std::vector< int > v_FeedIdArray_
Input array list of feed identifiers (size numFeed*numAntennas_)
Definition: BaselinesSet.h:264
std::vector< int > v_PhasedArrayList_
Input phasedArray list (not yet implemented)
Definition: BaselinesSet.h:265
unsigned long sumCrossSize_
Sum of the elements of the vector v_crossSize_.
unsigned int numAntennas_
Input number of antennas.
Definition: BaselinesSet.h:267
Definition of the first level in the tree hierarchy: set of spectro-polarization descriptions, basebands.
std::vector< unsigned long > v_crossSize_
Size, in nb PDT values, for every dataDesc (size numDataDesc_)
unsigned int numEffAntennas_
Effective number of antennas with data.
Definition: BaselinesSet.h:268
unsigned int numFeeds_
Input number of feeds.
Definition: BaselinesSet.h:266
unsigned int antenna1(unsigned int baselineIndex)
Antenna index of the first antenna of a pair defining a baseline number.
unsigned int baselineIndex(asdm::Tag antennaId)
Baseline number for a given antenna identifier.
std::vector< asdm::Tag > v_effAntennaIdArray_
Effective array of antenna identifiers.
Definition: BaselinesSet.h:271
unsigned int antenna2(unsigned int baselineIndex)
Antenna index of the second antenna of a pair defining a baseline number.
unsigned int getNumEffAntennas()
Number of antenna actualy involved in the data.
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
unsigned int numBin(unsigned int ndd)
Accessor to the number of steps for the baseband of a given dataDescription.
unsigned int feedIndex(asdm::Tag antennaId, int feedId)
Accessor to the feed index of a feed identifier given an antenna identifier.
unsigned int numBaselines_
number of antenna pairs
Definition: BaselinesSet.h:269
int getFeedId(unsigned int na, unsigned int nfe)
Accessor to the feed identifier given a feed index and an antenna index.