37 static const float UNSET;
73 std::string telescope;
122 toa (
Format fmt = Psrclock);
123 virtual ~toa () { destroy(); };
126 toa (
const toa & in_toa);
127 toa& operator = (
const toa & in_toa);
130 toa (FILE* instream);
136 void set_format (
Format fmt) { format = fmt; };
137 void set_StoN (
float sn) { ston = sn; };
138 void set_pa (
float p) { pa = p; };
139 void set_bw (
float b) { bw = b; };
140 void set_dur (
float d) { dur = d; };
141 void set_dm (
float d) { dm = d; };
142 void set_state (State st) { state = st; };
144 void set_frequency (
double freq) { frequency = freq; };
145 void set_arrival (
MJD arrived) { arrival = arrived; };
146 void set_error (
float err) { error = err; };
147 void set_reduced_chisq (
float x) { reduced_chisq = x; }
150 void set_telescope (
const std::string& telcode);
151 void set_auxilliary_text (
const std::string& text) { auxinfo = text; };
152 void set_channel (
unsigned chan) { channel = chan; };
153 void set_subint (
unsigned sub) { subint = sub; };
154 void set_phase_shift (
double shift) { phase_shift =
shift; };
155 void set_phase_info (
bool info) { phase_info = info; };
157 Format get_format ()
const {
return format; };
158 float get_StoN ()
const {
return ston; };
159 float get_pa ()
const {
return pa; };
160 float get_bw ()
const {
return bw; };
161 float get_dur ()
const {
return dur; };
162 float get_dm ()
const {
return dm; };
163 State get_state ()
const {
return state; };
165 double get_frequency ()
const {
return frequency; };
166 MJD get_arrival ()
const {
return arrival; };
167 float get_error ()
const {
return error; };
168 float get_reduced_chisq ()
const {
return reduced_chisq; }
171 std::string get_telescope ()
const {
return telescope; };
172 std::string get_auxilliary_text ()
const {
return auxinfo; };
173 double get_phase_shift ()
const {
return phase_shift; };
174 unsigned get_channel ()
const {
return channel; };
175 unsigned get_subint ()
const {
return subint; };
179 int load (FILE* instream);
180 int load (
const char* instring);
181 int unload (FILE* outstream,
Format fmt = Unspecified)
const;
182 int unload (
char* outstring,
Format fmt = Unspecified)
const;
184 int parkes_parse (
const char* instring);
185 int parkes_out (
char* outstring)
const;
186 int Parkes_load (
const char* instring);
187 int Parkes_unload (FILE* outstream)
const;
188 int Parkes_unload (
char* outstring)
const;
190 int Princeton_load (
const char* instring);
191 int Princeton_unload (FILE* outstream)
const;
192 int Princeton_unload (
char* outstring)
const;
194 int Psrclock_load (
const char* instring);
195 int Psrclock_unload (FILE* outstream)
const;
196 int Psrclock_unload (
char* outstring)
const;
198 std::string Psrclock_unload ()
const;
200 int Command_load (
const char* instring);
201 int Command_unload (FILE* outstream)
const;
202 int Command_unload (
char* outstring)
const;
204 int Comment_unload (FILE* outstream)
const;
205 int Comment_unload (
char* outstring)
const;
209 int Tempo2_unload (FILE* outstream)
const;
210 int Tempo2_unload (
char* outstring)
const;
212 int Tempo_unload (FILE* outstream)
const;
213 int Tempo_unload (
char* outstring)
const;
216 friend int operator < (
const toa& t1,
const toa& t2)
217 {
return (t1.arrival < t2.arrival); };
220 static int load (
const char* filename, std::vector<toa>* toas);
221 static int load (FILE* instream, std::vector<toa>* toas);
223 static int unload (
const char* filename,
const std::vector<toa>& toas,
224 Format fmt = Unspecified);
225 static int unload (FILE* outstream,
const std::vector<toa>& toas,
226 Format fmt = Unspecified);
234 static void sizebuf (
size_t length);
237 static char datestr [25];
240 std::ostream& operator << (std::ostream&,
toa::Format format);
241 std::istream& operator >> (std::istream&,
toa::Format& format);