Pulsar::ColdPlasma< Calculator, History > Class Template Referenceabstract

Corrects dielectric effects in cold plasma. More...

#include <ColdPlasma.h>

Inheritance diagram for Pulsar::ColdPlasma< Calculator, History >:
Pulsar::Transformation< Integration > Pulsar::Algorithm Reference::Able Reference::HeapTracked

Public Types

typedef Calculator::Return Type

Public Member Functions

 ColdPlasma ()
 Default constructor.
virtual double get_relative_measure (const Integration *) const =0
 Return the measure to be corrected with respect to centre frequency.
virtual bool get_relative_corrected (const Integration *) const =0
 Return true if the relative measure has been corrected with respect to centre frequency.
virtual double get_absolute_measure (const Integration *) const =0
 Return the measure to be corrected with respect to infinite frequency.
virtual bool get_absolute_corrected (const Integration *) const =0
 Return true if the relative measure has been corrected with respect to centre frequency.
virtual Type get_identity () const =0
 Derived classes must define the identity.
virtual void combine (Type &result, const Type &add) const =0
 Derived classes must define the operator.
virtual void apply (Integration *, unsigned channel, Type to_be_corrected)=0
 Derived classes must define how to apply the correction.
virtual void execute (Archive *)
 Execute the correction for an entire Archive.
void just_do_it (Archive *)
 Just do the correction (off the books)
virtual void revert (Archive *)
 Revert the correction for an entire Archive.
void transform (Integration *)
 The default correction.
void setup (const Integration *)
 Set up internal variables before execution.
virtual void update (const Integration *)
 update internal variables before execution
virtual void set (const Integration *data)
 Calls setup then update.
virtual void set_Profile (const Profile *data)
 Set the frequency for which the correction will be computed.
virtual void set_frequency (double frequency)
 Set the frequency for which the correction will be computed.
void execute1 (Integration *)
 Execute the correction for the current get_reference_frequency and get_measure.
void revert_relative (Integration *)
 Undo the relative correction.
void correct (Integration *, unsigned start_chan, unsigned end_chan, double freq)
 Correct the selected range according to effective_measure.
void match (const Integration *reference, Integration *to_be_corrected)
 Correct the second argument as the first argument was corrected.
void set_reference_wavelength (double metres)
 Set the reference wavelength in metres.
double get_reference_wavelength () const
 Get the reference wavelength in metres.
void set_reference_frequency (double MHz)
 Set the reference frequency in MHz.
double get_reference_frequency () const
 Get the reference frequency in MHz.
void set_delta (const Type &d)
 Set the correction due to a change in reference wavelength.
Type get_delta () const
 Get the correction due to a change in reference wavelength.
Public Member Functions inherited from Pulsar::Transformation< Integration >
void operator() (Integration *container)
 Functor interface.
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

Protected Member Functions

void range (Integration *, unsigned start_chan, unsigned end_chan)
 Execute the correction on the selected range.
virtual void update_relative (const Integration *)
 update the relative transformation based on past correction
virtual void update_absolute (const Integration *)
 update the absolute transformation based on past correction
Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
void __dereference (bool auto_delete=true) const

Protected Attributes

Calculator relative
 Computes the effect to be corrected with respect to reference frequency.
Calculator absolute
 Computes the effect to be corrected with respect to infinite frequency.
Type delta
 The correction due to a change in reference wavelength.
std::string name
 The name to be used in verbose messages.
std::string val
 The name of the correction measure.

Friends

class Integration

Additional Inherited Members

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 ()

Detailed Description

template<class Calculator, class History>
class Pulsar::ColdPlasma< Calculator, History >

Corrects dielectric effects in cold plasma.

Corrections are performed with respect to a reference frequency. By default, this is the centre frequency of the Integration; however, it is possible to correct with respect to an arbitrary frequency or wavelength (including zero wavelength = infinite frequency).

The main point to this template base class is to standardize dispersion and Faraday rotation corrections. The data to be corrected may have already been corrected once before, with a different dispersion/rotation measure and/or refererence wavelength. This class ensures that past corrections are treated properly, through use of a History class (an Integration::Extension).

Member Typedef Documentation

◆ Type

template<class Calculator, class History>
typedef Calculator::Return Pulsar::ColdPlasma< Calculator, History >::Type

For dispersion, Type = double; for Faraday rotation, Type = Jones<double>

Member Function Documentation

◆ apply()

template<class Calculator, class History>
virtual void Pulsar::ColdPlasma< Calculator, History >::apply ( Integration * ,
unsigned channel,
Type to_be_corrected )
pure virtual

Derived classes must define how to apply the correction.

Implemented in Pulsar::Dispersion, and Pulsar::FaradayRotation.

Referenced by range().

◆ combine()

