ArchiveMatch.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2006 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/Base/Classes/Pulsar/ArchiveMatch.h
10
11#ifndef __Pulsar_ArchiveMatch_h
12#define __Pulsar_ArchiveMatch_h
13
14#include "Pulsar/Archive.h"
15#include "Pulsar/Config.h"
16
17namespace Pulsar {
18
21 {
22
23 public:
24
26 Match ();
27
29 virtual ~Match () {}
30
32 virtual Match* clone () const;
33
35 virtual bool match (const Archive* a, const Archive* b) const;
36
38 std::string get_reason () const { return reason; }
39
41 void set_check_mixable (bool flag = true);
42 bool get_check_mixable () const;
43
45 void set_check_standard (bool flag = true);
46 bool get_check_standard () const;
47
49 void set_check_calibrator (bool flag = true);
50 bool get_check_calibrator () const;
51
53 void set_check_processing (bool flag = true);
54 bool get_check_processing () const;
55
57 void set_check_state (bool flag = true);
58 bool get_check_state () const;
59
61 void set_check_type (bool flag = true);
62 bool get_check_type () const;
63
65 void set_check_source (bool flag = true);
66 bool get_check_source () const;
67
69 void set_check_scale (bool flag = true);
70 bool get_check_scale () const;
71
73 void set_check_faraday_corrected (bool flag = true);
74 bool get_check_faraday_corrected () const;
75
77 void set_check_dedispersed (bool flag = true);
78 bool get_check_dedispersed () const;
79
81 void set_check_nbin (bool flag = true);
82 bool get_check_nbin () const;
83
85 void set_check_nchan (bool flag = true);
86 bool get_check_nchan () const;
87
89 void set_check_npol (bool flag = true);
90 bool get_check_npol () const;
91
93 void set_check_receiver (bool flag = true);
94 bool get_check_receiver () const;
95
97 void set_check_centre_frequency (bool flag = true);
98 bool get_check_centre_frequency () const;
99
101 void set_check_bandwidth (bool flag = true);
102 bool get_check_bandwidth () const;
103
105 void set_check_bandwidth_sign (bool flag = true);
106 bool get_check_bandwidth_sign () const;
107
109 virtual bool get_bandwidth_match (const Archive* a, const Archive* b) const;
110
113
116
118 static std::string separator;
119
121 template <typename T>
122 static Match* factory (T method)
123 {
124 Match* match = new Match;
125 (match->*method) (true);
126 return match;
127 }
128
129 protected:
130
132 mutable std::string reason;
133
134 bool check_state;
135 bool check_type;
136 bool check_source;
137 bool check_scale;
138 bool check_faraday_corrected;
139 bool check_dedispersed;
140 bool check_nbin;
141 bool check_nchan;
142 bool check_npol;
143 bool check_receiver;
144 bool check_centre_frequency;
145 bool check_bandwidth;
146 bool check_bandwidth_sign;
147
148 };
149
150}
151
152#endif
Policy used to determine if two archives match.
Definition ArchiveMatch.h:21
Policy used to determine if two archives match.
Definition ArchiveMatch.h:21
void set_check_mixable(bool flag=true)
Set to check that two archives may be combined.
Definition ArchiveMatch.C:85
void set_check_dedispersed(bool flag=true)
Set to check the dedispersed attribute.
Definition ArchiveMatch.C:250
void set_check_nbin(bool flag=true)
Set to check the nbin attribute.
Definition ArchiveMatch.C:261
void set_check_centre_frequency(bool flag=true)
Set to check the centre_frequency attribute.
Definition ArchiveMatch.C:305
void set_check_source(bool flag=true)
Set to check the source attribute.
Definition ArchiveMatch.C:217
void set_check_standard(bool flag=true)
Set to check that a standard and observation may be compared.
Definition ArchiveMatch.C:115
std::string reason
The mismatch messages from the last call to the match method.
Definition ArchiveMatch.h:132
virtual Match * clone() const
Clone operator.
Definition ArchiveMatch.C:66
static Option< bool > opposite_sideband
Allow opposite sidebands to match.
Definition ArchiveMatch.h:115
void set_check_nchan(bool flag=true)
Set to check the nchan attribute.
Definition ArchiveMatch.C:272
virtual bool get_bandwidth_match(const Archive *a, const Archive *b) const
Return true if the bandwidths match.
Definition ArchiveMatch.C:477
void set_check_bandwidth_sign(bool flag=true)
Set to check the sign of the bandwidth attribute.
Definition ArchiveMatch.C:326
void set_check_processing(bool flag=true)
Set to check that two archives have been processed identically.
Definition ArchiveMatch.C:146
void set_check_scale(bool flag=true)
Set to check the scale attribute.
Definition ArchiveMatch.C:228
static Option< double > max_frequency_difference
The maximum amount by which the centre frequency may differ, in MHz.
Definition ArchiveMatch.h:112
virtual bool match(const Archive *a, const Archive *b) const
Check that the selected attributes match.
Definition ArchiveMatch.C:353
void set_check_faraday_corrected(bool flag=true)
Set to check the faraday_corrected attribute.
Definition ArchiveMatch.C:239
void set_check_bandwidth(bool flag=true)
Set to check the bandwidth attribute.
Definition ArchiveMatch.C:316
void set_check_type(bool flag=true)
Set to check the type attribute.
Definition ArchiveMatch.C:206
void set_check_npol(bool flag=true)
Set to check the npol attribute.
Definition ArchiveMatch.C:283
void set_check_calibrator(bool flag=true)
Set to check that a calibrator may be applied to an observation.
Definition ArchiveMatch.C:179
void set_check_receiver(bool flag=true)
Set to check the receiver attribute.
Definition ArchiveMatch.C:294
void set_check_state(bool flag=true)
Set to check the state attribute.
Definition ArchiveMatch.C:195
std::string get_reason() const
Get the mismatch messages from the last call to the match method.
Definition ArchiveMatch.h:38
static std::string separator
String used to separate mismatch messages.
Definition ArchiveMatch.h:118
Match()
Default constructor.
Definition ArchiveMatch.C:49
static Match * factory(T method)
Return a matching strategy based on the specified method.
Definition ArchiveMatch.h:122
virtual ~Match()
Empty destructor.
Definition ArchiveMatch.h:29
Archive()
Default constructor.
Definition Archive.C:67
Configuration option.
Definition Config.h:69
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0