ArrivalTime.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2009 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Timing/Pulsar/ArrivalTime.h
10 
11 #ifndef __Pulsar_ArrivalTime_h
12 #define __Pulsar_ArrivalTime_h
13 
14 #include "Pulsar/Config.h"
15 #include "Pulsar/Algorithm.h"
16 #include "Estimate.h"
17 #include "toa.h"
18 
19 namespace Pulsar {
20 
21  class ProfileShiftEstimator;
22  class ShiftEstimator;
23  class Archive;
24  class Integration;
25  class Profile;
26  class Flux;
27 
29 
35  class ArrivalTime : public Algorithm {
36 
37  public:
38 
41 
43  ~ArrivalTime ();
44 
46  virtual void preprocess (Archive* archive);
47 
49  virtual void set_observation (const Archive*);
50 
52  virtual void set_standard (const Archive*);
53 
56 
59 
62 
64  void set_format (const std::string&);
65 
67  void set_format_flags (const std::string&);
68 
70  void set_attributes (const std::vector< std::string >&);
71 
73  void set_extra_text (const std::string&);
74 
76  void set_skip_bad (bool flag) { skip_bad = flag; }
77 
79  void set_positive_shifts (bool flag) { positive_shifts = flag; }
80 
82  void get_toas (std::vector<Tempo::toa>&);
83 
85  std::string get_value (const std::string& key, const Tempo::toa&);
86 
88  void set_residual (Archive* res) { residual = res; }
89 
91  Archive* get_residual () { return residual; }
92 
94  void set_flux_estimator (Flux *);
95 
97  Flux* get_flux_estimator () const;
98 
99  protected:
100 
103 
106 
109 
111 
112  Reference::To<Flux> flux_estimator;
113 
116 
119 
121  std::string format_flags;
122 
124  std::string extra_text;
125 
127  std::vector<std::string> attributes;
128  unsigned toa_subint;
129  unsigned toa_chan;
130 
132  bool skip_bad;
133 
135  bool positive_shifts {false};
136 
137  /*
138  Perhaps Tempo::toa::Format should be a base class, such that
139  each child of the class does its own formatting
140  */
141  std::string get_tempo2_aux_txt (const Tempo::toa&);
142 
143  /* Return the IPTA-specific tempo2 flags */
144  std::string get_ipta_aux_txt (const Tempo::toa&);
145 
147  virtual void get_toas (unsigned subint, std::vector<Tempo::toa>& toas);
148 
150  virtual void dress_toas (unsigned subint, std::vector<Tempo::toa>& toas);
151 
152  Tempo::toa get_toa (Estimate<double>& shift,
153  const Pulsar::Integration*, unsigned ichan);
154 
155  private:
156 
157  void standard_update (unsigned ichan=0);
158  void setup (const Integration* subint, unsigned ichan);
159 
160  };
161 
162 }
163 
164 #endif
Warning warning
Warning messages filter.
Definition: Pulsar.C:12
std::vector< std::string > attributes
for formats that support it, a list of attributes to add
Definition: ArrivalTime.h:132
Archive * get_residual()
Get the archive of residual profiles.
Definition: ArrivalTime.h:96
Algorithms that estimate phase shift from a single polarization profile.
Definition: PolnProfileShiftEstimator.h:25
virtual void dress_toas(unsigned subint, std::vector< Tempo::toa > &toas)
add any additional information as requested
Definition: ArrivalTime.C:290
Reference::To< const Archive > standard
The standard to which observations are fit.
Definition: ArrivalTime.h:110
Computes average flux of a Profile.
Definition: Flux.h:30
Angle get_parallactic_angle() const
Get the Parallactic angle at subint centre.
Definition: Pointing.C:158
Expert * expert()
Provide access to the expert interface.
Definition: Integration.C:162
std::string get_name() const
Get the name of the receiver.
Definition: Receiver.h:90
~ArrivalTime()
Destructor.
Definition: ArrivalTime.C:43
Stores information about the instrument backend.
Definition: Backend.h:26
Reference::To< Archive > residual
The residual pulse profiles (transformed observation minus standard)
Definition: ArrivalTime.h:113
float get_weight() const
get the weight of the profile
Definition: Profile.h:207
virtual void set_observation(const Archive *)
Set the observation from which the arrival times will be derived.
Definition: ArrivalTime.C:54
void set_positive_shifts(bool flag)
Output only arrival times that are greater than reference time.
Definition: ArrivalTime.h:84
ArrivalTime()
Default constructor.
Definition: ArrivalTime.C:36
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
The primary interface to pulsar observational data.
Definition: Archive.h:45
Contains information about the receiver and receiver platform.
Definition: Receiver.h:28
double get_delay() const
Get the delay.
Definition: Backend.h:93
Estimates the phase shift relative to a standard pulse profile.
Definition: ProfileStandardShift.h:24
Flux * get_flux_estimator() const
Get flux density esimtaor.
Definition: ArrivalTime.C:85
Stores Parkes Wideband Correlator parameters.
Definition: WidebandCorrelator.h:27
void set_skip_bad(bool flag)
Skip data with zero weight.
Definition: ArrivalTime.h:81
Stores PSRFITS header extensions.
Definition: FITSHdrExtension.h:25
Type * get() const
bool skip_bad
when true, skip data with zero weight
Definition: ArrivalTime.h:137
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
static Option< std::string > default_format
default TOA output format
Definition: ArrivalTime.h:120
Tempo::toa::Format format
the output TOA format
Definition: ArrivalTime.h:123
virtual double get_duration() const =0
Get the total time integrated (in seconds)
void set_shift_estimator(ShiftEstimator *)
Set the algorithm used to estimate the phase shift.
Definition: ArrivalTime.C:67
std::string get_name() const
Return the name of the Backend.
Definition: Backend.C:83
Array of Profiles integrated over the same time interval.
Definition: Integration.h:37
void set_attributes(const std::vector< std::string > &)
Set additional attributes.
Definition: ArrivalTime.C:128
void set_flux_estimator(Flux *)
Set method for computing flux density of profiles.
Definition: ArrivalTime.C:79
void set_residual(Archive *res)
Set the archive that will store residual profiles.
Definition: ArrivalTime.h:93
virtual void preprocess(Archive *archive)
Prepare the data for use.
Definition: ArrivalTime.C:48
std::string format_flags
additional format-specific flags
Definition: ArrivalTime.h:126
void rotate_phase(double phase)
Rotate each profile by phase; does not update the epoch attribute.
Definition: IntegrationExpert.h:77
Observation Information Extension.
Definition: ObsExtension.h:29
void set_format_flags(const std::string &)
Set additional format flags.
Definition: ArrivalTime.C:122
void set_format(Tempo::toa::Format)
Set the format of the output time-of-arrival estimates.
Definition: ArrivalTime.C:116
Algorithms that estimate pulse phase shifts.
Definition: ShiftEstimator.h:29
virtual void set_standard(const Archive *)
Set the standard/template used by some phase shift estimators.
Definition: ArrivalTime.C:60
Algorithms that estimate the phase shift from a single pulse profile.
Definition: ProfileShiftEstimator.h:25
Computes average flux of a Profile by fitting to a standard.
Definition: StandardFlux.h:26
const std::string get_message() const
void get_toas(std::vector< Tempo::toa > &)
Add to the vector of time-of-arrival estimates.
Definition: ArrivalTime.C:157
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void set_extra_text(const std::string &)
Set additional TOA text (only used in tempo2 format)
Definition: ArrivalTime.C:151
std::string extra_text
additional TOA line text
Definition: ArrivalTime.h:129
bool positive_shifts
when true, output arrival times that are always later than phase bin zero
Definition: ArrivalTime.h:140
Reference::To< const Archive > observation
The observation to be fit to the standard.
Definition: ArrivalTime.h:107
Alternative ways of ordering Integration instances.
Definition: IntegrationOrder.h:29
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
ShiftEstimator * get_shift_estimator() const
Get the algorithm used to estimate the phase shift.
Definition: ArrivalTime.C:73
Telescope pointing parameters recorded during the observation.
Definition: Pointing.h:27
std::string get_value(const std::string &key, const Tempo::toa &)
Get auxilliary information.
Definition: ArrivalTime.C:547

Generated using doxygen 1.8.17