EPNArchive.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/Base/Formats/EPN/Pulsar/EPNArchive.h
10
11#ifndef __EPN_Archive_h
12#define __EPN_Archive_h
13
14#include "Pulsar/Archive.h"
15#include "Pulsar/Agent.h"
16#include "epnio.h"
17
18namespace Pulsar {
19
21 class EPNArchive : public Archive {
22
23 public:
24
26 EPNArchive ();
27
29 EPNArchive (const EPNArchive& archive);
30
32 ~EPNArchive ();
33
35 const EPNArchive& operator = (const EPNArchive& archive);
36
38 EPNArchive (const Archive& archive);
39
41 void copy (const Archive& archive);
42
43 // //////////////////////////////////////////////////////////////////
44 //
45 // implement the pure virtual methods of the Archive base class
46 //
47
49 EPNArchive* clone () const;
50
52 std::string get_telescope () const;
54 void set_telescope (const std::string&);
55
57 Signal::State get_state () const;
60
62 Signal::Scale get_scale () const;
64 void set_scale (Signal::Scale scale);
65
67 Signal::Source get_type () const;
69 void set_type (Signal::Source type);
70
72 std::string get_source () const;
74 void set_source (const std::string& source);
75
79 void set_coordinates (const sky_coord& coordinates);
80
82
83 unsigned get_nbin () const;
84
86
87 unsigned get_nchan () const;
88
90
91 unsigned get_npol () const;
92
94
95 unsigned get_nsubint () const;
96
98 double get_bandwidth () const;
100 void set_bandwidth (double bw);
101
103 double get_centre_frequency () const;
105 void set_centre_frequency (double cf);
106
108 double get_dispersion_measure () const;
110 void set_dispersion_measure (double dm);
111
113 double get_rotation_measure () const;
115 void set_rotation_measure (double rm);
116
118 bool get_dedispersed () const;
120 void set_dedispersed (bool done = true);
121
123 bool get_faraday_corrected () const;
125 void set_faraday_corrected (bool done = true);
126
128 bool get_poln_calibrated () const;
130 void set_poln_calibrated (bool done = true);
131
132 protected:
133
134 friend class Archive::Advocate<EPNArchive>;
135
136 // Advocates the use of the EPNArchive plugin
137 class Agent : public Archive::Advocate<EPNArchive> {
138
139 public:
140
142 Agent () {}
143
145 bool advocate (const char* filename);
146
148 std::string get_name () { return "EPN"; }
149
151 std::string get_description ();
152
153 };
154
156 void load_header (const char* filename);
157
159 Integration* load_Integration (const char* filename, unsigned subint);
160
162 bool can_unload () const { return false; }
163
165 void unload_file (const char* filename) const;
166
170
171 epn_header_line1 line1;
172
173 epn_header_line2 line2;
174
175 epn_header_line3 line3;
176
177 epn_header_line4 line4;
178
179 epn_header_line5 line5;
180
181 epn_block_subheader_line1 sub_line1;
182
183 epn_block_subheader_line2 sub_line2;
184
185 epn_data_block data;
186
188
190
193
195 double bandwidth;
196
199
201 unsigned nsubint;
202
204 virtual void set_nbin (unsigned numbins);
205
207 virtual void set_nchan (unsigned numchan);
208
210 virtual void set_npol (unsigned numpol);
211
213 virtual void set_nsubint (unsigned nsubint);
214
216 virtual Integration* new_Integration (const Integration* copy_this = 0);
217
219 void init();
220
222 void read_record (const char* filename, unsigned record);
223
224 };
225
226
227
228}
229
230#endif
Archive()
Default constructor.
Definition Archive.C:67
void set_rotation_measure(double rm)
Set the rotation measure (in )
Definition EPNArchive.C:295
std::string get_telescope() const
Get the telescope name.
Definition EPNArchive.C:98
virtual Integration * new_Integration(const Integration *copy_this=0)
The subints vector will point to BasicIntegrations.
Definition EPNArchive.C:337
unsigned get_nchan() const
Get the number of frequency channels used.
Definition EPNArchive.C:175
epn_header_line4 line4
The centre frequency.
Definition EPNArchive.h:177
Integration * load_Integration(const char *filename, unsigned subint)
Load the specified Integration from filename, returning new instance.
Definition EPNArchive.C:434
void set_centre_frequency(double cf)
Set the centre frequency of the observation.
Definition EPNArchive.C:227
virtual void set_nsubint(unsigned nsubint)
Set the number of sub-integrations.
Definition EPNArchive.C:207
void set_dedispersed(bool done=true)
Set true when the inter-channel dispersion delay has been removed.
Definition EPNArchive.C:328
void set_scale(Signal::Scale scale)
Set the scale of the profiles.
Definition EPNArchive.C:257
Signal::Scale get_scale() const
Get the scale of the profiles.
Definition EPNArchive.C:244
void set_telescope(const std::string &)
Set the telescope name.
Definition EPNArchive.C:103
void set_state(Signal::State state)
Set the state of the profiles.
Definition EPNArchive.C:238
void read_record(const char *filename, unsigned record)
Read the requested record from filename.
Definition EPNArchive.C:355
void load_header(const char *filename)
Load the header information from filename.
Definition EPNArchive.C:377
double get_rotation_measure() const
Get the rotation measure (in )
Definition EPNArchive.C:289
void set_faraday_corrected(bool done=true)
Set the status of the ISM RM flag.
Definition EPNArchive.C:317
double get_bandwidth() const
Get the overall bandwidth of the observation.
Definition EPNArchive.C:212
bool can_unload() const
The unload_file method is not implemented.
Definition EPNArchive.h:162
unsigned get_nbin() const
Get the number of pulsar phase bins used.
Definition EPNArchive.C:162
~EPNArchive()
Destructor.
Definition EPNArchive.C:33
unsigned nsubint
The number of sub-integrations.
Definition EPNArchive.h:201
double get_dispersion_measure() const
Get the dispersion measure (in )
Definition EPNArchive.C:277
void set_dispersion_measure(double dm)
Set the dispersion measure (in )
Definition EPNArchive.C:283
bool get_faraday_corrected() const
Data has been corrected for ISM faraday rotation.
Definition EPNArchive.C:312
void set_type(Signal::Source type)
Set the observation type (psr, cal)
Definition EPNArchive.C:115
epn_block_subheader_line1 sub_line1
The centre frequency.
Definition EPNArchive.h:181
epn_block_subheader_line2 sub_line2
The centre frequency.
Definition EPNArchive.h:183
virtual void set_nbin(unsigned numbins)
Set the number of pulsar phase bins.
Definition EPNArchive.C:170
bool get_poln_calibrated() const
Data has been poln calibrated.
Definition EPNArchive.C:301
epn_header_line3 line3
The centre frequency.
Definition EPNArchive.h:175
const EPNArchive & operator=(const EPNArchive &archive)
Assignment operator.
void init()
Initialize data structures.
Definition EPNArchive.C:17
bool get_dedispersed() const
Inter-channel dispersion delay has been removed.
Definition EPNArchive.C:323
EPNArchive * clone() const
Return a pointer to a new copy constructed instance equal to this.
Definition EPNArchive.C:91
double bandwidth
The bandwidth.
Definition EPNArchive.h:195
unsigned get_nsubint() const
Get the number of sub-integrations stored in the file.
Definition EPNArchive.C:202
unsigned get_npol() const
Get the number of frequency channels used.
Definition EPNArchive.C:189
void set_poln_calibrated(bool done=true)
Set the status of the poln calibrated flag.
Definition EPNArchive.C:306
void copy(const Archive &archive)
Copy all of the class attributes and the selected Integration data.
Definition EPNArchive.C:56
Signal::Source get_type() const
Get the observation type (psr, cal)
Definition EPNArchive.C:109
Signal::State get_state() const
Get the state of the profiles.
Definition EPNArchive.C:233
EPNArchive()
Default constructor.
Definition EPNArchive.C:25
epn_data_block data
The centre frequency.
Definition EPNArchive.h:185
virtual void set_npol(unsigned numpol)
Set the number of polarization measurements.
Definition EPNArchive.C:197
void set_source(const std::string &source)
Set the source name.
Definition EPNArchive.C:126
void set_bandwidth(double bw)
Set the overall bandwidth of the observation.
Definition EPNArchive.C:217
double get_centre_frequency() const
Get the centre frequency of the observation.
Definition EPNArchive.C:222
void unload_file(const char *filename) const
Unload the Archive (header and Integration data) to filename.
Definition EPNArchive.C:519
epn_header_line5 line5
The centre frequency.
Definition EPNArchive.h:179
std::string get_source() const
Get the source name.
Definition EPNArchive.C:121
epn_header_line2 line2
The centre frequency.
Definition EPNArchive.h:173
epn_header_line1 line1
The centre frequency.
Definition EPNArchive.h:171
double centre_frequency
The centre frequency.
Definition EPNArchive.h:192
sky_coord get_coordinates() const
Get the coordinates of the source.
Definition EPNArchive.C:142
void set_coordinates(const sky_coord &coordinates)
Set the coordinates of the source.
Definition EPNArchive.C:153
Signal::State state
The state.
Definition EPNArchive.h:198
unsigned current_record
The centre frequency.
Definition EPNArchive.h:187
virtual void set_nchan(unsigned numchan)
Set the number of frequency channels.
Definition EPNArchive.C:183
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0