CalibratorExtension.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2003-2009 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Extensions/Pulsar/CalibratorExtension.h
10 
11 #ifndef __CalibratorExtension_h
12 #define __CalibratorExtension_h
13 
14 #include "Pulsar/HasChannels.h"
15 #include "Pulsar/CalibratorType.h"
16 
17 namespace Pulsar {
18 
20 
22  class CalibratorExtension : public HasChannels
23  {
24  public:
25 
27  CalibratorExtension (const char* name = "CalibratorExtension");
28 
31 
34 
37 
39  CalibratorExtension* clone () const
40  { return new CalibratorExtension( *this ); }
41 
43  void build (const Calibrator*);
44 
46  virtual void set_type (const Calibrator::Type* type);
48  virtual const Calibrator::Type* get_type () const;
49 
51  virtual void set_epoch (const MJD& epoch);
53  virtual MJD get_epoch () const;
54 
56  virtual void set_nchan (unsigned nchan);
58  virtual unsigned get_nchan () const;
59 
61  virtual void remove_chan (unsigned first, unsigned last);
62 
64  virtual void set_weight (unsigned ichan, float weight);
66  virtual float get_weight (unsigned ichan) const;
67 
69  virtual void set_centre_frequency (unsigned ichan, double frequency);
71  virtual double get_centre_frequency (unsigned ichan) const;
72 
74  std::string get_short_name () const { return "cal"; }
75 
76  class Interface;
77 
80 
82  void frequency_append (Archive* to, const Archive* from);
83 
84  protected:
85 
88 
90  MJD epoch;
91 
93  std::vector<float> weight;
94 
96  std::vector<double> centre_frequency;
97 
99  void range_check (unsigned ichan, const char* method) const;
100 
102  void frequency_append (const CalibratorExtension*, bool in_order);
103 
104  };
105 
106 
107 }
108 
109 #endif
void add(T(P::*get)() const, const char *name, const char *description=0)
virtual double get_centre_frequency(unsigned ichan) const
Get the centre frequency of the specified channel.
Definition: CalibratorExtension.C:101
Polarization and flux calibrators.
Definition: Calibrator.h:34
void range_check(unsigned ichan, const char *method) const
Ensure that ichan < get_nchan.
Definition: CalibratorExtension.C:113
virtual void set_type(const Calibrator::Type *type)
Set the type of the calibrator.
Definition: CalibratorExtension.C:48
virtual unsigned get_nchan() const
Get the number of frequency channels.
Definition: CalibratorExtension.C:83
virtual const Calibrator::Type * get_type() const
Get the type of the calibrator.
Definition: CalibratorExtension.C:53
virtual void set_nchan(unsigned nchan)
Set the number of frequency channels.
Definition: CalibratorExtension.C:70
The primary interface to pulsar observational data.
Definition: Archive.h:45
TextInterface::Parser * get_interface()
Return a text interfaces that can be used to access this instance.
Definition: CalibratorExtension.C:175
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
virtual void set_weight(unsigned ichan, float weight)
Set the weight of the specified channel.
Definition: CalibratorExtension.C:94
Text interface to CalibratorExtension extension.
Definition: CalibratorExtensionInterface.h:25
Text interface to Calibrator::Type class.
Definition: CalibratorTypeInterface.h:25
virtual void remove_chan(unsigned first, unsigned last)
Remove the inclusive range of channels.
Definition: CalibratorExtension.C:76
Reference::To< const Calibrator::Type > type
Type of the calibrator.
Definition: CalibratorExtension.h:97
~CalibratorExtension()
Destructor.
Definition: CalibratorExtension.C:44
virtual MJD get_epoch() const
Get the reference epoch of the calibration experiment.
Definition: CalibratorExtension.C:58
Definition: CalibratorType.h:30
virtual void set_epoch(const MJD &epoch)
Set the reference epoch of the calibration experiment.
Definition: CalibratorExtension.C:63
virtual void set_centre_frequency(unsigned ichan, double frequency)
Set the centre frequency of the specified channel.
Definition: CalibratorExtension.C:107
void frequency_append(Archive *to, const Archive *from)
Append Calibrator Extension data from another Archive.
Definition: CalibratorExtension.C:121
Stores Calibrator parameters in an Archive.
Definition: CalibratorExtension.h:27
Archive extensions that contain information for each frequency channel.
Definition: HasChannels.h:25
const CalibratorExtension & operator=(const CalibratorExtension &)
Operator =.
Definition: CalibratorExtension.C:30
CalibratorExtension * clone() const
Clone method.
Definition: CalibratorExtension.h:49
bool in_frequency_order(const Archive *A, const Archive *B)
Return true if A precedes B in frequency order of channels.
Definition: Archive.C:364
Defines the PSRCHIVE library.
Definition: CalSource.h:17
virtual float get_weight(unsigned ichan) const
Get the weight of the specified channel.
Definition: CalibratorExtension.C:88
void add_value(Value *value)
std::vector< float > weight
The weight of each channel.
Definition: CalibratorExtension.h:103
std::string get_short_name() const
Return a short name.
Definition: CalibratorExtension.h:84
CalibratorExtension(const char *name="CalibratorExtension")
Default constructor.
Definition: CalibratorExtension.C:16
void build(const Calibrator *)
Construct from a Calibrator instance.
Definition: CalibratorExtension_build.C:14
std::vector< double > centre_frequency
The centre frequency of each channel.
Definition: CalibratorExtension.h:106
MJD epoch
The reference epoch of the calibration experiment.
Definition: CalibratorExtension.h:100

Generated using doxygen 1.8.17