DP3
Source.h
Go to the documentation of this file.
1 // SourceData.h: Class holding all parameters of 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_SOURCEDATA_H
11 #define LOFAR_PARMDB_SOURCEDATA_H
12 
13 #include "SourceInfo.h"
14 
15 #include <iosfwd>
16 
17 namespace dp3::parmdb {
18 class ParmValue;
19 }
20 
21 namespace dp3::sky_model {
22 
24 class Source {
25  public:
26  Source();
27 
28  Source(const SourceInfo&, const std::string& patchName, double ra,
29  double dec);
30 
32  const SourceInfo& getInfo() const { return itsInfo; }
33  const std::string& getPatchName() const { return itsPatchName; }
35  double getRa() const { return itsRa; }
37  double getDec() const { return itsDec; }
38  double getI() const { return itsI; }
39  double getQ() const { return itsQ; }
40  double getU() const { return itsU; }
41  double getV() const { return itsV; }
43  double getMajorAxis() const { return itsMajorAxis; }
45  double getMinorAxis() const { return itsMinorAxis; }
47  double getOrientation() const { return itsOrientation; }
48  double getPolarizationAngle() const { return itsPolAngle; }
49  double getPolarizedFraction() const { return itsPolFrac; }
50  double getRotationMeasure() const { return itsRM; }
51  const std::vector<double>& getSpectralTerms() const { return itsSpTerms; }
52 
55  void setInfo(const SourceInfo& info) { itsInfo = info; }
56  void setPatchName(const std::string& patchName) { itsPatchName = patchName; }
57  void setRa(double ra) { itsRa = ra; }
58  void setDec(double dec) { itsDec = dec; }
59  void setI(double i) { itsI = i; }
60  void setQ(double q) { itsQ = q; }
61  void setU(double u) { itsU = u; }
62  void setV(double v) { itsV = v; }
63  void setMajorAxis(double majorAxis) { itsMajorAxis = majorAxis; }
64  void setMinorAxis(double minorAxis) { itsMinorAxis = minorAxis; }
65  void setOrientation(double orientation) { itsOrientation = orientation; }
66  void setPolarizationAngle(double polarizationAngle) {
67  itsPolAngle = polarizationAngle;
68  }
69  void setPolarizedFraction(double polarizedFraction) {
70  itsPolFrac = polarizedFraction;
71  }
72  void setRotationMeasure(double potationMeasure) { itsRM = potationMeasure; }
73  void setSpectralTerms(const std::vector<double>& spectralTerms) {
74  itsSpTerms = spectralTerms;
75  }
77 
78  void setParms(
79  const std::map<std::string, parmdb::ParmValue>& defaultParameters);
80 
82  void print(std::ostream&) const;
83 
84  private:
88  void setParm(const std::map<std::string, parmdb::ParmValue>& parms,
89  const std::string& name, double defValue, double& value);
90 
91  SourceInfo itsInfo;
92  string itsPatchName;
93  double itsRa;
94  double itsDec;
95  double itsI;
96  double itsQ;
97  double itsU;
98  double itsV;
99  double itsMajorAxis;
100  double itsMinorAxis;
101  double itsOrientation;
102  double itsPolAngle;
103  double itsPolFrac;
104  double itsRM;
105  std::vector<double> itsSpTerms;
106 };
107 
111 void toSkyModel(std::ostream& output, const Source& source);
112 
113 } // namespace dp3::sky_model
114 
115 #endif
Definition: SourceInfo.h:14
Class holding data of a source.
Definition: Source.h:24
void setPatchName(const std::string &patchName)
Definition: Source.h:56
void print(std::ostream &) const
Print the source data.
void setMajorAxis(double majorAxis)
Definition: Source.h:63
void setI(double i)
Definition: Source.h:59
const std::vector< double > & getSpectralTerms() const
Definition: Source.h:51
double getQ() const
Definition: Source.h:39
void setRotationMeasure(double potationMeasure)
Definition: Source.h:72
double getI() const
Definition: Source.h:38
void setPolarizedFraction(double polarizedFraction)
Definition: Source.h:69
Source(const SourceInfo &, const std::string &patchName, double ra, double dec)
void setSpectralTerms(const std::vector< double > &spectralTerms)
Definition: Source.h:73
double getRa() const
Get right ascension in radians.
Definition: Source.h:35
double getRotationMeasure() const
Definition: Source.h:50
void setV(double v)
Definition: Source.h:62
void setParms(const std::map< std::string, parmdb::ParmValue > &defaultParameters)
double getPolarizedFraction() const
Definition: Source.h:49
const std::string & getPatchName() const
Definition: Source.h:33
void setRa(double ra)
Definition: Source.h:57
void setQ(double q)
Definition: Source.h:60
double getV() const
Definition: Source.h:41
void setU(double u)
Definition: Source.h:61
double getDec() const
Get declination in radians.
Definition: Source.h:37
const SourceInfo & getInfo() const
Get the various source parameters.
Definition: Source.h:32
void setOrientation(double orientation)
Definition: Source.h:65
double getOrientation() const
Get orientation in degrees.
Definition: Source.h:47
void setDec(double dec)
Definition: Source.h:58
double getPolarizationAngle() const
Definition: Source.h:48
double getMajorAxis() const
Get major axis in arcsec.
Definition: Source.h:43
void setPolarizationAngle(double polarizationAngle)
Definition: Source.h:66
double getMinorAxis() const
Get minor axis in arcsec.
Definition: Source.h:45
void setInfo(const SourceInfo &info)
Definition: Source.h:55
void setMinorAxis(double minorAxis)
Definition: Source.h:64
double getU() const
Definition: Source.h:40
Definition: Axis.h:19
Definition: Patch.h:14
void toSkyModel(std::ostream &output, const PatchInfo &patch)
Output a patch to a sky_model text file.