casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UvwCoords.h
Go to the documentation of this file.
1 #include <vector>
2 #include <map>
3 
4 #include <alma/Enumtcl/Enum.hpp>
6 
8 
9 #include <measures/Measures.h>
16 #include <measures/Measures/Muvw.h>
17 #include <casa/Quanta.h>
18 
19 #include <alma/ASDM/ASDMEntities.h>
20 
38 class UvwCoords{
39 public:
40 
48  UvwCoords(asdm::ASDM* const datasetPtr);
49 
51  ~UvwCoords();
52 
75  void uvw_bl( asdm::Tag configDescriptionId,
76  const std::vector<std::vector<asdm::Angle> >& phaseDir,
77  double timeCentroid,
78  Enum<CorrelationModeMod::CorrelationMode> correlationMode,
79  bool reverse, bool autoTrailing,
80  std::vector<casacore::Vector<casacore::Double> >& v_uvw,
81  casacore::MSFieldColumns* msfc_p=0);
82 
106  void uvw_bl( asdm::Tag configDescriptionId,
107  const std::vector<std::vector<asdm::Angle> >& phaseDir,
108  const std::vector<double>& v_timeCentroid,
109  Enum<CorrelationModeMod::CorrelationMode> correlationMode,
110  bool reverse, bool autoTrailing,
111  std::vector<casacore::Vector<casacore::Double> >& v_uvw,
112  casacore::MSFieldColumns* msfc_p=0);
113 
151  void uvw_bl( asdm::MainRow* mainRow, std::vector<std::pair<unsigned int,double> > v_tci,
152  Enum<CorrelationModeMod::CorrelationMode> correlationMode,
153  std::pair<bool,bool> dataOrder, std::vector<casacore::Vector<casacore::Double> >& v_uvw);
154 
155 
177  void uvw_bl( asdm::MainRow* mainRow, std::vector<double> v_timeCentroid,
178  Enum<CorrelationModeMod::CorrelationMode> correlationMode,
179  std::pair<bool,bool> dataOrder,
180  std::vector<casacore::Vector<casacore::Double> >& v_uvw,
181  casacore::MSFieldColumns* msfc_p=0 );
182 
183 private:
184 
188  struct ArrayParam{
189  public:
190  asdm::Tag subarrayId; //<! (sub)array identifier
191  std::vector<asdm::Tag> v_ant; //<! sequence of antennas
192  unsigned int nrepeat; //<! number of casacore::MS main table rows per antenna baseline
193  Enum<CorrelationModeMod::CorrelationMode> e_correlationMode; //<! correlation mode (original mode passed through the user filter)
198  bool operator== ( ArrayParam & rhs){
199  std::set<asdm::Tag> a, b;
200  for(unsigned int na=0; na<v_ant.size(); na++){
201  a.insert(v_ant[na]);
202  }
203 
204  for (unsigned int na=0; na<rhs.v_ant.size(); na++) {
205  b.insert(rhs.v_ant[na]);
206  }
207 
208  if( a != b ) return false;
209  return true;
210  }
211  string show(){
212  std::ostringstream os;
213  for(unsigned int n=0; n<v_ant.size(); n++)os << v_ant[n].toString() << " ";
214  os << " nrepeat " << nrepeat;
215  return os.str();
216  }
217  };
218 
219  std::map<asdm::Tag,ArrayParam> m_array_;
220  std::map<asdm::Tag,casacore::MPosition> m_antPos_;
221  std::map<asdm::Tag,casacore::Vector<casacore::Double> > m_antUVW_;
222 
223  // the 3 fundamental attributes of the state machine
225  std::vector<std::vector<asdm::Angle> > phaseDir_;
227 
229 
247  std::vector<double> antPos(const std::vector<double>& stationPos, const std::vector<double>& antOffset);
248 
262  void uvw_an(double timeCentroid, const std::vector<std::vector<asdm::Angle> >& phaseDir, const std::vector<asdm::Tag>& v_antId);
263 
264 
282  void uvw_bl( const std::vector<asdm::Tag>& v_antennaId, unsigned int nrep, bool reverse, std::vector<casacore::Vector<casacore::Double> >& v_uvw);
283 
284 };
(Sub-)array parameters constraining order and size of the output vector of 3D UVW coords triplets...
Definition: UvwCoords.h:188
unsigned int nrepeat
Definition: UvwCoords.h:192
UvwCoords(asdm::ASDM *const datasetPtr)
Constructor.
casacore::Vector< casacore::Double > sduvw_
Definition: UvwCoords.h:228
bool operator==(ArrayParam &rhs)
Concept Equality Comparable:
Definition: UvwCoords.h:198
std::vector< std::vector< asdm::Angle > > phaseDir_
Definition: UvwCoords.h:225
The ASDM class is the container for all tables.
Definition: ASDM.h:273
asdm::Tag subarrayId
Definition: UvwCoords.h:190
A class to provide easy read-write access to MSField columns.
void uvw_bl(asdm::Tag configDescriptionId, const std::vector< std::vector< asdm::Angle > > &phaseDir, double timeCentroid, Enum< CorrelationModeMod::CorrelationMode > correlationMode, bool reverse, bool autoTrailing, std::vector< casacore::Vector< casacore::Double > > &v_uvw, casacore::MSFieldColumns *msfc_p=0)
Determine the baseline-based uvw in case timeCentroid is baseline-based, spw-based and bin-based inva...
casacore::String toString(VisibilityProcessor::ProcessingType p)
std::map< asdm::Tag, casacore::MPosition > m_antPos_
Definition: UvwCoords.h:220
asdm::Tag subarrayId_
Definition: UvwCoords.h:226
The MainRow class is a row of a MainTable.
Definition: MainRow.h:132
std::map< asdm::Tag, ArrayParam > m_array_
Definition: UvwCoords.h:219
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
Definition: Tag.h:73
~UvwCoords()
Destructor.
SDM UVW engine: compute the uvw these being not present in the SDM but required to build casacore::MS...
Definition: UvwCoords.h:38
double timeCentroid_
the 3 fundamental attributes of the state machine
Definition: UvwCoords.h:224
void uvw_an(double timeCentroid, const std::vector< std::vector< asdm::Angle > > &phaseDir, const std::vector< asdm::Tag > &v_antId)
Determine antenna-based uvw for every member of the sequence of antennas defining a (sub)array...
std::vector< asdm::Tag > v_ant
Definition: UvwCoords.h:191
std::map< asdm::Tag, casacore::Vector< casacore::Double > > m_antUVW_
Definition: UvwCoords.h:221
Enum< CorrelationModeMod::CorrelationMode > e_correlationMode
Definition: UvwCoords.h:193
std::vector< double > antPos(const std::vector< double > &stationPos, const std::vector< double > &antOffset)
ITRF coordinates of an ITRF point on which is added an offset defined in a ASCS.