DataSetManager.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2022 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/Polarimetry/Pulsar/DataSetManager.h
10
11#ifndef __Pulsar_DataSetManager_H
12#define __Pulsar_DataSetManager_H
13
14#include "Pulsar/Database.h"
15
16namespace Pulsar
17{
19 class DataSet : public Reference::Able
20 {
21 public:
22
23 DataSet ();
24
26 bool matches (const Archive* data);
27
29 void add (const Archive* data);
30
32 void integrate (const Archive* data);
33
35 const std::string& get_name () { return name; }
36
38 Archive* get_total () { return total; }
39
41 MJD get_start_epoch () const;
42
44 MJD get_end_epoch () const;
45
46 double get_integration_length () const { return total_integration_length; }
47
48 const std::vector< std::string >& get_calibrator_filenames () const
49 { return calibrator_filenames; }
50
51 protected:
52
53 friend class DataSetManager;
54
55 void update (const Archive* archive, const char* method);
56
57 std::string name;
58 double total_integration_length;
59
60 std::vector< Reference::To<const Archive> > data;
61 Reference::To<Archive> total;
62
63 MJD start_time;
64 MJD end_time;
65
66 std::vector< std::string > calibrator_filenames;
67 };
68
70
73
75 {
76
77 public:
78
81
83 void manage (DataSet*);
84
86 unsigned get_nset () const;
87
89 DataSet* get (const Archive* data);
90
92 DataSet* get_set (unsigned i);
93
96
98 MJD get_epoch () const;
99
101
102 void add (const Archive* data);
103
105
106 void integrate (const Archive* data);
107
109 void load ( std::vector<std::string>& filenames );
110
112 MJD get_start_epoch () const;
113
115 MJD get_end_epoch () const;
116
117 double get_integration_length () const { return total_integration_length; }
118
120 void add_polncals (DataSet*);
121
123 void set_polncal_hours (float hours) { polncal_hours = hours;}
124
125 // days from mid-time within which FluxCalOn observations will be selected
126 void set_fluxcal_days (float days) { fluxcal_days = days;}
127
128 // look for PolnCal observations with nearby sky coordinates
129 void set_check_coordinates (bool f) { check_coordinates = f; }
130
131 void find_poln_calibrators ();
132 void find_on_flux_calibrators ();
133 void find_off_flux_calibrators ();
134
135 unsigned get_polncal_count () const { return npolncal; }
136
137 protected:
138
140 std::vector< Reference::To<DataSet> > datasets;
141
144
145 // hours from mid-time within which PolnCal observations will be selected
146 float polncal_hours;
147
148 // days from mid-time within which FluxCalOn observations will be selected
149 float fluxcal_days;
150
151 // look for PolnCal observations with nearby sky coordinates
152 bool check_coordinates;
153
154 MJD start_time;
155 MJD end_time;
156
157 double total_integration_length;
158
159 void find_flux_calibrators (Signal::Source, const char* short_names);
160
161 template <class Method>
162 void incorporate (const Archive* data, Method method);
163
164 // total number of PolnCal observations
165 unsigned npolncal;
166 };
167
168}
169
170#endif
171
The primary interface to pulsar observational data.
Definition Archive.h:46
MJD get_end_epoch() const
Get the epoch of the last observation.
Definition DataSetManager.C:203
void integrate(const Archive *data)
Integra archive into the appropriate data set.
Definition DataSetManager.C:191
void incorporate(const Archive *data, Method method)
Add archive to the appropriate data set.
Definition DataSetManager.C:159
DataSet * get_set(unsigned i)
Get the ith data set.
Definition DataSetManager.C:152
MJD get_start_epoch() const
Get the epoch of the first observation.
Definition DataSetManager.C:197
Reference::To< Pulsar::Database > database
The database from which PolnCal and FluxCal.
Definition DataSetManager.h:143
void add(const Archive *data)
Append archive to the appropriate data set.
Definition DataSetManager.C:186
void manage(DataSet *)
Add to the array of system calibrators.
Definition DataSetManager.C:120
void set_database(Pulsar::Database *db)
Set the calibrator database.
Definition DataSetManager.h:95
void add_polncals(DataSet *)
Add filenames of polarization reference source observations.
Definition DataSetManager.C:231
std::vector< Reference::To< DataSet > > datasets
The data sets.
Definition DataSetManager.h:140
void set_polncal_hours(float hours)
hours from mid-time within which PolnCal observations will be selected
Definition DataSetManager.h:123
DataSet * get(const Archive *data)
Get the data set that matches the archive.
Definition DataSetManager.C:132
DataSetManager()
Default constructor.
Definition DataSetManager.C:109
unsigned get_nset() const
Get the number of data sets.
Definition DataSetManager.C:146
void load(std::vector< std::string > &filenames)
Load empty archives from filenames.
Definition DataSetManager.C:209
MJD get_epoch() const
Return the reference epoch of the calibration experiment.
Definition DataSetManager.C:126
List of input data from a single pulsar and its calibrator observations.
Definition DataSetManager.h:20
MJD get_start_epoch() const
Get the epoch of the first observation.
Definition DataSetManager.C:92
void integrate(const Archive *data)
Integrate data into total.
Definition DataSetManager.C:79
bool matches(const Archive *data)
Return true if data can be added to this data set.
Definition DataSetManager.C:25
Archive * get_total()
Get the integrated total.
Definition DataSetManager.h:38
void add(const Archive *data)
Append data to list.
Definition DataSetManager.C:54
const std::string & get_name()
Get the name of the pulsar in this data set.
Definition DataSetManager.h:35
MJD get_end_epoch() const
Get the epoch of the last observation.
Definition DataSetManager.C:98
Pulsar Observation Database.
Definition Database.h:35
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0