ManualPolnCalibrator.h
1 /***************************************************************************
2  *
3  * Copyright (C) 2013 by Gregory Desvignes
4  * Licensed under the Academic Free License version 2.1
5  *
6  ***************************************************************************/
7 
8 #ifndef __CalibrationManualPolnCalibrator_H
9 #define __CalibrationManualPolnCalibrator_H
10 
11 #include "Pulsar/PolnCalibrator.h"
12 #include "Jones.h"
13 
14 namespace Pulsar {
15 
16  //class ReferenceCalibrator;
17  //class CalibratorStokes;
18 
20 
22  class ManualPolnCalibrator : public PolnCalibrator {
23 
24  public:
25 
27  ManualPolnCalibrator (const std::string ascii_model_filename);
28 
31 
33  //const ManualPolnCalibrator& operator = (const ManualPolnCalibrator& s);
34 
36  //ManualPolnCalibrator* clone () const;
37 
40 
41  virtual void load (const std::string& ascii_model_filename);
42 
43  // ///////////////////////////////////////////////////////////////////
44  //
45  // useful for calibrating
46  //
47  // ///////////////////////////////////////////////////////////////////
48 
50  virtual void set_response_nsub (unsigned nsub);
51 
53  virtual unsigned get_response_nsub () const;
54 
56  //virtual Jones<float> get_response (unsigned ichan) const;
57 
58  // ///////////////////////////////////////////////////////////////////
59  //
60  // Model implementation
61  //
62  // ///////////////////////////////////////////////////////////////////
63 
65  //std::string get_name () const;
66 
68  void calibrate (Archive* archive);
69 
70  class Entry {
71 
72  public:
73 
75  Entry () { init(); }
76 
78  explicit Entry (std::string& str) { load(str); }
79 
81  ~Entry();
82 
84  void load (const std::string& str);
85 
87  bool matches (const std::string& name) const;
88 
89  double ref_frequency;
90 
91  MJD ref_epoch;
92 
93  void set_response (const Jones<float> response_h) {entry_response = response_h;}
94 
95  Jones<float> get_response () {return entry_response;}
96 
97  private:
98 
99  protected:
100 
102  void init ();
103 
104  private:
105 
106  //double ref_frequency;
107 
109  //MJD ref_epoch;
110 
111  Jones<float> entry_response;
112  };
113 
114  //void set_response (const Jones<float> response_h) {response = response_h;}
115 
116  //Jones<float> get_response () {return response;}
117 
119  std::vector<Entry> match (const MJD& epoch) const;
120  const Entry& match (const MJD& epoch, double MHz) const;
121 
123  Entry get_entry (const unsigned idx) const { return entries[idx]; }
124 
125 
126  protected:
127 
129  std::vector<std::vector<Jones<float> > > response;
130 
132  std::vector<Entry> entries;
133 
134  std::vector<Entry> matches_epoch (const MJD& epoch) const;
135 
136  private:
137 
139  std::string ascii_model_filename;
140 
142  //void init ();
143 
144 
145 
146  };
147 
148 }
149 
150 #endif
151 
virtual unsigned get_npol() const =0
Get the number of polarizations.
void calibrate(Archive *archive)
Return the system response for the specified channel.
Definition: ManualPolnCalibrator.C:94
virtual MJD get_epoch() const =0
Get the epoch of the rising edge of bin zero.
double get_centre_frequency(unsigned ichan) const
Get the Profile centre frequency attribute of the given channel.
Definition: Integration.C:359
virtual unsigned get_nsubint() const =0
Get the number of sub-integrations stored in the file.
~ManualPolnCalibrator()
Assignment Operator.
Definition: ManualPolnCalibrator.C:34
The primary interface to pulsar observational data.
Definition: Archive.h:45
std::vector< Entry > match(const MJD &epoch) const
Returns the best match, given the source name and centre frequency.
Definition: ManualPolnCalibrator.C:238
ManualPolnCalibrator(const std::string ascii_model_filename)
Default Constructor.
Definition: ManualPolnCalibrator.C:20
virtual void set_response_nsub(unsigned nsub)
Set the number of frequency channels in the response array.
Definition: ManualPolnCalibrator.C:39
virtual unsigned get_nchan() const =0
Get the number of frequency channels used.
virtual void set_poln_calibrated(bool done=true)=0
Set the value to be returned by get_poln_calibrated.
virtual Signal::State get_state() const =0
Get the state of the profile data.
Integration * get_Integration(unsigned subint)
Return pointer to the specified Integration.
Definition: IntegrationManager.C:41
virtual std::string get_telescope() const =0
Get the name of the telescope used.
virtual Jones< float > get_response(unsigned ichan) const
Return the system response for the specified channel.
Definition: PolnCalibrator.C:181
std::vector< Entry > matches_epoch(const MJD &epoch) const
Return true if the source name matches.
Definition: ManualPolnCalibrator.C:200
Phenomenological description of the instrument.
Definition: ManualPolnCalibrator.h:27
virtual unsigned get_response_nsub() const
Get the number of frequency channels in the response array.
Definition: ManualPolnCalibrator.C:45
Defines the PSRCHIVE library.
Definition: CalSource.h:17
std::vector< Entry > entries
vector of entries in the database
Definition: ManualPolnCalibrator.h:142
Entry get_entry(const unsigned idx) const
Returns a given entry.
Definition: ManualPolnCalibrator.h:133
void transform(const Jones< float > &)
Perform the transformation on each polarimetric profile.
Definition: Archive_transform.C:15

Generated using doxygen 1.8.17