template<class Calculator, class History>
virtual void Pulsar::ColdPlasma< Calculator, History >::combine ( Type & result,
const Type & add ) const
pure virtual

Derived classes must define the operator.

For dispersion, this performs scalar addition; for Faraday rotation, matrix multiplication

Implemented in Pulsar::Dispersion, and Pulsar::FaradayRotation.

◆ correct()

template<class C, class H>
void Pulsar::ColdPlasma< C, H >::correct ( Integration * subint,
unsigned start_chan,
unsigned end_chan,
double reference_frequency )

Correct the selected range according to effective_measure.

Parameters
start_chanthe first channel to be corrected
end_chanone greater than the last channel to be corrected
reference_frequencythe reference frequency

References absolute, name, range(), relative, set_reference_frequency(), setup(), update(), and Pulsar::Integration::verbose.

◆ execute()

template<class C, class H>
void Pulsar::ColdPlasma< C, H >::execute ( Archive * arch)
virtual

◆ get_absolute_corrected()

template<class Calculator, class History>
virtual bool Pulsar::ColdPlasma< Calculator, History >::get_absolute_corrected ( const Integration * ) const
pure virtual

Return true if the relative measure has been corrected with respect to centre frequency.

As returned by psredit -c aux:dmc or aux:rmc

Implemented in Pulsar::Dispersion, and Pulsar::FaradayRotation.

Referenced by update_absolute().

◆ get_absolute_measure()

template<class Calculator, class History>
virtual double Pulsar::ColdPlasma< Calculator, History >::get_absolute_measure ( const Integration * ) const
pure virtual

Return the measure to be corrected with respect to infinite frequency.

As returned by psredit -c int:aux:dm or int:aux:rm

Implemented in Pulsar::Dispersion, and Pulsar::FaradayRotation.

Referenced by execute1(), and update_absolute().

◆ get_identity()

template<class Calculator, class History>
virtual Type Pulsar::ColdPlasma< Calculator, History >::get_identity ( ) const
pure virtual

Derived classes must define the identity.

For dispersion, returns 0; for Faraday rotation, returns the identity matrix

Implemented in Pulsar::Dispersion, and Pulsar::FaradayRotation.

Referenced by just_do_it(), range(), revert_relative(), and update_relative().

◆ get_relative_corrected()

template<class Calculator, class History>
virtual bool Pulsar::ColdPlasma< Calculator, History >::get_relative_corrected ( const Integration * ) const
pure virtual

Return true if the relative measure has been corrected with respect to centre frequency.

As returned by psredit -c dmc or rmc

Implemented in Pulsar::Dispersion, and Pulsar::FaradayRotation.

Referenced by update_relative().

◆ get_relative_measure()

template<class Calculator, class History>
virtual double Pulsar::ColdPlasma< Calculator, History >::get_relative_measure ( const Integration * ) const
pure virtual

Return the measure to be corrected with respect to centre frequency.

As returned by psredit -c dm or rm

Implemented in Pulsar::Dispersion, and Pulsar::FaradayRotation.

Referenced by execute1(), setup(), and update_relative().

◆ range()

template<class C, class H>
void Pulsar::ColdPlasma< C, H >::range ( Integration * data,
unsigned start_chan,
unsigned end_chan )
protected

Execute the correction on the selected range.

This worker method performs the correction on a specified range of frequency channels

Parameters
start_chanthe first channel to be corrected
end_chanone more than the last channel to be corrected
Precondition
the measure and reference_wavelength attributes will have been set prior to calling this method
the delta attribute will have been properly set or reset

References absolute, apply(), Integration::combine(), delta, Pulsar::Integration::get_centre_frequency(), get_identity(), Pulsar::Integration::get_nchan(), get_reference_wavelength(), name, relative, set_frequency(), val, Pulsar::Integration::verbose, and Pulsar::Profile::verbose.

Referenced by correct(), execute1(), just_do_it(), and revert_relative().

◆ revert()

template<class C, class H>
void Pulsar::ColdPlasma< C, H >::revert ( Archive * arch)
virtual

◆ setup()

template<class C, class H>
void Pulsar::ColdPlasma< C, H >::setup ( const Integration * data)

◆ transform()

template<class C, class H>
void Pulsar::ColdPlasma< C, H >::transform ( Integration * data)
virtual

The default correction.

Implements Pulsar::Transformation< Integration >.

References execute1(), and setup().

Referenced by Pulsar::Integration::dedisperse().

◆ update()

template<class Calculator, class History>
void Pulsar::ColdPlasma< Calculator, History >::update ( const Integration * data)
virtual

update internal variables before execution

Postcondition
measure -= corrected_measure; and delta is initialized

Reimplemented in Pulsar::Dispersion.

References update_absolute(), and update_relative().

Referenced by correct(), execute1(), set(), and Pulsar::Dispersion::update().


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

Generated using doxygen 1.14.0