FITSHdrExtension.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2003 by Aidan Hotan
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Base/Extensions/Pulsar/FITSHdrExtension.h
10 
11 #ifndef __FITSHdrExtension_h
12 #define __FITSHdrExtension_h
13 
14 #include "Pulsar/ArchiveExtension.h"
15 #include "TextInterface.h"
16 
17 namespace Pulsar
18 {
20  class FITSHdrExtension : public Pulsar::Archive::Extension
21  {
22 
23  public:
24 
27 
29  FITSHdrExtension (const FITSHdrExtension& extension);
30 
32  FITSHdrExtension* clone () const { return new FITSHdrExtension( *this ); }
33 
36 
37  // The text interface to a FITSHdrExtension object
38  class Interface : public TextInterface::To<FITSHdrExtension>
39  {
40  public:
41  Interface( FITSHdrExtension *s_instance = NULL );
42  };
43 
45  std::string get_short_name () const { return "ext"; }
46 
48  void get_coord_string (const sky_coord& coordinates,
49  std::string& coord1, std::string& coord2) const;
50 
52  std::string get_coordmode () const;
54  void set_coordmode (const std::string& mode);
55 
57  void set_date_str (const std::string& date);
58 
60  std::string get_hdrver () const;
61  void set_hdrver (const std::string& txt) { hdrver = txt; }
62 
64  std::string get_creation_date () const;
65  void set_creation_date (const std::string& txt) { creation_date = txt; }
66 
68  std::string get_obs_mode () const { return obs_mode; }
69  void set_obs_mode (const std::string& txt) { obs_mode = txt; }
70 
72  double get_equinox () const;
73  void set_equinox (double val) { equinox = val; }
74 
76  std::string get_trk_mode () const;
77  void set_trk_mode (const std::string& txt) { trk_mode = txt; }
78 
80  double get_bpa () const { return bpa; }
82  void set_bpa( const double _bpa ) { bpa = _bpa; }
83 
85  double get_bmaj () const { return bmaj; }
87  void set_bmaj( const double _bmaj ) { bmaj = _bmaj; }
88 
90  double get_bmin () const { return bmin; }
92  void set_bmin( const double _bmin ) { bmin = _bmin; }
93 
95  std::string get_stt_date () const { return stt_date; }
96  void set_stt_date (const std::string& date) { stt_date = date; }
97 
99  std::string get_stt_time () const { return stt_time; }
100  void set_stt_time (const std::string& time) { stt_time = time; }
101 
103  int get_stt_imjd () const { return start_time.intday(); }
104  void set_stt_imjd (int);
105 
107  int get_stt_smjd () const { return start_time.get_secs(); }
108  void set_stt_smjd (int);
109 
111  double get_stt_offs () const { return start_time.get_fracsec(); }
112  void set_stt_offs (double);
113 
115  MJD get_start_time () const { return start_time; }
116  void set_start_time (const MJD& mjd);
117 
119  double get_stt_lst () const { return stt_lst; }
120  void set_stt_lst (double lst) { stt_lst = lst; }
121 
122  // ra
123  std::string ra;
124  std::string get_ra () const { return ra; }
125  void set_ra( std::string new_ra ) { ra = new_ra; }
126 
127  // dec
128  std::string dec;
129  std::string get_dec () const { return dec; }
130  void set_dec( std::string new_dec ) { dec = new_dec; }
131 
132  // stt_crd1
133  std::string stt_crd1;
134  std::string get_stt_crd1 () const { return stt_crd1; }
135  void set_stt_crd1( std::string new_stt_crd1 ) { stt_crd1 = new_stt_crd1; }
136 
137  // stt_crd2
138  std::string stt_crd2;
139  std::string get_stt_crd2 () const { return stt_crd2; }
140  void set_stt_crd2( std::string new_stt_crd2 ) { stt_crd2 = new_stt_crd2; }
141 
142  // stp_crd1
143  std::string stp_crd1;
144  std::string get_stp_crd1 () const { return stp_crd1; }
145  void set_stp_crd1( std::string new_stp_crd1 ) { stp_crd1 = new_stp_crd1; }
146 
147  // stp_crd2
148  std::string stp_crd2;
149  std::string get_stp_crd2 () const { return stp_crd2; }
150  void set_stp_crd2( std::string new_stp_crd2 ) { stp_crd2 = new_stp_crd2; }
151 
153  std::string ibeam;
154  std::string get_ibeam () const { return ibeam; }
155  void set_ibeam (const std::string& _ibeam) { ibeam = _ibeam; }
156 
158  std::string pnt_id;
159  std::string get_pnt_id () const { return pnt_id; }
160  void set_pnt_id (const std::string& _pnt_id) { pnt_id = _pnt_id; }
161 
163  void set_obsfreq( double set_obsfreq );
164 
166  double get_obsfreq () const;
167 
169  void set_obsbw( double set_obsbw );
170 
172  double get_obsbw() const;
173 
175  void set_obsnchan( int set_obsnchan );
176 
178  int get_obsnchan() const;
179 
181  double get_chan_dm() const { return chan_dm; }
182  void set_chan_dm (double _chan_dm) { chan_dm = _chan_dm; }
183 
185 
187  std::string hdrver;
188  int major_version;
189  int minor_version;
190 
192  std::string creation_date;
193 
195  std::string coordmode;
196 
198  double equinox;
199 
201  std::string trk_mode;
202 
204  std::string stt_date;
205 
207  std::string stt_time;
208 
210  double stt_lst;
211 
213  double obsfreq;
214 
216  double obsbw;
217 
219  int obsnchan;
220 
222  double chan_dm;
223 
225  static double unset_dm;
226 
228  std::string obs_mode;
229 
231  double bpa;
232 
234  double bmaj;
235 
237  double bmin;
238 
239  protected:
240 
242  MJD start_time;
243 
244  };
245 
246 }
247 
248 #endif
249 
void set_coordmode(const std::string &mode)
Set the coordinate mode string.
Definition: FITSHdrExtension.C:63
void set_date_str(const std::string &date)
Set the creation date string.
Definition: FITSHdrExtension.C:82
std::string get_short_name() const
Return an abbreviated name that can be typed relatively quickly.
Definition: FITSHdrExtension.h:55
Warning warning
Warning messages filter.
Definition: Pulsar.C:12
double bmaj
Beam major axis length.
Definition: FITSHdrExtension.h:244
std::string get_stt_time() const
Get the start time.
Definition: FITSHdrExtension.h:109
std::string stt_time
Start UT (hh:mm:ss)
Definition: FITSHdrExtension.h:217
static double unset_dm
Special value for no DM set.
Definition: FITSHdrExtension.h:235
std::string creation_date
File creation date.
Definition: FITSHdrExtension.h:202
double get_obsbw() const
Get the observed bandwidth.
Definition: FITSHdrExtension.C:132
void set_obsnchan(int set_obsnchan)
Set the observed number of channels.
Definition: FITSHdrExtension.C:137
std::string hdrver
Pulsar FITS header version information.
Definition: FITSHdrExtension.h:197
int get_obsnchan() const
Get the observed number of channels.
Definition: FITSHdrExtension.C:142
double obsfreq
Observed Frequency.
Definition: FITSHdrExtension.h:223
int get_stt_imjd() const
Get the stt_imjd.
Definition: FITSHdrExtension.h:113
double stt_lst
Start LST.
Definition: FITSHdrExtension.h:220
double get_equinox() const
Get the equinox.
Definition: FITSHdrExtension.C:162
double get_bmin() const
Get the beam minor axis length.
Definition: FITSHdrExtension.h:100
double chan_dm
DM used for online dedispersion.
Definition: FITSHdrExtension.h:232
int obsnchan
Observed number of channels.
Definition: FITSHdrExtension.h:229
Stores PSRFITS header extensions.
Definition: FITSHdrExtension.h:25
std::string pnt_id
Name or ID for pointing ctr (multibeam feeds)
Definition: FITSHdrExtension.h:168
double get_bpa() const
Get the beam position angle.
Definition: FITSHdrExtension.h:90
Able & operator=(const Able &)
FITSHdrExtension * clone() const
Clone method.
Definition: FITSHdrExtension.h:42
double get_stt_lst() const
Get stt_lst.
Definition: FITSHdrExtension.h:129
int get_stt_smjd() const
Get the stt_smjd.
Definition: FITSHdrExtension.h:117
double get_stt_offs() const
Get the stt_offs.
Definition: FITSHdrExtension.h:121
std::string ibeam
Beam number for multibeam systems (1=ctr beam)
Definition: FITSHdrExtension.h:163
double bmin
Beam minor axis length.
Definition: FITSHdrExtension.h:247
std::string obs_mode
Observation Mode.
Definition: FITSHdrExtension.h:238
FITSHdrExtension()
Default constructor.
Definition: FITSHdrExtension.C:21
std::string stt_date
Start UT date (YYYY-MM-DD)
Definition: FITSHdrExtension.h:214
std::string get_stt_date() const
Get the start date.
Definition: FITSHdrExtension.h:105
void set_bmaj(const double _bmaj)
Set the beam major axis length.
Definition: FITSHdrExtension.h:97
TextInterface::Parser * get_interface()
Return a text interfaces that can be used to access this instance.
Definition: FITSHdrExtension.C:58
std::string get_hdrver() const
Get the header version.
Definition: FITSHdrExtension.C:147
std::string trk_mode
Track mode (TRACK, SCANGC, SCANLAT)
Definition: FITSHdrExtension.h:211
void set_obsfreq(double set_obsfreq)
Set the observed frequency.
Definition: FITSHdrExtension.C:117
double get_bmaj() const
Get the beam major axis length.
Definition: FITSHdrExtension.h:95
double obsbw
Observed bandwidth.
Definition: FITSHdrExtension.h:226
std::string get_coordmode() const
Get the coordinate mode.
Definition: FITSHdrExtension.C:157
std::string get_trk_mode() const
Get tracking mode.
Definition: FITSHdrExtension.C:167
std::string get_obs_mode() const
Get the observation mode.
Definition: FITSHdrExtension.h:78
Definition: ArchiveExtension.h:28
void get_coord_string(const sky_coord &coordinates, std::string &coord1, std::string &coord2) const
Return two strings based on coordmode attribute.
Definition: FITSHdrExtension.C:87
Defines the PSRCHIVE library.
Definition: CalSource.h:17
std::string coordmode
Coordinate mode (EQUAT, GAL, ECLIP, AZEL, HADEC)
Definition: FITSHdrExtension.h:205
MJD get_start_time() const
Get the start time.
Definition: FITSHdrExtension.h:125
double equinox
Equinox of coordinates.
Definition: FITSHdrExtension.h:208
double get_chan_dm() const
online DM
Definition: FITSHdrExtension.h:191
MJD start_time
Header start time (as opposed to subint start time)
Definition: FITSHdrExtension.h:252
void set_bpa(const double _bpa)
Set the beam position angle.
Definition: FITSHdrExtension.h:92
double get_obsfreq() const
Get the observed frequency.
Definition: FITSHdrExtension.C:122
void set_bmin(const double _bmin)
Set the beam minor axis length.
Definition: FITSHdrExtension.h:102
std::string get_creation_date() const
Get the file creation date.
Definition: FITSHdrExtension.C:152
double bpa
Beam position angle.
Definition: FITSHdrExtension.h:241
void set_obsbw(double set_obsbw)
Set the observed bandwidth.
Definition: FITSHdrExtension.C:127

Generated using doxygen 1.8.17