StandardCandles.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2004 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/General/Pulsar/StandardCandles.h
10 
11 #ifndef __Pulsar_StandardCandles_h
12 #define __Pulsar_StandardCandles_h
13 
14 #include "Pulsar/Config.h"
15 
16 #include "sky_coord.h"
17 #include "Types.h"
18 
19 #include <string>
20 #include <vector>
21 
22 namespace Pulsar {
23 
24  class StandardCandles : public Reference::Able {
25 
26  public:
27 
29  static bool verbose;
30 
32  static Option<std::string> default_filename;
33 
35  static Option<float> on_radius;
36 
38  static Option<float> off_radius;
39 
41  StandardCandles ();
42 
44  StandardCandles (const std::string& filename);
45 
47  ~StandardCandles ();
48 
50  void unload (const std::string& filename);
51 
53  void load (const std::string& filename);
54 
56  unsigned size () const { return entries.size(); }
57 
59  std::string get_filename () const { return loaded_filename; }
60 
62 
72  class Entry {
73 
74  public:
75 
77  std::vector<std::string> source_name;
78 
81 
83  double reference_frequency;
84 
86  double reference_flux;
87 
89  double spectral_index;
90 
92  std::vector<double> spectral_coeffs;
93 
95  Entry () { init(); }
96 
98  explicit Entry (std::string& str) { load(str); }
99 
101  ~Entry();
102 
104  void load (const std::string& str);
105 
107  void unload (std::string& str);
108 
110  bool matches (const std::string& name) const;
111 
113  double get_flux_mJy (double MHz);
114 
115  protected:
116 
118  void init ();
119 
120  };
121 
123  Entry match (const std::string& source, double MHz) const;
124 
126  Signal::Source guess (std::string& name, sky_coord& pos) const;
127 
129  Entry get_entry (const unsigned idx) const { return entries[idx]; }
130 
131  protected:
132 
134  std::vector<Entry> entries;
135 
137  std::string loaded_filename;
138 
139  };
140 
141 
142 }
143 
144 #endif
Warning warning
Warning messages filter.
Definition: Pulsar.C:12
bool matches(const std::string &name) const
return true if the source name matches
Definition: StandardCandles.C:159
void load(const std::string &str)
load from ascii string
Definition: StandardCandles.C:83
Entry()
Null constructor.
Definition: StandardCandles.h:105
Archive statistics text interface.
Definition: StatisticsInterface.h:25
double spectral_index
Spectral index.
Definition: StandardCandles.h:99
The primary interface to pulsar observational data.
Definition: Archive.h:45
void unload(std::string &str)
unload ascii string
Definition: StandardCandles.C:132
void add_plugin(Plugin *)
Add a plugin.
Definition: Statistics.C:267
Type * release()
double get_flux_mJy(double MHz)
Return the flux in mJy at the specified frequency in MHz.
Definition: StandardCandles.C:168
~Entry()
Destructor.
Definition: StandardCandles.C:77
Interface to a variety of useful statistics.
Definition: Statistics.h:30
Interface to polarization statistics.
Definition: PolnStatistics.h:27
double reference_flux
Flux density in mJy.
Definition: StandardCandles.h:96
bool verbose
Definition: timer++.C:25
double reference_frequency
Reference frequency in MHz.
Definition: StandardCandles.h:93
virtual std::string get_interface_name() const
static std::string get_runtime()
Return the name of the runtime directory.
Definition: Config.C:120
std::vector< double > spectral_coeffs
Stores coefficients.
Definition: StandardCandles.h:102
void init()
Clean slate.
Definition: StandardCandles.C:69
std::vector< std::string > source_name
Name of the flux calibrator source.
Definition: StandardCandles.h:87
sky_coord position
Coordinates of the flux calibrator.
Definition: StandardCandles.h:90
Defines the PSRCHIVE library.
Definition: CalSource.h:17
Standard Candle Database Entry.
Definition: StandardCandles.h:82
virtual std::string process(const std::string &command)
Pulsar data processing command language interpreter.
Definition: Interpreter.h:57

Generated using doxygen 1.8.17