Calibrator.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2003 - 2022 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Classes/Pulsar/Calibrator.h
10 
11 #ifndef __Calibrator_H
12 #define __Calibrator_H
13 
14 #include "Pulsar/Config.h"
15 
16 #include <vector>
17 
18 #include "Estimate.h"
19 #include "Jones.h"
20 #include "MJD.h"
21 
22 namespace Pulsar {
23 
24  class Archive;
25  class Integration;
26  class CalibratorExtension;
27 
29  class Calibrator : public Reference::Able
30  {
31 
32  public:
33 
35  class Type;
36 
38  static unsigned verbose;
39 
42 
45 
48 
50  Calibrator ();
51 
53  virtual ~Calibrator ();
54 
56  static unsigned get_instance_count ();
57 
59  virtual void calibrate (Archive* archive) = 0;
60 
62  virtual const Type* get_type () const;
63 
65  virtual unsigned get_nchan () const = 0;
66 
68  virtual float get_weight (unsigned ichan) const = 0;
69 
71  virtual CalibratorExtension* new_Extension () const = 0;
72 
74  Archive* new_solution (const std::string& archive_class) const;
75 
77  virtual MJD get_epoch () const;
78 
80  virtual std::string get_filenames () const;
81 
83  const Archive* get_Archive () const;
84 
86  class Info;
87 
89 
90  virtual Info* get_Info () const { return 0; }
91 
92  template<class T>
93  bool is_a () const
94  {
95  return dynamic_cast<const T*> (this) != 0;
96  }
97 
99  class Variation : public Reference::Able
100  {
101  public:
103 
104  virtual bool update (const Integration*) = 0;
105  };
106 
107  protected:
108 
111 
114  void copy_variation (Calibrator*);
115  void set_variation (Variation* var) { variation = var; }
116 
119 
121  std::vector<std::string> filenames;
122 
124  const Archive* get_calibrator () const;
125 
128 
130  virtual void set_calibrator (const Archive* archive);
131 
133  bool has_calibrator () const;
134 
135  private:
136 
138  Reference::To<const Archive> calibrator;
139 
140  };
141 
142 
147  class Calibrator::Info : public Reference::Able
148  {
149 
150  public:
151 
153  virtual ~Info () {}
154 
156  virtual std::string get_title() const = 0;
157 
159  virtual unsigned get_nchan () const = 0;
160 
162  virtual unsigned get_nclass () const = 0;
163 
165  virtual std::string get_name (unsigned iclass) const = 0;
166 
168  virtual unsigned get_nparam (unsigned iclass) const = 0;
169 
171  virtual Estimate<float> get_param (unsigned ichan, unsigned iclass,
172  unsigned iparam) const = 0;
173 
178 
180  virtual int get_colour_index (unsigned iclass, unsigned iparam) const
181  { return iparam + 1; }
182 
184  virtual int get_graph_marker (unsigned iclass, unsigned iparam) const
185  { return -1; }
186 
188 
189  };
190 
191 
192 
193 
194 }
195 
196 #endif
197 
Calibrator
Definition: Integration.h:429
Calibrator()
Default constructor.
Definition: Calibrator.C:64
virtual float get_weight(unsigned ichan) const =0
Get the weight associated with the specified channel.
virtual void calibrate(Archive *archive)=0
Calibrate the Pulsar::Archive.
virtual std::string get_name(unsigned iclass) const =0
Return the name of the specified class.
Polarization and flux calibrators.
Definition: Calibrator.h:34
virtual void set_calibrator(const Archive *archive)
Provide derived classes with access to the calibrator.
Definition: Calibrator.C:104
static Pulsar::Option< float > interpolating
Fractional bandwidth over which interpolation will be performed.
Definition: Calibrator.h:49
virtual int get_graph_marker(unsigned iclass, unsigned iparam) const
Return the graph marker.
Definition: Calibrator.h:189
bool has_calibrator() const
Return true if the calibrator attribute has been set.
Definition: Calibrator.C:86
double obsfreq
Observed Frequency.
Definition: FITSHdrExtension.h:223
const Archive * get_Archive() const
Return a const reference to the calibrator archive.
Definition: Calibrator.C:125
virtual unsigned get_nchan() const =0
Get the number of frequency channels in the calibrator.
The primary interface to pulsar observational data.
Definition: Archive.h:45
static Pulsar::Option< float > det_threshold
Tolerance to non-physical values of the coherency matrix.
Definition: Calibrator.h:52
Archive * new_solution(const std::string &archive_class) const
Return a new processed calibrator Archive with a CalibratorExtension.
Definition: Calibrator.C:142
int obsnchan
Observed number of channels.
Definition: FITSHdrExtension.h:229
Stores PSRFITS header extensions.
Definition: FITSHdrExtension.h:25
Reference::To< Type > type
The type of the Calibrator.
Definition: Calibrator.h:115
static unsigned verbose
Verbosity level.
Definition: Calibrator.h:40
virtual Estimate< float > get_param(unsigned ichan, unsigned iclass, unsigned iparam) const =0
Return the estimate of the specified parameter.
static Archive * new_Archive(const std::string &class_name)
Factory returns a null-constructed instance of the named class.
Definition: Archive.C:104
virtual std::string get_title() const =0
Return the title to print above the plot.
std::vector< std::string > filenames
Filenames of Pulsar::Archives from which instance was created.
Definition: Calibrator.h:126
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
Definition: Calibrator.h:152
virtual MJD get_epoch() const
Return the reference epoch of the calibration experiment.
Definition: Calibrator.C:134
Abstract base of classes that update model parameters.
Definition: Calibrator.h:104
virtual int get_colour_index(unsigned iclass, unsigned iparam) const
Return the colour index.
Definition: Calibrator.h:185
virtual bool update(const Integration *)=0
Update the model parameters to match the integration.
static Pulsar::Option< float > median_smoothing
Fractional bandwidth of the window used in median filter.
Definition: Calibrator.h:46
virtual CalibratorExtension * new_Extension() const =0
Return a new Calibrator Extension.
Definition: CalibratorType.h:30
virtual ~Calibrator()
Destructor.
Definition: Calibrator.C:69
virtual std::string get_filenames() const
Return a string containing the file information.
Definition: Calibrator.C:110
virtual Info * get_Info() const
Return the Calibrator::Info information.
Definition: Calibrator.h:95
const Archive * get_calibrator() const
Provide derived classes with access to the calibrator.
Definition: Calibrator.C:92
virtual unsigned get_nparam(unsigned iclass) const =0
Return the number of parameters in the specified class.
double obsbw
Observed bandwidth.
Definition: FITSHdrExtension.h:226
Reference::To< const CalibratorExtension > extension
The CalibratorExtension of the Archive passed during construction.
Definition: Calibrator.h:123
virtual unsigned get_nchan() const =0
Return the number of frequency channels.
virtual ~Info()
Destructor.
Definition: Calibrator.h:158
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Reference::To< Variation > variation
Updates model parameters.
Definition: Calibrator.h:118
virtual const Type * get_type() const
Return the Calibrator::Type of derived class.
Definition: Calibrator.C:74
static unsigned get_instance_count()
Returns the number of Calibrator instances currently in existence.
Definition: Calibrator.C:59
virtual unsigned get_nclass() const =0
Return the number of parameter classes.

Generated using doxygen 1.8.17