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
22namespace 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
84
87
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
double reference_flux
Flux density in mJy.
Definition StandardCandles.h:86
double spectral_index
Spectral index.
Definition StandardCandles.h:89
Entry()
Null constructor.
Definition StandardCandles.h:95
double get_flux_mJy(double MHz)
Return the flux in mJy at the specified frequency in MHz.
Definition StandardCandles.C:168
sky_coord position
Coordinates of the flux calibrator.
Definition StandardCandles.h:80
Entry(std::string &str)
Construct from an ASCII string.
Definition StandardCandles.h:98
std::vector< double > spectral_coeffs
Stores coefficients.
Definition StandardCandles.h:92
void init()
Clean slate.
Definition StandardCandles.C:69
std::vector< std::string > source_name
Name of the flux calibrator source.
Definition StandardCandles.h:77
double reference_frequency
Reference frequency in MHz.
Definition StandardCandles.h:83
void load(const std::string &str)
load from ascii string
Definition StandardCandles.C:83
void unload(std::string &str)
unload ascii string
Definition StandardCandles.C:132
bool matches(const std::string &name) const
return true if the source name matches
Definition StandardCandles.C:159
~Entry()
Destructor.
Definition StandardCandles.C:77
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0