DP3
VdsPartDesc.h
Go to the documentation of this file.
1 // VdsPartDesc.h: Description of a visibility data set or part thereof
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_LMWCOMMON_VDSPARTDESC_H
11 #define LOFAR_LMWCOMMON_VDSPARTDESC_H
12 
13 #include "ParameterSet.h"
14 
15 #include <string>
16 #include <vector>
17 #include <iosfwd>
18 
19 namespace dp3 {
20 namespace common {
21 
24 
30 //
33 //
35 
36 class VdsPartDesc {
37  public:
39  VdsPartDesc() : itsStartTime(0), itsEndTime(1), itsStepTime(1) {}
40 
42  explicit VdsPartDesc(const ParameterSet&);
43 
45  void setName(const std::string& name, const std::string& fileSys);
46 
48  void setFileName(const std::string& name) { itsFileName = name; }
49 
51  void setClusterDescName(const std::string& cdName) { itsCDescName = cdName; }
52 
54  void changeBaseName(const std::string& newBaseName);
55 
58  void setTimes(double startTime, double endTime, double stepTime,
59  const std::vector<double>& starts = std::vector<double>(),
60  const std::vector<double>& ends = std::vector<double>());
61 
64  void addBand(int nchan, double startFreq, double endFreq);
65  void addBand(int nchan, const std::vector<double>& startFreq,
66  const std::vector<double>& endFreq);
68 
71  void addParm(const std::string& key, const std::string& value) {
72  return itsParms.add(key, value);
73  }
74 
76  const ParameterSet& getParms() const { return itsParms; }
77 
79  void clearParms() { itsParms.clear(); }
80 
82  void write(std::ostream& os, const std::string& prefix) const;
83 
86  const std::string& getName() const { return itsName; }
87  const std::string& getFileName() const { return itsFileName; }
88  const std::string& getFileSys() const { return itsFileSys; }
89  const std::string& getClusterDescName() const { return itsCDescName; }
90  double getStartTime() const { return itsStartTime; }
91  double getEndTime() const { return itsEndTime; }
92  double getStepTime() const { return itsStepTime; }
93  const std::vector<double>& getStartTimes() const { return itsStartTimes; }
94  const std::vector<double>& getEndTimes() const { return itsEndTimes; }
95  int getNBand() const { return itsNChan.size(); }
96  const std::vector<int>& getNChan() const { return itsNChan; }
97  const std::vector<double>& getStartFreqs() const { return itsStartFreqs; }
98  const std::vector<double>& getEndFreqs() const { return itsEndFreqs; }
100 
101  private:
102  std::string itsName;
103  std::string itsFileName;
104  std::string itsFileSys;
105  std::string itsCDescName;
106  double itsStartTime;
107  double itsEndTime;
108  double itsStepTime;
109  std::vector<double> itsStartTimes;
110  std::vector<double> itsEndTimes;
111  std::vector<int32_t> itsNChan;
112  std::vector<double> itsStartFreqs;
113  std::vector<double> itsEndFreqs;
114  ParameterSet itsParms;
115 };
116 
117 } // namespace common
118 } // namespace dp3
119 
120 #endif
Implements a map of Key-Value pairs.
Definition: ParameterSet.h:28
void add(const std::string &aKey, const std::string &aValue)
Definition: ParameterSet.h:422
void clear()
Clear the set.
Definition: ParameterSet.h:378
Description of a visibility data set or part thereof.
Definition: VdsPartDesc.h:36
void setFileName(const std::string &name)
Set the original file name.
Definition: VdsPartDesc.h:48
void addParm(const std::string &key, const std::string &value)
Definition: VdsPartDesc.h:71
VdsPartDesc()
Construct an empty object.
Definition: VdsPartDesc.h:39
const std::string & getFileSys() const
Definition: VdsPartDesc.h:88
const ParameterSet & getParms() const
Get access to the extra parameters.
Definition: VdsPartDesc.h:76
void write(std::ostream &os, const std::string &prefix) const
Write the VdsPartDesc object in parset format.
const std::string & getFileName() const
Definition: VdsPartDesc.h:87
const std::vector< double > & getEndFreqs() const
Definition: VdsPartDesc.h:98
const std::string & getName() const
Definition: VdsPartDesc.h:86
void setTimes(double startTime, double endTime, double stepTime, const std::vector< double > &starts=std::vector< double >(), const std::vector< double > &ends=std::vector< double >())
const std::vector< double > & getStartFreqs() const
Definition: VdsPartDesc.h:97
void setClusterDescName(const std::string &cdName)
Set the name of the ClusterDesc file used.
Definition: VdsPartDesc.h:51
void changeBaseName(const std::string &newBaseName)
Change the base part of the name.
int getNBand() const
Definition: VdsPartDesc.h:95
double getEndTime() const
Definition: VdsPartDesc.h:91
void setName(const std::string &name, const std::string &fileSys)
Set VDS name and file system.
double getStepTime() const
Definition: VdsPartDesc.h:92
void clearParms()
Clear the extra parameters.
Definition: VdsPartDesc.h:79
const std::vector< double > & getStartTimes() const
Definition: VdsPartDesc.h:93
double getStartTime() const
Definition: VdsPartDesc.h:90
VdsPartDesc(const ParameterSet &)
Construct from the given parameterset.
void addBand(int nchan, double startFreq, double endFreq)
const std::vector< int > & getNChan() const
Definition: VdsPartDesc.h:96
void addBand(int nchan, const std::vector< double > &startFreq, const std::vector< double > &endFreq)
const std::vector< double > & getEndTimes() const
Definition: VdsPartDesc.h:94
const std::string & getClusterDescName() const
Definition: VdsPartDesc.h:89
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53