Polarimetric pulse profile transformations and derivations. More...

#include <PolnProfile.h>

Inheritance diagram for Pulsar::PolnProfile:
Pulsar::Container Reference::Able Reference::HeapTracked

Public Member Functions

 PolnProfile ()
 Default constructor.
 
 PolnProfile (unsigned nbin)
 Construct with the specified number of phase bins.
 
 PolnProfile (Signal::Basis basis, Signal::State state, Profile *p0, Profile *p1, Profile *p2, Profile *p3)
 Construct from four externally-managed Profile objects.
 
virtual ~PolnProfile ()
 Destructor.
 
virtual PolnProfileclone () const
 Clone operator.
 
void resize (unsigned nbin)
 Set the number of bins.
 
unsigned get_nbin () const
 Get the number of bins.
 
const Profileget_Profile (unsigned ipol) const
 Get the specifed constant profile.
 
Profileget_Profile (unsigned ipol)
 Get the specified profile.
 
const float * get_amps (unsigned ipol) const
 Returns a const pointer to the start of the array of amplitudes.
 
float * get_amps (unsigned ipol)
 Returns a pointer to the start of the array of amplitudes.
 
void set_amps (unsigned ipol, float *amps)
 Set the amplitudes of the specified polarization.
 
void set_baseline (PhaseWeight *)
 Set the baseline used by some methods.
 
PhaseWeightget_baseline () const
 Get the baseline (if not the one set above, then the default)
 
void sum (const PolnProfile *that)
 Add that to this.
 
void diff (const PolnProfile *that)
 Subtract that from this.
 
Signal::Basis get_basis () const
 Get the Basis of the poln profile.
 
Signal::State get_state () const
 Get the State of the poln profile.
 
Stokes< float > get_Stokes (unsigned ibin) const
 Get the Stokes 4-vector for the specified bin.
 
void set_Stokes (unsigned ibin, const Stokes< float > &)
 Set the Stokes 4-vector for the specified bin.
 
Jones< double > get_coherence (unsigned ibin) const
 Get the coherency matrix for the specified bin.
 
void set_coherence (unsigned ibin, const Jones< double > &)
 Set the coherency matrix for the specified bin.
 
Quaternion< float, Hermitian > get_pseudoStokes (unsigned ibin) const
 Get the pseudo-Stokes 4-vector for the specified bin.
 
void set_pseudoStokes (unsigned ibin, const Quaternion< float, Hermitian > &)
 Set the pseudo-Stokes 4-vector for the specified bin.
 
double sum (int bin_start=0, int bin_end=0) const
 Returns the sum of all amplitudes.
 
double sumsq (int bin_start=0, int bin_end=0) const
 Returns the sum of all amplitudes squared.
 
void scale (double scale)
 multiplies each bin of each profile by scale
 
void rotate_phase (double turns)
 Rotate the phase of each profile.
 
void transform (const Jones< double > &response)
 Perform the congruence transformation on each bin of the profile.
 
void transform (const Matrix< 4, 4, double > &response)
 Perform the Mueller transformation on each bin of the profile.
 
void convert_state (Signal::State state)
 Convert to the specified state.
 
void convert_basis (Signal::Basis basis)
 Convert the Stokes parameters to the specified basis. More...
 
void invint (Profile *invint, bool second=true) const
 Return the invariant interval. More...
 
void invconv (Profile *invconv) const
 Return the invariant autoconvolution.
 
void get_linear (Profile *linear) const
 Return the linear polarization profile.
 
double get_linear_variance () const
 Return the variance of L estimated from off-pulse Q and U. More...
 
double get_linear_variance (std::pair< double, double > &qu_var) const
 Return the variance of L, Q and U.
 
void get_circular (Profile *circular) const
 Return the absolute circular polarization profile.
 
void get_polarized (Profile *polarized) const
 Return the total polarization profile.
 
void get_orientation (std::vector< Estimate< double > > &, float sigma) const
 Return the orientation and its estimated error for each pulse phase. More...
 
void get_ellipticity (std::vector< Estimate< double > > &, float sigma) const
 Return the ellipticity and its estimated error for each pulse phase.
 
void get_linear (std::vector< std::complex< Estimate< double > > > &L, float sigma) const
 
const StokesCovarianceget_covariance () const
 
StokesCovarianceget_covariance ()
 
- 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 Attributes

static bool normalize_weight_by_absolute_gain = false
 When set, PolnProfile::transform will normalize the Profile::weight. More...
 

Protected Member Functions

void check (const char *method, Signal::State want_state, unsigned want_ibin) const
 Throw an exception if want_state != state or want_ibin >= nbin.
 
void sum_difference (Profile *sum, Profile *difference)
 Efficiently forms the inplace sum and difference of two profiles. More...
 
