Calibrators derived from reference source observations. More...

#include <ReferenceCalibrator.h>

Inheritance diagram for Pulsar::ReferenceCalibrator:
Pulsar::PolnCalibrator Pulsar::Calibrator Reference::Able Reference::HeapTracked Pulsar::PolarCalibrator Pulsar::SingleAxisCalibrator Pulsar::DoPCalibrator Pulsar::OffPulseCalibrator

Public Member Functions

 ReferenceCalibrator (const Archive *archive)
 Construct from an single PolnCal Pulsar::Archive.
 ReferenceCalibrator (const ReferenceCalibrator &)
 Copy constructor.
virtual ReferenceCalibratorclone () const =0
 Clone operator.
 ~ReferenceCalibrator ()
 Destructor.
void set_reference_source (const Stokes< Estimate< double > > &stokes)
 Set the Stokes parameters of the reference source.
Stokes< Estimate< double > > get_reference_source () const
 Get the Stokes parameters of the reference source.
void set_outlier_threshold (float f)
 Set the threshold used to reject outliers when computing levels.
float get_outlier_threshold () const
 Get the threshold used to reject outliers when computing levels.
void get_levels (unsigned nchan, std::vector< std::vector< Estimate< double > > > &hi, std::vector< std::vector< Estimate< double > > > &lo) const
 Return the mean levels of the calibrator hi and lo states.
virtual void set_nchan (unsigned nchan)
 Set the number of frequency channels in the response array.
Public Member Functions inherited from Pulsar::PolnCalibrator
 PolnCalibrator (const Archive *archive=0)
 Construct with optional processed calibrator Archive.
 PolnCalibrator (const PolnCalibrator &calibrator)
 Copy constructor.
virtual ~PolnCalibrator ()
 Destructor.
void set_subint (const Index &isub)
 Set the sub-integration index.
virtual void set_response_nchan (unsigned nchan)
 Set the number of frequency channels in the response array.
virtual unsigned get_response_nchan () const
 Get the number of frequency channels in the response array.
virtual Jones< float > get_response (unsigned ichan) const
 Return the system response for the specified channel.
bool has_Receiver () const
 Return true if the Receiver is set.
const Receiverget_Receiver () const
 Return the Receiver.
void set_Receiver (const Archive *)
 Set the Receiver extension to that of the input Archive.
std::string get_receiver_basis_filename () const
void transformation_resize (unsigned nchan)
bool get_transformation_valid (unsigned ch) const
 Return true if the transformation for the specified channel is valid.
void set_transformation_invalid (unsigned ch, const std::string &reason)
 Set the transformation invalid flag for the specified channel.
const std::string & get_transformation_invalid_reason (unsigned ichan) const
 Get the reason that the transformation in the specified channel is invalid.
const MEAL::Complex2get_transformation (unsigned ichan) const
 Return the transformation for the specified channel.
MEAL::Complex2get_transformation (unsigned ichan)
 Return the transformation for the specified channel.
void set_transformation (unsigned ichan, MEAL::Complex2 *)
 Set the transformation for the secified channel.
bool has_covariance () const
 Return true if parameter covariances are stored.
void get_covariance (unsigned ichan, std::vector< double > &) const
 Return the covariance matrix vector for the specified channel.
virtual bool has_solver () const
 Return true if least squares minimization solvers are available.
virtual const MEAL::LeastSquaresget_solver (unsigned ichan) const
 Return the transformation for the specified channel.
MEAL::LeastSquaresget_solver (unsigned ichan)
void set_backend_correction (bool f)
 Perform backend corrections before inverting response.
virtual void calibrate (Archive *archive)
 Calibrate the polarization of the given archive.
virtual const Typeget_type () const
 Return the Calibrator::Type of derived class.
virtual unsigned get_nchan () const
 Get the number of frequency channels in the calibrator.
unsigned get_nchan (bool build_if_needed) const
 Get the number of frequency channels in the calibrator.
