CalibrationInterpolator.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2022 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Polarimetry/Pulsar/CalibrationInterpolator.h
10 
11 #ifndef __CalibrationInterpolator_H
12 #define __CalibrationInterpolator_H
13 
14 #include "Pulsar/Calibrator.h"
15 #include <map>
16 
17 namespace Pulsar {
18 
19  class CalibrationInterpolatorExtension;
20  class FluxCalibratorExtension;
21  class PolnCalibratorExtension;
22  class CalibratorStokes;
23  class Integration;
24  class SplineSmooth2D;
25 
27  class CalibrationInterpolator : public Calibrator::Variation
28  {
30  void construct (Archive*);
31 
32  public:
33 
36 
39 
42 
45 
47  const Calibrator::Type* get_type () const;
48 
50  bool update (const Integration* subint)
51  { return update<Integration>(subint); }
52 
54 
55  template<class Container>
56  bool update (const Container*);
57 
58  protected:
59 
62 
65 
68 
71 
72  std::map< unsigned, Reference::To<SplineSmooth2D> > feedpar_splines;
73  std::map< unsigned, Reference::To<SplineSmooth2D> > calpoln_splines;
74  std::map< unsigned, Reference::To<SplineSmooth2D> > fluxcal_splines;
75 
76  MJD last_computed;
77 
79  bool update (const MJD& epoch, const std::vector<double>& freqs);
80  };
81 
82  template<class Container>
83  bool CalibrationInterpolator::update (const Container* container)
84  {
85  unsigned nchan = container->get_nchan();
86  std::vector<double> frequency (nchan);
87 
88  for (unsigned ichan=0; ichan<nchan; ++ichan)
89  frequency[ichan] = container->get_centre_frequency (ichan);
90 
91  return update (container->get_epoch (), frequency);
92  }
93 
94 }
95 
96 #endif
Application with basic command line options.
Definition: Application.h:30
void set_coupling_point(CouplingPoint)
Set the point where the reference source signal is coupled.
Definition: CalibratorStokes.C:49
const Calibrator::Type * get_type() const
Get the type of the calibrator.
Definition: CalibrationInterpolator.C:127
Data storage implementations.
Definition: Container.h:24
const CalibrationInterpolatorExtension * get_extension()
Get the extension from which this object was constructed.
Definition: CalibrationInterpolator.C:121
Polarization and flux calibrators.
Definition: Calibrator.h:34
const Archive * get_Archive() const
Return a const reference to the calibrator archive.
Definition: Calibrator.C:125
unsigned int get_nchan(void) const
Get the number of frequency channels.
Definition: FluxCalibratorExtension.C:65
void set_type(const Calibrator::Type *type)
Set the type of the instrumental response parameterization.
Definition: PolnCalibratorExtension.C:72
The primary interface to pulsar observational data.
Definition: Archive.h:45
Contains information about the receiver and receiver platform.
Definition: Receiver.h:28
const ScalarMath pow(const ScalarMath &x, const ScalarMath &y)
Stores the Stokes parameters of the reference source.
Definition: CalibratorStokes.h:28
Type * get() const
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
CalibrationInterpolator(Calibrator *)
Construct from a calibrator with a CalibrationInterpolatorExtension.
Definition: CalibrationInterpolator.C:34
~CalibrationInterpolator()
Destructor.
Definition: CalibrationInterpolator.C:115
Reference::To< CalibratorStokes > calpoln
The Stokes parameters of the input reference signal.
Definition: CalibrationInterpolator.h:69
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
Standard interpreter command line options.
Definition: StandardOptions.h:26
Reference::To< PolnCalibratorExtension > feedpar
The model of the feed.
Definition: CalibrationInterpolator.h:72
void set_nreceptor(unsigned nreceptor)
Set the number of receptors.
Definition: FluxCalibratorExtension.C:78
Stores PolnCalibrator parameters in an Archive instance.
Definition: PolnCalibratorExtension.h:28
bool update(const Integration *subint)
Update the model parameters to match the Integration.
Definition: CalibrationInterpolator.h:55
Solution * get_solution(unsigned c)
Get the solution for the specified frequency channel.
Definition: FluxCalibratorExtension.C:98
virtual void add(Item *)
ExtensionType * getadd()
Template method returns an Extension of the specified type.
Definition: CalibratorType.h:30
Flux Calibrator Extension.
Definition: FluxCalibratorExtension.h:28
Reference::To< const CalibrationInterpolatorExtension > interpolator
Calibration Interpolator Extension.
Definition: CalibrationInterpolator.h:66
std::string get_filename() const
Get the name of the file to which the archive will be unloaded.
Definition: Archive.h:108
Reference::To< FluxCalibratorExtension > fluxcal
The flux calibrator.
Definition: CalibrationInterpolator.h:75
const std::string get_message() const
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Stores Polarization Calibration Model Interpolator information.
Definition: CalibrationInterpolatorExtension.h:29
Unload interpreter command line options.
Definition: UnloadOptions.h:26
unsigned get_nreceptor() const
Get the number of receptors.
Definition: FluxCalibratorExtension.C:90

Generated using doxygen 1.8.17