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 "Pulsar/Dispersion.h"
17#include "Estimate.h"
18#include "toa.h"
19
20namespace Pulsar {
21
23 class MeanArrivalTime;
24 class ShiftEstimator;
25 class Archive;
26 class Integration;
27 class Profile;
28 class Flux;
29 class Backend;
30
32
37
38 class ArrivalTime : public Algorithm {
39
40 public:
41
43 ArrivalTime ();
44
46 ~ArrivalTime ();
47
49 virtual void preprocess (Archive* archive);
50
52 virtual void set_observation (const Archive*);
53
55 virtual void set_standard (const Archive*);
56
59
62
65
68
71
73 void set_format (const std::string&);
74
76 void set_format_flags (const std::string&);
77
79 void set_attributes (const std::vector< std::string >&);
80
82 void set_extra_text (const std::string&);
83
85 void set_skip_bad (bool flag) { skip_bad = flag; }
86
88 void set_positive_shifts (bool flag) { positive_shifts = flag; }
89
91 double get_reference_frequency (const Integration* subint, unsigned ichan) const;
92
94 void get_toas (std::vector<Tempo::toa>&);
95
97 std::string get_value (const std::string& key, const Tempo::toa&);
98
100 void set_residual (Archive* res) { residual = res; }
101
104
106 void set_flux_estimator (Flux *);
107
109 Flux* get_flux_estimator () const;
110
111 protected:
112
115
118
121
124
125 Reference::To<ShiftEstimator> shift_estimator;
126
127 Reference::To<Flux> flux_estimator;
128
129 Reference::To<MeanArrivalTime> mean_arrival_time;
130
133
136
138 std::string format_flags;
139
141 std::string extra_text;
142
144 std::vector<std::string> attributes;
145 unsigned toa_subint;
146 unsigned toa_chan;
147
150
152 bool positive_shifts {false};
153
154 /*
155 Perhaps Tempo::toa::Format should be a base class, such that
156 each child of the class does its own formatting
157 */
158 std::string get_tempo2_aux_txt (const Tempo::toa&);
159
160 /* Return the IPTA-specific tempo2 flags */
161 std::string get_ipta_aux_txt (const Tempo::toa&);
162
164 virtual void get_toas (unsigned subint, std::vector<Tempo::toa>& toas);
165
167 virtual void dress_toas (unsigned subint, std::vector<Tempo::toa>& toas);
168
169 Tempo::toa get_toa (Estimate<double>& shift,
170 const Pulsar::Integration*, unsigned ichan);
171
172 Tempo::toa get_toa (Estimate<double>& shift, double reference_frequency,
173 const Pulsar::Integration*, unsigned ichan = 0);
174
176 void get_subband_toas (const Integration* subint, std::vector<Tempo::toa>& toas);
177 Dispersion dispersion;
178
179 private:
180
181 void standard_update (unsigned ichan=0);
182 void setup (const Integration* subint, unsigned ichan);
183
184 };
185
186}
187
188#endif
Data manipulation implementations.
Definition Algorithm.h:19
The primary interface to pulsar observational data.
Definition Archive.h:46
MeanArrivalTime * get_mean_estimator() const
Get the algorithm used to estimate the phase shift.
Definition ArrivalTime.C:87
virtual void set_observation(const Archive *)
Set the observation from which the arrival times will be derived.
Definition ArrivalTime.C:56
Tempo::toa::Format format
the output TOA format
Definition ArrivalTime.h:135
void set_flux_estimator(Flux *)
Set method for computing flux density of profiles.
Definition ArrivalTime.C:93
std::string get_value(const std::string &key, const Tempo::toa &)
Get auxilliary information.
Definition ArrivalTime.C:659
~ArrivalTime()
Destructor.
Definition ArrivalTime.C:45
virtual void set_standard(const Archive *)
Set the standard/template used by some phase shift estimators.
Definition ArrivalTime.C:62
Reference::To< const Archive > standard
The standard to which observations are fit.
Definition ArrivalTime.h:117
void set_positive_shifts(bool flag)
Output only arrival times that are greater than reference time.
Definition ArrivalTime.h:88
void set_format(Tempo::toa::Format)
Set the format of the output time-of-arrival estimates.
Definition ArrivalTime.C:129
void get_toas(std::vector< Tempo::toa > &)
Add to the vector of time-of-arrival estimates.
Definition ArrivalTime.C:169
void set_residual(Archive *res)
Set the archive that will store residual profiles.
Definition ArrivalTime.h:100
void set_mean_estimator(MeanArrivalTime *)
Set the algorithm used to estimate the average arrival time.
Definition ArrivalTime.C:81
void get_subband_toas(const Integration *subint, std::vector< Tempo::toa > &toas)
Adds to the vector of toas.
Definition ArrivalTime.C:227
ShiftEstimator * get_shift_estimator() const
Get the algorithm used to estimate the phase shift.
Definition ArrivalTime.C:75
void set_shift_estimator(ShiftEstimator *)
Set the algorithm used to estimate the phase shift.
Definition ArrivalTime.C:69
bool skip_bad
when true, skip data with zero weight
Definition ArrivalTime.h:149
Reference::To< Archive > residual
The residual pulse profiles (transformed observation minus standard)
Definition ArrivalTime.h:123
bool positive_shifts
when true, output arrival times that are always later than phase bin zero
Definition ArrivalTime.h:152
double get_reference_frequency(const Integration *subint, unsigned ichan) const
Get the reference frequency for the specified channel.
Definition ArrivalTime.C:205
void set_format_flags(const std::string &)
Set additional format flags.
Definition ArrivalTime.C:135
void set_attributes(const std::vector< std::string > &)
Set additional attributes.
Definition ArrivalTime.C:141
Reference::To< const Backend > backend
Any backend delay correction, if known.
Definition ArrivalTime.h:120
void set_skip_bad(bool flag)
Skip data with zero weight.
Definition ArrivalTime.h:85
std::string format_flags
additional format-specific flags
Definition ArrivalTime.h:138
Reference::To< const Archive > observation
The observation to be fit to the standard.
Definition ArrivalTime.h:114
std::string extra_text
additional TOA line text
Definition ArrivalTime.h:141
virtual void dress_toas(unsigned subint, std::vector< Tempo::toa > &toas)
add any additional information as requested
Definition ArrivalTime.C:393
Flux * get_flux_estimator() const
Get flux density esimtaor.
Definition ArrivalTime.C:99
void set_extra_text(const std::string &)
Set additional TOA text (only used in tempo2 format)
Definition ArrivalTime.C:163
virtual void preprocess(Archive *archive)
Prepare the data for use.
Definition ArrivalTime.C:50
ArrivalTime()
Default constructor.
Definition ArrivalTime.C:38
Archive * get_residual()
Get the archive of residual profiles.
Definition ArrivalTime.h:103
std::vector< std::string > attributes
for formats that support it, a list of attributes to add
Definition ArrivalTime.h:144
static Option< std::string > default_format
default TOA output format
Definition ArrivalTime.h:132
Stores information about the instrument backend.
Definition Backend.h:21
Corrects dispersive delays.
Definition Dispersion.h:28
Computes average flux of a Profile.
Definition Flux.h:26
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
Computes inverse-variance weighted mean frequency and arrival time, with optional delta-DM.
Definition MeanArrivalTime.h:24
Configuration option.
Definition Config.h:69
Algorithms that estimate the phase shift from a single pulse profile.
Definition ProfileShiftEstimator.h:21
Any quantity recorded as a function of pulse phase.
Definition Profile.h:40
Algorithms that estimate pulse phase shifts.
Definition ShiftEstimator.h:25
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0