CalibratorExtensionnew_Extension () const
 Return a new PolnCalibratorExtension.
Calibrator::Infoget_Info () const
 Return plotting information.
void calibration_setup (const Archive *arch)
 Set up done before calibrating an archive.
Public Member Functions inherited from Pulsar::Calibrator
 Calibrator ()
 Default constructor.
virtual ~Calibrator ()
 Destructor.
Archivenew_solution (const std::string &archive_class) const
 Return a new processed calibrator Archive with a CalibratorExtension.
virtual MJD get_epoch () const
 Return the reference epoch of the calibration experiment.
virtual std::string get_filenames () const
 Return a string containing the file information.
const Archiveget_Archive () const
 Return a const reference to the calibrator archive.
bool has_Archive () const
 Return true if the calibrator is constructed from an Archive.
template<class T>
bool is_a () const
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

static ReferenceCalibratorfactory (const Calibrator::Type *, const Archive *)
 Factory creates instances of derived types.
static void get_levels (const Archive *archive, Index subint, unsigned nchan, std::vector< std::vector< Estimate< double > > > &hi, std::vector< std::vector< Estimate< double > > > &lo, double outlier_threshold)
 Return the mean levels of the calibrator hi and lo states.
static void get_levels (const Integration *integration, unsigned nchan, std::vector< std::vector< Estimate< double > > > &hi, std::vector< std::vector< Estimate< double > > > &lo, double outlier_threshold)
 Return the mean levels of the calibrator hi and lo states.
Static Public Member Functions inherited from Pulsar::Calibrator
static unsigned get_instance_count ()
 Returns the number of Calibrator instances currently in existence.
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< bool > smooth_bandpass
 If true, then a median filter is run on the calibrator bandpass.
Static Public Attributes inherited from Pulsar::PolnCalibrator
static Option< double > minimum_determinant
 Minimum allowable determinant of Jones matrices.
Static Public Attributes inherited from Pulsar::Calibrator
static unsigned verbose = 0
 Verbosity level.
static Pulsar::Option< float > median_smoothing
 Fractional bandwidth of the window used in median filter.
static Pulsar::Option< float > interpolating
 Fractional bandwidth over which interpolation will be performed.
static Pulsar::Option< float > det_threshold
 Tolerance to non-physical values of the coherency matrix.

Protected Member Functions

void set_calibrator (const Archive *archive)
 Filter access to the calibrator.
void calculate_transformation ()
 Solve using the observation of the reference source.
void calculate (std::vector< std::vector< Estimate< double > > > &hi, std::vector< std::vector< Estimate< double > > > &lo)
 Does the calculation of the above.
virtual MEAL::Complex2solve (const std::vector< Estimate< double > > &hi, const std::vector< Estimate< double > > &lo)=0
 Derived classes must perform the actual solution.
virtual void extra (unsigned ichan, const std::vector< Estimate< double > > &source, const std::vector< Estimate< double > > &sky)
 Derived classes may also compute other things.
Protected Member Functions inherited from Pulsar::PolnCalibrator
void setup_transformation () const
 Set up to call calculate_transformation.
virtual bool get_valid (unsigned ichan) const
 Derived classes can add conditions for channel validity.
float get_weight (unsigned ichan) const
 Return the weight (0 or 1) of the specified channel.
virtual unsigned get_maximum_nchan () const
 Derived classes may be able to shrink the transformation array.
Protected Member Functions inherited from Pulsar::Calibrator
void copy_variation (Calibrator *)
void set_variation (Variation *var)
const Archiveget_calibrator () const
 Provide derived classes with access to the calibrator.
Archiveget_calibrator ()
 Provide derived classes with mutable access to the calibrator.
bool has_calibrator () const
 Return true if the calibrator attribute has been set.
Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
void __dereference (bool auto_delete=true) const

Protected Attributes

std::vector< Estimate< double > > baseline
 Intensity of off-pulse (system + sky), in CAL flux units.
Stokes< Estimate< double > > reference_source
 The Stokes parameters of the reference source.
