ProcHistory.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// Class for holding processing history
10
11#ifndef __ProcHistory_h
12#define __ProcHistory_h
13
14#include "Pulsar/ArchiveExtension.h"
15#include "TextInterface.h"
16
17namespace Pulsar {
18
19 class ProcHistory : public Archive::Extension {
20
21 public:
22
23 //Default constructor
24 ProcHistory ();
25
27 ProcHistory* clone () const { return new ProcHistory( *this ); }
28
30 TextInterface::Parser* get_interface();
31
32 // Text interface to a ProcHistory instance
33 class Interface : public TextInterface::To<ProcHistory>
34 {
35 public:
36 Interface( ProcHistory *s_instance = NULL );
37 };
38
40 std::string get_short_name () const { return "hist"; }
41
43 // The information container
44
45 class row : public Reference::Able {
46
47 public:
48
49 // Default constructor
50 row ();
51
52 // Text interface to a ProcHistory instance
53 class Interface : public TextInterface::To<row>
54 {
55 public:
56 Interface( row *s_instance = NULL );
57 };
58
59 // Row label
60 int index;
61
62 std::string get_date_pro () const { return date_pro; }
63 std::string get_proc_cmd () const { return proc_cmd; }
64 std::string get_pol_type () const { return pol_type; }
65 int get_nsub () const { return nsub; }
66 int get_npol () const { return npol; }
67 int get_nbin () const { return nbin; }
68 int get_nbin_prd () const { return nbin_prd; }
69 double get_tbin () const { return tbin; }
70 double get_ctr_freq () const { return ctr_freq; }
71 int get_nchan () const { return nchan; }
72 double get_chan_bw () const { return chan_bw; }
73 double get_ref_freq () const { return ref_freq; }
74 double get_dispersion_measure () const { return dispersion_measure; }
75 double get_rotation_measure () const { return rotation_measure; }
76 int get_pr_corr () const { return pr_corr; }
77 int get_fd_corr () const { return fd_corr; }
78 int get_be_corr () const { return be_corr; }
79 int get_rm_corr () const { return rm_corr; }
80 int get_dedisp () const { return dedisp; }
81 int get_aux_rm_corr () const { return aux_rm_corr; }
82 int get_aux_dm_corr () const { return aux_dm_corr; }
83 std::string get_dds_mthd () const { return dds_mthd; }
84 std::string get_sc_mthd () const { return sc_mthd; }
85 std::string get_cal_mthd () const { return cal_mthd; }
86 std::string get_cal_file () const { return cal_file; }
87 std::string get_rfi_mthd () const { return rfi_mthd; }
88 std::string get_aux_rm_model () const { return aux_rm_model; }
89 std::string get_aux_dm_model () const { return aux_dm_model; }
90 std::string get_scale () const { return scale; }
91
92 // Information in the row
93 std::string date_pro;
94 std::string proc_cmd;
95 std::string pol_type;
96 int nsub;
97 int npol;
98 int nbin;
99 int nbin_prd;
100 double tbin;
101 double ctr_freq;
102 int nchan;
103 double chan_bw;
104 double ref_freq;
105 double dispersion_measure;
106 double rotation_measure;
107 int pr_corr;
108 int fd_corr;
109 int be_corr;
110 int rm_corr;
111 int dedisp;
112
113 int aux_rm_corr;
114 int aux_dm_corr;
115
116 std::string dds_mthd;
117 std::string sc_mthd;
118 std::string cal_mthd;
119 std::string cal_file;
120 std::string rfi_mthd;
121
122 std::string aux_rm_model;
123 std::string aux_dm_model;
124
125 std::string scale;
126 };
127
128 // The storage array
129 std::vector<row> rows;
130
132 unsigned get_nrow () const;
133
135 row* get_row (unsigned i);
136 const row* get_row (unsigned i) const;
137
138 std::string command_str;
139 std::string the_cal_mthd;
140 std::string the_sc_mthd;
141 std::string the_cal_file;
142 std::string the_rfi_mthd;
143
144 ProcHistory::row& get_first ();
145 ProcHistory::row& get_last ();
146
147 void set_command_str (const std::string&);
148 std::string get_command_str ();
149 void set_cal_mthd (const std::string&);
150 std::string get_cal_mthd ();
151 void set_sc_mthd (const std::string&);
152 std::string get_sc_mthd ();
153 void set_cal_file (const std::string&);
154 std::string get_cal_file () const { return the_cal_file; }
155 void set_rfi_mthd (const std::string&);
156 std::string get_rfi_mthd ();
157
158 int get_last_nbin_prd () const { return rows.back().nbin_prd; }
159 double get_last_tbin () const { return rows.back().tbin; }
160 double get_last_chan_bw () const { return rows.back().chan_bw; }
161
162 void add_blank_row ();
163
164 private:
165
166 void check_irow (unsigned irow) const;
167 };
168
169}
170
171#endif
Definition ArchiveExtension.h:24
virtual TextInterface::Parser * get_interface()
Return a text interface that can be used to access this instance.
Definition ArchiveExtension.h:37
virtual Extension * clone() const =0
Return a new copy-constructed instance identical to this instance.
virtual std::string get_short_name() const
Return an abbreviated name that can be typed relatively quickly.
Definition Archive.C:150
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0