T2Generator.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2007 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Util/tempo2/T2Generator.h
10 
11 #ifndef __Tempo2Generator_h
12 #define __Tempo2Generator_h
13 
14 #include "Pulsar/Generator.h"
15 
16 namespace Tempo2 {
17 
18  class Predictor;
19 
21  class Generator : public Pulsar::Generator {
22 
23  public:
24 
26  static bool print_time;
27 
29  Generator (const Pulsar::Parameters* parameters = 0);
30 
32  ~Generator ();
33 
35  Generator* clone () const;
36 
38  void set_parameters (const Pulsar::Parameters*);
39 
41  void set_time_span (const MJD& start, const MJD& finish);
42 
44  void set_time_ncoeff (unsigned ncoeff);
45 
47  void set_frequency_span (long double low, long double high);
48 
50  void set_frequency_ncoeff (unsigned ncoeff);
51 
53  void set_site (const std::string&);
54 
56  void set_segment_length (long double days);
57 
59  Pulsar::Predictor* generate () const;
60 
62  static std::vector<std::string>& get_keywords ();
63 
66 
67  private:
68 
71 
72  long double epoch1, epoch2;
73  long double freq1, freq2;
74  std::string sitename;
75  int ntimecoeff, nfreqcoeff;
76 
78  long double segment_length;
79 
80  template<typename T> void work_around_tempo2_tzr_bug (T& psr) const;
81  };
82 
83 }
84 
85 #endif
Executes a system call with multiple retries.
Definition: SystemCall.h:17
const std::string & get_directory() const
Return the temporary directory name.
Definition: TemporaryDirectory.C:35
void run(const std::string &)
Run the given command.
Definition: SystemCall.C:19
Working directory in which only one process may operate at one time.
Definition: DirectoryLock.h:18
Pulsar::Predictor * generate() const
Return a new Predictor instance.
Definition: T2Generator.C:168
A convenient exception handling class.
Definition: Error.h:54
void set_time_span(const MJD &start, const MJD &finish)
Set the range of epochs over which to generate.
Definition: T2Generator.C:127
Looks for pulsar parameters in various places.
Definition: ParametersLookup.h:24
void set_site(const std::string &)
Set the site at which the signal is observed.
Definition: T2Generator.C:141
Type * release()
Return the pointer and unhook without deleting the object.
Definition: ReferenceTo.h:218
Template class manages Reference::Able objects.
Definition: Reference.h:74
void set_time_ncoeff(unsigned ncoeff)
Set the number of time coefficients.
Definition: T2Generator.C:147
Generator of functions that predict pulse phase.
Definition: Generator.h:31
Generator * clone() const
Return a new, copy constructed instance of self.
Definition: T2Generator.C:82
void set_frequency_ncoeff(unsigned ncoeff)
Set the number of frequency coefficients.
Definition: T2Generator.C:153
Functions that predict pulse phase.
Definition: T2Predictor.h:31
void set_parameters(const Pulsar::Parameters *)
Set the parameters used to generate the predictor.
Definition: T2Generator.C:92
std::string get_param(const std::string &param, const std::string name) const
Return a single parameter from the catalogue.
Definition: ParametersLookup.C:58
void set_frequency_span(long double low, long double high)
Set the range of frequencies over which to generate.
Definition: T2Generator.C:134
Functions that predict pulse phase.
Definition: Predictor.h:33
void set_segment_length(long double days)
Set the length of each polynomial segment in days.
Definition: T2Generator.C:159
~Generator()
Destructor.
Definition: T2Generator.C:87
A configurable parameter.
Definition: Configuration.h:47
static std::vector< std::string > & get_keywords()
Return a list of keywords that are specific to tempo2.
Definition: T2Generator.C:40
static Configuration::Parameter< std::string > & get_keyword_filename()
Name of file containing list of Tempo2 keywords.
const std::string get_message() const
Get the error message.
Definition: Error.C:133
static bool print_time
Print the time required to generate the predictor.
Definition: T2Generator.h:31
Creates a temporary directory for the current user.
Definition: TemporaryDirectory.h:17
Generates a Tempo2::Predictor.
Definition: T2Generator.h:26
Class for representing modified Julian dates with high precision.
Definition: MJD.h:27
virtual void load_file(const std::string &filename)
Load from the specified file.
Definition: Predictor.C:11
Storage of pulsar parameters used to create a Predictor.
Definition: Parameters.h:28
Generator(const Pulsar::Parameters *parameters=0)
Default constructor.
Definition: T2Generator.C:67
void set_observing_frequency(long double MHz)
Set the observing frequency at which predictions will be made.
Definition: T2Predictor.C:242
Definition: DirectoryLock.h:70

Generated using doxygen 1.8.17