Policy used to determine if two archives match. More...

#include <ArchiveMatch.h>

Inheritance diagram for Pulsar::Archive::Match:
Reference::Able Reference::HeapTracked Pulsar::ThresholdMatch

Public Member Functions

 Match ()
 Default constructor.
 
virtual ~Match ()
 Empty destructor.
 
virtual Matchclone () const
 Clone operator.
 
virtual bool match (const Archive *a, const Archive *b) const
 Check that the selected attributes match. More...
 
std::string get_reason () const
 Get the mismatch messages from the last call to the match method.
 
void set_check_mixable (bool flag=true)
 Set to check that two archives may be combined. More...
 
bool get_check_mixable () const
 
void set_check_standard (bool flag=true)
 Set to check that a standard and observation may be compared. More...
 
bool get_check_standard () const
 
void set_check_calibrator (bool flag=true)
 Set to check that a calibrator may be applied to an observation. More...
 
bool get_check_calibrator () const
 
void set_check_processing (bool flag=true)
 Set to check that two archives have been processed identically. More...
 
bool get_check_processing () const
 
void set_check_state (bool flag=true)
 Set to check the state attribute.
 
bool get_check_state () const
 
void set_check_type (bool flag=true)
 Set to check the type attribute.
 
bool get_check_type () const
 
void set_check_source (bool flag=true)
 Set to check the source attribute.
 
bool get_check_source () const
 
void set_check_scale (bool flag=true)
 Set to check the scale attribute.
 
bool get_check_scale () const
 
void set_check_faraday_corrected (bool flag=true)
 Set to check the faraday_corrected attribute.
 
bool get_check_faraday_corrected () const
 
void set_check_dedispersed (bool flag=true)
 Set to check the dedispersed attribute.
 
bool get_check_dedispersed () const
 
void set_check_nbin (bool flag=true)
 Set to check the nbin attribute.
 
bool get_check_nbin () const
 
void set_check_nchan (bool flag=true)
 Set to check the nchan attribute.
 
bool get_check_nchan () const
 
void set_check_npol (bool flag=true)
 Set to check the npol attribute.
 
bool get_check_npol () const
 
void set_check_receiver (bool flag=true)
 Set to check the receiver attribute.
 
bool get_check_receiver () const
 
void set_check_centre_frequency (bool flag=true)
 Set to check the centre_frequency attribute.
 
bool get_check_centre_frequency () const
 
void set_check_bandwidth (bool flag=true)
 Set to check the bandwidth attribute.
 
bool get_check_bandwidth () const
 
void set_check_bandwidth_sign (bool flag=true)
 Set to check the sign of the bandwidth attribute.
 
bool get_check_bandwidth_sign () const
 
virtual bool get_bandwidth_match (const Archive *a, const Archive *b) const
 Return true if the bandwidths match.
 
- Public Member Functions inherited from Reference::Able
 Able (const Able &)
 
Ableoperator= (const Able &)
 
unsigned get_reference_count () const
 
- Public Member Functions inherited from Reference::HeapTracked
 HeapTracked (const HeapTracked &)
 
HeapTrackedoperator= (const HeapTracked &)
 
bool __is_on_heap () const
 

Static Public Member Functions

template<typename T >
static Matchfactory (T method)
 Return a matching strategy based on the specified method.
 
- Static Public Member Functions inherited from Reference::Able
static size_t get_instance_count ()
 
- Static Public Member Functions inherited from Reference::HeapTracked
static void * operator new (size_t size, void *ptr=0)
 
static void operator delete (void *location, void *ptr)
 
static void operator delete (void *location)
 
static size_t get_heap_queue_size ()
 

Static Public Attributes

static Option< double > max_frequency_difference
 The maximum amount by which the centre frequency may differ, in MHz. More...
 
static Option< bool > opposite_sideband
 Allow opposite sidebands to match. More...
 
static std::string separator = "\n\t"
 String used to separate mismatch messages. More...
 

Protected Attributes

std::string reason
 The mismatch messages from the last call to the match method.
 
bool check_state
 
bool check_type
 
bool check_source
 
bool check_scale
 
bool check_faraday_corrected
 
bool check_dedispersed
 
bool check_nbin
 
bool check_nchan
 
bool check_npol
 
bool check_receiver
 
bool check_centre_frequency
 
bool check_bandwidth
 
bool check_bandwidth_sign
 

Additional Inherited Members

- Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 
void __dereference (bool auto_delete=true) const
 

Detailed Description

Policy used to determine if two archives match.

Member Function Documentation

◆ match()

bool Pulsar::Archive::Match::match ( const Archive a,
const Archive b 
) const
virtual

Check that the selected attributes match.

This method checks each of the archive attributes for which the check flag is set. If a pair of checked attributes does not match, the result of this function is set to false and an appropriate message is added to the reason attribute. If all checked attributes match, the result is true.

References Pulsar::Archive::get(), Pulsar::Archive::get_centre_frequency(), Pulsar::Archive::get_dedispersed(), Pulsar::Archive::get_faraday_corrected(), Pulsar::Archive::get_nbin(), Pulsar::Archive::get_nchan(), Pulsar::Archive::get_npol(), Pulsar::Archive::get_scale(), Pulsar::Archive::get_source(), Pulsar::Archive::get_state(), Pulsar::Archive::get_type(), and Pulsar::Receiver::match().

Referenced by Pulsar::PulsarCalibrator::calibrator_match().

◆ set_check_calibrator()

void Pulsar::Archive::Match::set_check_calibrator ( bool  flag = true)

Set to check that a calibrator may be applied to an observation.

This state defines the minimum set of observing parameters that should be equal (within certain limits) before a calibrator may be applied to a pulsar observation. The following flags are set

  • check_receiver
  • check_centre_frequency
  • check_bandwidth

Referenced by Pulsar::PulsarCalibrator::calibrator_match().

◆ set_check_mixable()

void Pulsar::Archive::Match::set_check_mixable ( bool  flag = true)

Set to check that two archives may be combined.

This state defines the set of observing and processing parameters that should be equal (within certain limits) before two archives may be combined (for instance, using append). This method calls:

  • set_check_standard
  • set_check_processing
  • set_check_calibrator

◆ set_check_processing()

void Pulsar::Archive::Match::set_check_processing ( bool  flag = true)

Set to check that two archives have been processed identically.

This state defines the minimum set of processing parameters that should be equal before data from two archives are combined. The following flags are set:

  • check_scale
  • check_faraday_corrected
  • check_dedispersed
  • check_nchan

◆ set_check_standard()

void Pulsar::Archive::Match::set_check_standard ( bool  flag = true)

Set to check that a standard and observation may be compared.

This state defines the minimum set of observing parameters that should be equal before two archives are compared, as during the fitting of a profile to a standard template. The following flags are set:

  • check_state
  • check_type
  • check_source
  • check_nbin

Referenced by Pulsar::PulsarCalibrator::calibrator_match().

Member Data Documentation

◆ max_frequency_difference

Pulsar::Option< double > Pulsar::Archive::Match::max_frequency_difference
static

The maximum amount by which the centre frequency may differ, in MHz.

Maximum frequency difference in MHz

◆ opposite_sideband

Pulsar::Option< bool > Pulsar::Archive::Match::opposite_sideband
static

Allow opposite sidebands to match.

Allow observations with opposite sidebands to match

◆ separator

std::string Pulsar::Archive::Match::separator = "\n\t"
static

String used to separate mismatch messages.

Added between match report strings in reason attribute


The documentation for this class was generated from the following files:

Generated using doxygen 1.8.17