ManualPolnCalibrator.h
1/***************************************************************************
2 *
3 * Copyright (C) 2025 by Willem van Straten
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
13namespace Pulsar
14{
17 {
18 public:
19
21 ManualPolnCalibrator (const std::string& filename);
22
24 virtual void load (const std::string& filename);
25
27 void calibrate (Archive* archive);
28
30 void transform (Archive*);
31
34 {
35 public:
36
38
41 MJD load (const std::string& str);
42
44 void set_frequency (double f) { frequency = f; }
45
47 double get_frequency () const { return frequency; }
48
50 void set_response (const Jones<float>& J) { response = J; }
51
53 const Jones<float>& get_response () const { return response; }
54
55 protected:
56
58 double frequency = 0.0;
59
62 };
63
66 {
67 public:
68
70 void set_epoch (const MJD& mjd) { epoch = mjd; }
71
73 MJD get_epoch () const { return epoch; }
74
76 const Response& match (double freq_MHz) const;
77
79 void add (const Response& single) { response.push_back(single); }
80
81 protected:
82
85
87 std::vector<Response> response;
88 };
89
91 void add (const MJD& epoch, const Response&);
92
94 const FrequencyResponse& match (const MJD& epoch) const;
95
97 const Jones<float>& get_response (const MJD& epoch, double MHz) const;
98
99 protected:
100
102 std::vector<FrequencyResponse> response;
103
105 unsigned current_response = 0;
106
109
111 void transform_work (Archive* arch, const std::string& name, bool invert);
112 };
113}
114
115#endif
The primary interface to pulsar observational data.
Definition Archive.h:46
The frequency response for a given epoch.
Definition ManualPolnCalibrator.h:66
const Response & match(double freq_MHz) const
Return the best-matching Response object, given the frequency in MHz.
Definition ManualPolnCalibrator.C:165
void add(const Response &single)
Add a new Response object.
Definition ManualPolnCalibrator.h:79
std::vector< Response > response
The frequency response.
Definition ManualPolnCalibrator.h:87
void set_epoch(const MJD &mjd)
Set the reference epoch.
Definition ManualPolnCalibrator.h:70
MJD epoch
The reference epoch.
Definition ManualPolnCalibrator.h:84
MJD get_epoch() const
Get the reference eopch.
Definition ManualPolnCalibrator.h:73
The response at a single radio frequency.
Definition ManualPolnCalibrator.h:34
double get_frequency() const
Get the reference frequency.
Definition ManualPolnCalibrator.h:47
Jones< float > response
The response funtion.
Definition ManualPolnCalibrator.h:61
const Jones< float > & get_response() const
Get the Jones matrix.
Definition ManualPolnCalibrator.h:53
MJD load(const std::string &str)
load from string and return the epoch
Definition ManualPolnCalibrator.C:118
void set_frequency(double f)
Set the reference frequency.
Definition ManualPolnCalibrator.h:44
double frequency
The reference frequency.
Definition ManualPolnCalibrator.h:58
void set_response(const Jones< float > &J)
Set the Jones matrix.
Definition ManualPolnCalibrator.h:50
ManualPolnCalibrator(const std::string &filename)
Default Constructor loads content from specified file name.
Definition ManualPolnCalibrator.C:23
const Jones< float > & get_response(const MJD &epoch, double MHz) const
Return the Jones matrix for the given the epoch and frequency in MHz.
Definition ManualPolnCalibrator.C:192
unsigned current_response
Index of the current frequency response.
Definition ManualPolnCalibrator.h:105
const FrequencyResponse & match(const MJD &epoch) const
Return the best-matching frequency response, given the epoch.
Definition ManualPolnCalibrator.C:142
void add(const MJD &epoch, const Response &)
Add a new Response at the given epoch.
Definition ManualPolnCalibrator.C:63
void transform_work(Archive *arch, const std::string &name, bool invert)
Performs the work for calibrate and transform.
Definition ManualPolnCalibrator.C:85
void transform(Archive *)
Subject an observation to the transformation (inverse of calibration)
Definition ManualPolnCalibrator.C:80
std::string ascii_model_filename
Name of the file from which the entries were loaded.
Definition ManualPolnCalibrator.h:108
void calibrate(Archive *archive)
Calibrate the polarization of the given observation.
Definition ManualPolnCalibrator.C:75
virtual void load(const std::string &filename)
Loads content from specified file name.
Definition ManualPolnCalibrator.C:29
std::vector< FrequencyResponse > response
The frequency response as a function of epoch.
Definition ManualPolnCalibrator.h:102
PolnCalibrator(const Archive *archive=0)
Construct with optional processed calibrator Archive.
Definition PolnCalibrator.C:76
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0