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.
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.
bool get_check_mixable () const
void set_check_standard (bool flag=true)
 Set to check that a standard and observation may be compared.
bool get_check_standard () const
void set_check_calibrator (bool flag=true)
 Set to check that a calibrator may be applied to an observation.
bool get_check_calibrator () const
void set_check_processing (bool flag=true)
 Set to check that two archives have been processed identically.
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.
static Option< bool > opposite_sideband
 Allow opposite sidebands to match.
static std::string separator = "\n\t"
 String used to separate mismatch messages.

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

◆ get_bandwidth_match()

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

Return true if the bandwidths match.

Reimplemented in Pulsar::ThresholdMatch.

References Pulsar::Archive::Archive(), Pulsar::Archive::get_bandwidth(), reason, and separator.

Referenced by match().

◆ 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::Archive(), Pulsar::Archive::get(), get_bandwidth_match(), 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(), Pulsar::Receiver::match(), max_frequency_difference, reason, and separator.

Referenced by factory().

◆ 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

References set_check_bandwidth(), set_check_centre_frequency(), and set_check_receiver().

Referenced by Pulsar::Archive::get_calibrator_match(), Pulsar::ThresholdMatch::set_BPP(), and set_check_mixable().

◆ 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

References set_check_calibrator(), set_check_processing(), and set_check_standard().

Referenced by Pulsar::Archive::get_mixable(), and Pulsar::ThresholdMatch::set_BPP().

◆ 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

References set_check_dedispersed(), set_check_faraday_corrected(), set_check_nchan(), and set_check_scale().

Referenced by Pulsar::Archive::get_processing_match(), Pulsar::ThresholdMatch::set_BPP(), and set_check_mixable().

◆ 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

References set_check_nbin(), set_check_source(), set_check_state(), and set_check_type().

Referenced by Pulsar::Archive::get_standard_match(), Pulsar::ThresholdMatch::set_BPP(), and set_check_mixable().

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

Referenced by match().

◆ opposite_sideband

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

Allow opposite sidebands to match.

Allow observations with opposite sidebands to match

Referenced by 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

Referenced by get_bandwidth_match(), Pulsar::ThresholdMatch::get_bandwidth_match(), and match().


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

Generated using doxygen 1.14.0