Predict.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/Util/tempo/Predict.h
10 
11 #ifndef __Tempo_Predict_h
12 #define __Tempo_Predict_h
13 
14 #include "Pulsar/Generator.h"
15 #include "Configuration.h"
16 #include "polyco.h"
17 
18 namespace Tempo {
19 
21  class Predict : public Pulsar::Generator {
22 
23  public:
24 
27 
30 
33 
34  //
35  // Pulsar::Generator interface
36  //
37 
39  Predict* clone () const;
40 
42  void set_parameters (const Pulsar::Parameters*);
43 
45  void set_time_span (const MJD& start, const MJD& finish);
46 
48  void set_frequency_span (long double low, long double high);
49 
51  void set_site (const std::string&);
52 
54  Pulsar::Predictor* generate () const;
55 
56  //
57  // Original interface
58  //
59 
61 
62  void set_asite (char code);
63 
65 
66  void set_frequency (double MHz);
67 
69 
70  void set_maxha (unsigned hours);
71 
73 
74  void set_nspan (unsigned minutes);
75 
77 
78  void set_ncoef (unsigned ncoef);
79 
81  void set_verify (bool verify);
82 
84  polyco get_polyco (const MJD& m1, const MJD& m2);
85 
87  void write_tzin () const;
88 
89  protected:
90 
92  char asite;
93 
95  double frequency;
96 
98  unsigned maxha;
99 
101  unsigned nspan;
102 
104  unsigned ncoef;
105 
108 
110  std::string psrname;
111 
113  bool verify;
114 
115  MJD m1, m2;
116 
118  polyco generate_work () const;
119 
120  private:
121 
124 
125 
126  };
127 
128 }
129 
130 #endif
void set_asite(char code)
Set the observatory site code.
Definition: Predict.C:77
std::string psrname
The pulsar name.
Definition: Predict.h:120
const std::string & get_directory() const
Return the temporary directory name.
Definition: TemporaryDirectory.C:35
bool verify
Verify the time spanned by polynomial ephemerides.
Definition: Predict.h:123
void set_site(const std::string &)
Set the site at which the signal is observed.
Definition: Predict.C:72
Working directory in which only one process may operate at one time.
Definition: DirectoryLock.h:18
double frequency
The observing frequency in MHz.
Definition: Predict.h:105
void set_ncoef(unsigned ncoef)
Set the number of coefficients per polynomial ephemeris.
Definition: Predict.C:121
void set_nspan(unsigned minutes)
Set the time spanned by each polynomial ephemeris.
Definition: Predict.C:104
Interface to Tempo.
Definition: fit.C:21
void set_time_span(const MJD &start, const MJD &finish)
Set the range of epochs over which to generate.
Definition: Predict.C:59
Pulsar::Predictor * generate() const
Return a new Predictor instance.
Definition: Predict.C:244
static Configuration::Parameter< double > & get_maximum_rms()
The maximum rms allowed, in turns.
A convenient exception handling class.
Definition: Error.h:54
unsigned ncoef
The number of coefficients per polynomial ephemeris.
Definition: Predict.h:114
char asite
The observatory site code.
Definition: Predict.h:102
void set_verify(bool verify)
Set flag to verify time spanned by polynomial ephemerides.
Definition: Predict.C:184
static Configuration::Parameter< unsigned > & get_minimum_nspan()
The minimum value of nspan allowed.
unsigned maxha
The maximum hour angle of observations in hours.
Definition: Predict.h:108
Stores keyword-value pairs from a configuration file.
Definition: Configuration.h:26
char code(const std::string &telescope_name)
Convert a telescope name to a single-character tempo code.
Definition: tempo++.C:167
Type * release()
Return the pointer and unhook without deleting the object.
Definition: ReferenceTo.h:218
void set_maxha(unsigned hours)
Set the maximum hour angle of observations.
Definition: Predict.C:96
polyco generate_work() const
Does the work for the two different interfaces.
Definition: Predict.C:254
Uses tempo orediction mode to produce polynomial ephemerides (polyco)
Definition: Predict.h:26
void set_parameters(const Pulsar::Parameters *)
Set the parameters used to generate the predictor.
Definition: Predict.C:130
void set_frequency(double MHz)
Set the observing frequency.
Definition: Predict.C:88
Reference::To< const Pulsar::Parameters > parameters
The pulsar parameters.
Definition: Predict.h:117
Stores pulsar parameters as uninterpreted text.
Definition: TextParameters.h:24
std::string get_value(const std::string &keyword) const
Retrieve a string from the text.
Definition: TextParameters.C:85
Generator of functions that predict pulse phase.
Definition: Generator.h:31
void set_frequency_span(long double low, long double high)
Set the range of frequencies over which to generate.
Definition: Predict.C:66
Predict * clone() const
Return a new, copy constructed instance of self.
Definition: Predict.C:53
Handles warning messages in a standardized fashion.
Definition: Warning.h:34
Predict(const Pulsar::Parameters *parameters=0)
Default constructor.
polyco get_polyco(const MJD &m1, const MJD &m2)
Returns a polyco valid over the range in MJD specified by m1 and m2.
Definition: Predict.C:235
Functions that predict pulse phase.
Definition: Predictor.h:33
void write_tzin() const
Write the tz.in file according to the tempo definition.
Definition: Predict.C:207
A configurable parameter.
Definition: Configuration.h:47
virtual std::string get_name() const
Return the pulsar name.
Definition: Parameters.C:34
Creates a temporary directory for the current user.
Definition: TemporaryDirectory.h:17
Class for representing modified Julian dates with high precision.
Definition: MJD.h:27
void tempo(const std::string &arguments, const std::string &input)
Run tempo using the given arguments and input.
Definition: tempo++.C:140
Implements Predictor class for Tempo.
Definition: polyco.h:202
Storage of pulsar parameters used to create a Predictor.
Definition: Parameters.h:28
unsigned nspan
The time spanned by each polynomial ephemeris in minutes.
Definition: Predict.h:111
Definition: DirectoryLock.h:70

Generated using doxygen 1.8.17