bool source_set
 Flag raised when the reference_source attribute is set.
unsigned requested_nchan
 Requested number of frequency channels.
double outlier_threshold
 Threshold used to reject outliers when computing levels.
Protected Attributes inherited from Pulsar::PolnCalibrator
std::vector< std::vector< double > > covariance
 The array of covariance matrix vectors.
std::vector< Jones< float > > response
 The array of Jones matrices derived from the transformation array.
Reference::To< const PolnCalibratorExtensionpoln_extension
 The PolnCalibratorExtension of the Archive passed during construction.
Reference::To< const FeedExtensionfeed
 The FeedExtension of the Archive passed during construction.
bool built
 Flag set when response has been built.
unsigned observation_nchan
 The number of frequency channels in the observation to be calibrated.
bool do_backend_correction
 Perform backend corrections before inverting.
Index subint
 The sub-integration from which to construct a solution.
Protected Attributes inherited from Pulsar::Calibrator
Reference::To< Typetype
 The type of the Calibrator.
Reference::To< Variationvariation
 Updates model parameters.
Reference::To< const CalibratorExtensionextension
 The CalibratorExtension of the Archive passed during construction.
std::vector< std::string > filenames
 Filenames of Pulsar::Archives from which instance was created.

Detailed Description

Calibrators derived from reference source observations.

Member Function Documentation

◆ calculate_transformation()

◆ clone()

virtual ReferenceCalibrator * Pulsar::ReferenceCalibrator::clone ( ) const
pure virtual

◆ extra()

virtual void Pulsar::ReferenceCalibrator::extra ( unsigned ichan,
const std::vector< Estimate< double > > & source,
const std::vector< Estimate< double > > & sky )
inlineprotectedvirtual

Derived classes may also compute other things.

Reimplemented in Pulsar::DoPCalibrator, and Pulsar::OffPulseCalibrator.

Referenced by calculate_transformation().

◆ get_levels() [1/2]

void ReferenceCalibrator::get_levels ( const Archive * archive,
Index subint,
unsigned request_nchan,
std::vector< std::vector< Estimate< double > > > & hi,
std::vector< std::vector< Estimate< double > > > & lo,
double outlier_threshold )
static

Return the mean levels of the calibrator hi and lo states.

This method takes care of averaging the calibrator levels from multiple sub-integrations

References get_levels(), outlier_threshold, Pulsar::PolnCalibrator::subint, and Pulsar::Calibrator::verbose.

◆ get_levels() [2/2]

void ReferenceCalibrator::get_levels ( const Integration * integration,
unsigned request_nchan,
std::vector< std::vector< Estimate< double > > > & hi,
std::vector< std::vector< Estimate< double > > > & lo,
double outlier_threshold )
static

Return the mean levels of the calibrator hi and lo states.

Parameters
integrationthe calibrator Integration from which to derive levels
request_nchanthe desired frequency resolution
Return values
cal_hithe mean levels of the calibrator hi state
cal_lothe mean levels of the calibrator lo state

References Pulsar::Integration::clone(), clone(), Pulsar::Integration::get_nchan(), Pulsar::Integration::get_npol(), Pulsar::Integration::get_weight(), Pulsar::Calibrator::median_smoothing, outlier_threshold, Pulsar::SquareWave::set_outlier_threshold(), smooth_bandpass, and Pulsar::Calibrator::verbose.

◆ set_calibrator()

void ReferenceCalibrator::set_calibrator ( const Archive * archive)
protectedvirtual

◆ solve()

virtual MEAL::Complex2 * Pulsar::ReferenceCalibrator::solve ( const std::vector< Estimate< double > > & hi,
const std::vector< Estimate< double > > & lo )
protectedpure virtual

Derived classes must perform the actual solution.

Implemented in Pulsar::PolarCalibrator, and Pulsar::SingleAxisCalibrator.

Referenced by calculate_transformation().


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

Generated using doxygen 1.14.0