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 
17 namespace Pulsar {
18 
20  class Archive::Match : public Reference::Able
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
void set_check_receiver(bool flag=true)
Set to check the receiver attribute.
Definition: ArchiveMatch.C:294
virtual unsigned get_npol() const =0
Get the number of polarizations.
static Option< double > max_frequency_difference
The maximum amount by which the centre frequency may differ, in MHz.
Definition: ArchiveMatch.h:122
void set_check_state(bool flag=true)
Set to check the state attribute.
Definition: ArchiveMatch.C:195
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_standard(bool flag=true)
Set to check that a standard and observation may be compared.
Definition: ArchiveMatch.C:115
virtual Signal::Source get_type() const =0
Get the observation type (psr, cal)
virtual std::string get_source() const =0
Get the source name.
void set_check_calibrator(bool flag=true)
Set to check that a calibrator may be applied to an observation.
Definition: ArchiveMatch.C:179
virtual bool match(const Archive *a, const Archive *b) const
Check that the selected attributes match.
Definition: ArchiveMatch.C:353
void set_check_processing(bool flag=true)
Set to check that two archives have been processed identically.
Definition: ArchiveMatch.C:146
void set_check_npol(bool flag=true)
Set to check the npol attribute.
Definition: ArchiveMatch.C:283
void set_check_dedispersed(bool flag=true)
Set to check the dedispersed attribute.
Definition: ArchiveMatch.C:250
virtual Signal::Scale get_scale() const =0
Get the scale in which flux density is measured.
Archive()
Default constructor.
Definition: Archive.C:67
static Match * factory(T method)
Return a matching strategy based on the specified method.
Definition: ArchiveMatch.h:132
The primary interface to pulsar observational data.
Definition: Archive.h:45
Contains information about the receiver and receiver platform.
Definition: Receiver.h:28
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
void set_check_bandwidth_sign(bool flag=true)
Set to check the sign of the bandwidth attribute.
Definition: ArchiveMatch.C:326
virtual unsigned get_nchan() const =0
Get the number of frequency channels used.
virtual Signal::State get_state() const =0
Get the state of the profile data.
std::string reason
The mismatch messages from the last call to the match method.
Definition: ArchiveMatch.h:142
bool match(const Receiver *receiver, std::string &reason) const
Return true if the receiver configurations match.
Definition: Receiver.C:182
virtual double get_centre_frequency() const =0
Get the centre frequency of the observation.
virtual bool get_faraday_corrected() const =0
Data has been corrected for ISM faraday rotation.
void set_check_mixable(bool flag=true)
Set to check that two archives may be combined.
Definition: ArchiveMatch.C:85
Policy used to determine if two archives match.
Definition: ArchiveMatch.h:25
virtual bool get_dedispersed() const =0
Inter-channel dispersion delay has been removed.
std::string get_reason() const
Get the mismatch messages from the last call to the match method.
Definition: ArchiveMatch.h:48
Match()
Default constructor.
Definition: ArchiveMatch.C:49
static Option< bool > opposite_sideband
Allow opposite sidebands to match.
Definition: ArchiveMatch.h:125
void set_check_nbin(bool flag=true)
Set to check the nbin attribute.
Definition: ArchiveMatch.C:261
virtual double get_bandwidth() const =0
Get the overall bandwidth of the observation.
void set_check_faraday_corrected(bool flag=true)
Set to check the faraday_corrected attribute.
Definition: ArchiveMatch.C:239
virtual Match * clone() const
Clone operator.
Definition: ArchiveMatch.C:66
void set_check_scale(bool flag=true)
Set to check the scale attribute.
Definition: ArchiveMatch.C:228
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
Defines the PSRCHIVE library.
Definition: CalSource.h:17
static std::string separator
String used to separate mismatch messages.
Definition: ArchiveMatch.h:128
virtual unsigned get_nbin() const =0
Get the number of pulsar phase bins used.
void set_check_centre_frequency(bool flag=true)
Set to check the centre_frequency attribute.
Definition: ArchiveMatch.C:305
virtual ~Match()
Empty destructor.
Definition: ArchiveMatch.h:39
void set_check_nchan(bool flag=true)
Set to check the nchan attribute.
Definition: ArchiveMatch.C:272
void set_check_source(bool flag=true)
Set to check the source attribute.
Definition: ArchiveMatch.C:217

Generated using doxygen 1.8.17