void init ()
 Set everthing to null values.
 
void get_rss (Profile *rss, unsigned jpol, unsigned kpol, BaselineEstimator *baseline_estimator=0) const
 Does the work for get_polarized and get_linear. More...
 
- Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 
void __dereference (bool auto_delete=true) const
 

Protected Attributes

Signal::Basis basis
 The basis in which the radiation is measured.
 
Signal::State state
 The state of the polarimetric profiles.
 
Reference::To< Profileprofile [4]
 References to the polarimetric profiles.
 
Reference::To< PhaseWeightbaseline
 The baseline set in set_baseline.
 
Reference::To< PhaseWeightmy_baseline
 The baseline derived from the data.
 
Reference::To< StokesCovariancecovariance
 The phase-resolved four-dimensional Stokes covariance matrix.
 

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

Polarimetric pulse profile transformations and derivations.

This class uses references to Profile objects in order to manipulate externally stored polarimetric profiles.

Member Function Documentation

◆ convert_basis()

void Pulsar::PolnProfile::convert_basis ( Signal::Basis  to)

Convert the Stokes parameters to the specified basis.

Currently, this method should be used only to correct Stokes parameters that have been formed assuming linearly polarized receptors when in fact the receptors are circularly polarized.

References Signal::Stokes.

◆ get_linear_variance()

double Pulsar::PolnProfile::get_linear_variance ( ) const

Return the variance of L estimated from off-pulse Q and U.

L = sqrt(Q^2 + U^2) var{L} = (Q^2 var{Q} + U^2 var{U}) / L^2

To avoid the division by zero where L==0, you could turn

L > threshold * sigma_L

into

L*L > threshold * sigma_L * L

where sigma_L = sqrt(var{L})

However, sigma_L*L goes to zero where L==0 ...

If it is assumed that var{Q} ~= var{U}, then var{L} = var{Q or U} ... Therefore, take the mean: var{L}=(var{Q}+var{U})/2

◆ get_orientation()

void Pulsar::PolnProfile::get_orientation ( std::vector< Estimate< double > > &  posang,
float  sigma 
) const

Return the orientation and its estimated error for each pulse phase.

Returns a vector of position angle estimates as a function of pulse phase.

Referenced by Pulsar::new_Profile().

◆ get_rss()

void Pulsar::PolnProfile::get_rss ( Profile rss,
unsigned  jpol,
unsigned  kpol,
BaselineEstimator baseline_estimator = 0 
) const
protected

Does the work for get_polarized and get_linear.

rss stands for root-sum-squared

Precondition
The PolnProfile must contain Stokes parameters; so as to reduce the amount of behind the scenes cloning and state conversion
The Profile baselines should have been removed; so as not to interfere with any baseline removal algorithms already applied
Postcondition
The polarization profiles from jpol to kpol inclusive are added
The bias due to noise is removed before the square root is taken

References Pulsar::ProfileAmps::get_amps(), Pulsar::get_Profile(), Pulsar::Profile::resize(), Signal::Stokes, and Pulsar::Profile::zero().

◆ invint()

void Pulsar::PolnProfile::invint ( Profile invint,
bool  second = true 
) const

Return the invariant interval.

Forms the Stokes polarimetric invariant interval, $\sqrt{I^2-Q^2-U^2-V^2}$, for every phase bin so that, upon completion, npol == 1 and state == Signal::Invariant.

Precondition
The profile baselines must have been removed (unchecked).
Postcondition
The bias due to noise is removed

References Signal::Coherence, Pulsar::ProfileAmps::get_amps(), Pulsar::get_Profile(), Pulsar::get_Stokes(), Pulsar::Profile::offset(), Signal::PseudoStokes, Pulsar::Profile::resize(), Pulsar::Profile::set_centre_frequency(), Pulsar::Profile::set_weight(), Pulsar::Profile::square_root(), and Signal::Stokes.

Referenced by Pulsar::new_Profile().

◆ sum_difference()

void Pulsar::PolnProfile::sum_difference ( Profile sum,
Profile difference 
)
protected

Efficiently forms the inplace sum and difference of two profiles.

Return values
sum= sum + difference
difference= sum - difference

References Pulsar::ProfileAmps::get_amps(), and Pulsar::ProfileAmps::get_nbin().

Member Data Documentation

◆ normalize_weight_by_absolute_gain

bool Pulsar::PolnProfile::normalize_weight_by_absolute_gain = false
static

When set, PolnProfile::transform will normalize the Profile::weight.

When transforming Profile objects, the absolute gain of the transformation may artificially inflate the weight of the Profile and incorrectly skew mean results.


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

Generated using doxygen 1.8.17