DP3
SourceInfo.h
Go to the documentation of this file.
1 // SourceInfo.h: Info about a source
2 //
3 // Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
4 // SPDX-License-Identifier: GPL-3.0-or-later
5 
9 
10 #ifndef LOFAR_PARMDB_SOURCEINFO_H
11 #define LOFAR_PARMDB_SOURCEINFO_H
12 
13 #include <casacore/casa/Arrays/Array.h>
14 #include <casacore/measures/Measures/MDirection.h>
15 
16 namespace dp3 {
17 
18 namespace blob {
19 class BlobIStream;
20 class BlobOStream;
21 } // namespace blob
22 
23 namespace parmdb {
24 
27 
29 class SourceInfo {
30  public:
33  enum Type { POINT = 0, GAUSSIAN = 1, DISK = 2, SHAPELET = 3 };
34 
45  SourceInfo(const std::string& name, Type type,
46  const std::string& refType = "J2000", bool useLogarithmicSI = true,
47  unsigned int spectralIndexNTerms = 0,
48  double spectralIndexRefFreqHz = 0.,
49  bool useRotationMeasure = false,
50  bool positionAngleIsAbsolute = false);
51 
54 
57 
59  const std::string& getName() const { return itsName; }
60 
62  Type getType() const { return itsType; }
63 
65  const std::string& getRefType() const { return itsRefType; }
66 
70  bool getHasLogarithmicSI() const { return itsHasLogarithmicSI; }
71 
75  bool getPositionAngleIsAbsolute() const { return itsPositionAngleIsAbsolute; }
76 
79  unsigned int getNSpectralTerms() const { return itsNSpTerms; }
80 
82  double getSpectralTermsRefFreq() const { return itsSpTermsRefFreq; }
83 
86  bool getUseRotationMeasure() const { return itsUseRotMeas; }
87 
90  const casacore::Array<double>& getShapeletCoeffI() const {
91  return itsShapeletCoeffI;
92  }
93  const casacore::Array<double>& getShapeletCoeffQ() const {
94  return itsShapeletCoeffQ;
95  }
96  const casacore::Array<double>& getShapeletCoeffU() const {
97  return itsShapeletCoeffU;
98  }
99  const casacore::Array<double>& getShapeletCoeffV() const {
100  return itsShapeletCoeffV;
101  }
102  double getShapeletScaleI() const { return itsShapeletScaleI; }
103  double getShapeletScaleQ() const { return itsShapeletScaleQ; }
104  double getShapeletScaleU() const { return itsShapeletScaleU; }
105  double getShapeletScaleV() const { return itsShapeletScaleV; }
106  void setShapeletCoeff(const casacore::Array<double>& I,
107  const casacore::Array<double>& Q,
108  const casacore::Array<double>& U,
109  const casacore::Array<double>& V);
110  void setShapeletScale(double scaleI, double scaleQ, double scaleU,
111  double scaleV);
113 
116 
119 
120  private:
121  string itsName;
122  Type itsType;
123  string itsRefType;
124  uint32_t itsNSpTerms;
125  double itsSpTermsRefFreq;
126  bool itsHasLogarithmicSI;
128  bool itsUseRotMeas;
129  bool itsPositionAngleIsAbsolute;
133  double itsShapeletScaleI;
134  double itsShapeletScaleQ;
135  double itsShapeletScaleU;
136  double itsShapeletScaleV;
137  casacore::Array<double> itsShapeletCoeffI;
138  casacore::Array<double> itsShapeletCoeffQ;
139  casacore::Array<double> itsShapeletCoeffU;
140  casacore::Array<double> itsShapeletCoeffV;
141 };
142 
144 
145 } // namespace parmdb
146 } // namespace dp3
147 
148 #endif
Input stream for a blob.
Definition: BlobIStream.h:43
Output stream for a blob.
Definition: BlobOStream.h:40
Info about a source.
Definition: SourceInfo.h:29
double getSpectralTermsRefFreq() const
Get the reference frequency (in Hz) for the spectral index.
Definition: SourceInfo.h:82
bool getUseRotationMeasure() const
Definition: SourceInfo.h:86
double getShapeletScaleQ() const
Definition: SourceInfo.h:103
const casacore::Array< double > & getShapeletCoeffU() const
Definition: SourceInfo.h:96
SourceInfo(const SourceInfo &)
Copy constructor.
double getShapeletScaleV() const
Definition: SourceInfo.h:105
unsigned int getNSpectralTerms() const
Definition: SourceInfo.h:79
void read(dp3::blob::BlobIStream &)
Read from a blob.
const std::string & getRefType() const
Get the reference type.
Definition: SourceInfo.h:65
void setShapeletCoeff(const casacore::Array< double > &I, const casacore::Array< double > &Q, const casacore::Array< double > &U, const casacore::Array< double > &V)
double getShapeletScaleU() const
Definition: SourceInfo.h:104
void write(dp3::blob::BlobOStream &) const
Write into a blob.
bool getHasLogarithmicSI() const
Definition: SourceInfo.h:70
const casacore::Array< double > & getShapeletCoeffQ() const
Definition: SourceInfo.h:93
bool getPositionAngleIsAbsolute() const
Definition: SourceInfo.h:75
const casacore::Array< double > & getShapeletCoeffV() const
Definition: SourceInfo.h:99
const casacore::Array< double > & getShapeletCoeffI() const
Definition: SourceInfo.h:90
void setShapeletScale(double scaleI, double scaleQ, double scaleU, double scaleV)
SourceInfo & operator=(const SourceInfo &)
Assignment.
const std::string & getName() const
Get the source name.
Definition: SourceInfo.h:59
Type getType() const
Get the source type.
Definition: SourceInfo.h:62
SourceInfo(const std::string &name, Type type, const std::string &refType="J2000", bool useLogarithmicSI=true, unsigned int spectralIndexNTerms=0, double spectralIndexRefFreqHz=0., bool useRotationMeasure=false, bool positionAngleIsAbsolute=false)
double getShapeletScaleI() const
Definition: SourceInfo.h:102
Type
Definition: SourceInfo.h:33
@ SHAPELET
Definition: SourceInfo.h:33
@ DISK
Definition: SourceInfo.h:33
@ POINT
Definition: SourceInfo.h:33
@ GAUSSIAN
Definition: SourceInfo.h:33
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53