Array of Profiles integrated over the same time interval. More...

#include <Integration.h>

Inheritance diagram for Pulsar::Integration:
Pulsar::Container Reference::Able Reference::HeapTracked Pulsar::BasicIntegration

Classes

class  Expert
 Provides access to private and protected members of Integration. More...
 
class  Extension
 
class  Interface
 Provides a text interface to get and set Integration attributes. More...
 
class  Meta
 Stores otherwise shared attributes of orphaned Integrations. More...
 

Public Member Functions

 Integration ()
 Default constructor.
 
 Integration (const Integration &subint)
 Copy constructor.
 
Integrationoperator= (const Integration &subint)
 Assignment operator.
 
virtual ~Integration ()
 Destructor.
 
virtual Interfaceget_interface ()
 Return a text interface that can be used to access this instance.
 
void zero ()
 Zero all the profiles, keeping all else the same.
 
MJD get_start_time () const
 Get the MJD at the start of the integration (convenience interface)
 
MJD get_end_time () const
 Get the MJD at the end of the integration (convenience interface)
 
double get_centre_frequency (unsigned ichan) const
 Get the Profile centre frequency attribute of the given channel. More...
 
void set_centre_frequency (unsigned ichan, double frequency)
 Set the Profile centre frequency attributes of the given channel. More...
 
float get_weight (unsigned ichan) const
 Get the Profile weight attribute of the given channel. More...
 
void set_weight (unsigned ichan, float weight)
 Set the Profile weight attributes of the given channel. More...
 
void find_transitions (int &hi2lo, int &lo2hi, int &buffer) const
 Find the transitions between high and low states in total intensity. More...
 
void find_peak_edges (int &rise, int &fall) const
 Find the bins in which the total intensity exceeds a threshold. More...
 
float find_max_phase () const
 Returns the centre phase of the region with maximum total intensity. More...
 
float find_min_phase (float dc=0.10) const
 Returns the centre phase of the region with minimum total intensity. More...
 
PhaseWeightbaseline () const
 Return a new PhaseWeight instance with the baseline phase bins masked.
 
void baseline_stats (std::vector< std::vector< Estimate< double > > > *mean, std::vector< std::vector< double > > *variance=0, const PhaseWeight *baseline=0) const
 Return the statistics of every profile baseline.
 
void remove_baseline (const PhaseWeight *baseline=0)
 Remove the baseline from all profiles. More...
 
void cal_levels (std::vector< std::vector< Estimate< double > > > &hi, std::vector< std::vector< Estimate< double > > > &lo) const
 Returns the mean hi/lo and variance of the mean hi/lo of every profile. More...
 
double weighted_frequency (unsigned ch_start=0, unsigned ch_end=0) const
 Computes the weighted centre frequency of an interval of sub-channels. More...
 
double effective_bandwidth (unsigned ch_start=0, unsigned ch_end=0) const
 Computes the effective bandwidth of an interval of sub-channels.
 
void uniform_weight (float new_weight=1.0)
 Set the weight of each profile to the given number.
 
void dedisperse ()
 Remove dispersion delays with respect to centre frequency. More...
 
void defaraday ()
 Remove Faraday rotation with respect to centre frequency. More...
 
template<class T >
const T * get () const
 
template<class T >
T * get ()
 
template<class T >
T * getadd ()
 
Copying and Cloning

The clone and total methods return pointers to new copy-constructed instances.

virtual Integrationclone () const =0
 Return a new copy of self.
 
void orphan ()
 Disconnect from parent archive (useful after cloning a working copy)
 
void adopt (const Archive *)
 Connect to a new parent archive (also useful after cloning)
 
Integrationtotal () const
 Return an orphaned pscrunched dedispersed fscrunched clone of self. More...
 
Integration Unique Attributes

These pure virtual methods provide access to the attributes that are unique to each Integration.

virtual MJD get_epoch () const =0
 Get the epoch of the rising edge of bin zero.
 
virtual void set_epoch (const MJD &mjd)=0
 Set the epoch of the rising edge of bin zero.
 
virtual double get_duration () const =0
 Get the total time integrated (in seconds)
 
virtual void set_duration (double seconds)=0
 Set the total time integrated (in seconds)
 
virtual double get_folding_period () const =0
 Get the folding or topocentric pulsar period (in seconds)
 
virtual void set_folding_period (double seconds)=0
 Set the folding or topocentric pulsar period (in seconds)
 
virtual double get_gate_duty_cycle () const
 Get the fraction of the pulse period recorded (in turns)
 
virtual void set_gate_duty_cycle (double turns)
 Set the fraction of the pulse period recorded (in turns)
 
Archive Shared Attributes

By default, each Integration has the same observing parameters as all other Integrations in the Archive; therefore, it is not possible to set these attributes through the Integration base class interface.

std::string get_telescope () const
 Get the telescope name.
 
sky_coord get_coordinates () const
 Get the source coordinates.
 
double get_centre_frequency () const
 Get the centre frequency (in MHz)
 
double get_bandwidth () const
 Get the bandwidth (in MHz)
 
double get_dispersion_measure () const
 Get the dispersion measure (in ${\rm pc\, cm}^{-3}$)
 
bool get_dedispersed () const
 Inter-channel dispersion delay has been removed.
 
double get_rotation_measure () const
 Get the rotation measure (in ${\rm rad\, m}^{-2}$)
 
bool get_faraday_corrected () const
 Data has been corrected for ISM faraday rotation.
 
Signal::Basis get_basis () const
 Get the feed configuration of the receiver.
 
Signal::State get_state () const
 Get the polarimetric state of the profiles.
 
bool get_auxiliary_dispersion_corrected () const
 Auxiliary inter-channel dispersion delay has been removed.
 
bool get_auxiliary_birefringence_corrected () const
 Auxiliary inter-channel birefringence has been removed.
 
double get_effective_dispersion_measure () const
 Get the effective dispersion measure that remains to be corrected.
 
double get_effective_rotation_measure () const
 Get the effective rotation measure that remains to be corrected.
 
Data Access

These methods provide access to the data contained in the Integration

Profileget_Profile (unsigned ipol, unsigned ichan)
 Returns a pointer to the Profile given by the specified indeces.
 
const Profileget_Profile (unsigned ipol, unsigned ichan) const
 Returns a const pointer to the Profile given by the specified indeces.
 
PolnProfilenew_PolnProfile (unsigned ichan)
 Returns a pointer to a new PolnProfile instance. More...
 
const PolnProfilenew_PolnProfile (unsigned ichan) const
 Returns a const pointer to a new PolnProfile instance.
 
Stokes< float > get_Stokes (unsigned ichan, unsigned ibin) const
 Return the Stokes 4-vector for the frequency channel and phase bin. More...
 
void get_Stokes (std::vector< Stokes< float > > &S, unsigned iother, Signal::Dimension abscissa=Signal::Phase) const
 Returns a vector of Stokes parameters along the specified dimension. More...
 
Extension Interface

Additional algorithms or information can be made available through use of Extension classes.

virtual unsigned get_nextension () const
 Return the number of extensions available.
 
virtual const Extensionget_extension (unsigned iextension) const
 Return a pointer to the specified extension. More...
 
virtual Extensionget_extension (unsigned iextension)
 Return a pointer to the specified extension. More...
 
template<class ExtensionType >
const ExtensionType * get () const
 Template method searches for an Extension of the specified type.
 
template<class ExtensionType >
ExtensionType * get ()
 Template method searches for an Extension of the specified type.
 
template<class ExtensionType >
ExtensionType * getadd ()
 Template method returns an Extension of the specified type.
 
virtual void add_extension (Extension *extension)
 Add an Extension to the Integration instance. More...
 
virtual std::string list_extensions () const
 Return a comma-separated list of the short names of all extensions.
 
virtual void edit_extensions (const std::string &name)
 Add or remove extensions with the specified short name.
 
Expertexpert ()
 Provide access to the expert interface.
 
const Expertexpert () const
 Return the number of extensions available.
 
Profile::Strategiesget_strategy () const
 Returns the strategy manager.
 
- 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 unsigned get_instance_count ()
 returns the number of Integration instances
 
- 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 bool verbose = false
 flag controls the amount output to stderr by Integration methods
 
static double match_max_frequency_difference = 0.1
 Maximum centre frequency difference in Integration::mixable. More...
 

Dimension Attributes

The pure virtual methods are used by the Integration class to set the dimension attributes stored by the derived classes.

Note that the dimensions of an Integration should be changed only through the resize method.

class Archive
 The Extensions added to this Integration instance.
 
class Extension
 The Extensions added to this Integration instance.
 
class Calibrator
 The Extensions added to this Integration instance.
 
class Expert
 The Extensions added to this Integration instance.
 
std::vector< Reference::To< Extension > > extension
 The Extensions added to this Integration instance.
 
std::vector< std::vector< Reference::To< Profile > > > profiles
 Data: npol by nchan profiles.
 
Reference::To< const Archive, false > parent
 The Archive that manages this integration.
 
Reference::To< Metaorphaned
 The orphaned Integration's attributes.
 
Reference::To< Expertexpert_interface
 Expert interface.
 
virtual unsigned get_nchan () const =0
 Get the number of chans. More...
 
virtual unsigned get_npol () const =0
 Get the number of polarization measurements. More...
 
virtual unsigned get_nbin () const =0
 Get the number of bins in each profile. More...
 
virtual void set_nbin (unsigned nbin)=0
 Set the number of pulsar phase bins.
 
virtual void set_nchan (unsigned nchan)=0
 Set the number of frequency channels.
 
virtual void set_npol (unsigned npol)=0
 Set the number of polarization measurements.
 
virtual void resize (unsigned npol=0, unsigned nchan=0, unsigned nbin=0)
 Set the dimensions of the data container. More...
 
virtual void insert (Integration *)
 Inserts Profiles from Integration into this.
 
virtual void remove (unsigned ichan)
 Remove a channel from this Integration.
 
virtual void remove (unsigned ichan_first, unsigned ichan_last)
 Remove an inclusive channel range from this Integration.
 
void reverse_chan ()
 Reverse the order of frequency channels. More...
 
void combine (const Integration *from)
 Combine from into this. More...
 
bool mixable (const Integration *integ, std::string &reason) const
 Test if integration may be combined with this. More...
 
virtual void copy (const Integration *subint, bool management=true)
 Copy the profiles and attributes through set_ get_ methods. More...
 
void swap_profiles (unsigned ipol, unsigned ichan, unsigned jpol, unsigned jchan)
 Swap the two specified profiles.
 
void rotate (double time)
 Rotate each profile by time (in seconds); updates the epoch attribute.
 
void rotate_phase (double phase)
 Rotate each profile by phase; does not update the epoch attribute.
 
void fold (unsigned nfold)
 Call Profile::fold on every profile.
 
void bscrunch (unsigned nscrunch)
 Call Profile::bsrunch on every profile.
 
void bscrunch_to_nbin (unsigned nbin)
 Call Profile::bsrunch_to_nbin on every profile.
 
void fscrunch (unsigned nscrunch=0)
 Integrate profiles from neighbouring chans. More...
 
void pscrunch ()
 Integrate profiles from single polarizations into one total intensity.
 
void invint ()
 Transform from Stokes (I,Q,U,V) to the polarimetric invariant interval. More...
 
void transform (const Jones< float > &response)
 Perform the congruence transformation on each polarimetric profile.
 
void transform (const std::vector< Jones< float > > &response)
 Perform frequency response on each polarimetric profile.
 
void convert_state (Signal::State state)
 Convert polarimetric data to the specified state.
 
virtual Profilenew_Profile ()
 All new Profile instances are created through this method. More...
 
void range_check (unsigned ipol, unsigned ichan) const
 Throw exception if ipol or ichan are out of range.
 

Additional Inherited Members

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

Detailed Description

Array of Profiles integrated over the same time interval.

This class stores a two-dimensional array of pulse Profile instances as a function of polarization and frequency.

Member Function Documentation

◆ add_extension()

void Pulsar::Integration::add_extension ( Extension ext)
virtual

Add an Extension to the Integration instance.

The derived class must ensure that only one instance of the Extension type is stored.

Returns
On successful addition, this method should return the pointer to the Extension, equal to the extension argument. If the Extension is not supported, this method should return a null pointer.

Derived classes need only define this method, as the non-const version implemented by the Integration base class simply calls this method.

Referenced by Pulsar::ColdPlasma< DispersionDelay, Dedisperse >::execute1(), Pulsar::ASPArchive::load_Integration(), Pulsar::FITSArchive::load_Plasma(), Pulsar::FITSArchive::load_Pointing(), Pulsar::FITSArchive::load_SpectralKurtosis(), and Pulsar::TimeIntegrate::transform().

◆ cal_levels()

void Pulsar::Integration::cal_levels ( std::vector< std::vector< Estimate< double > > > &  hi,
std::vector< std::vector< Estimate< double > > > &  lo 
) const

Returns the mean hi/lo and variance of the mean hi/lo of every profile.

Returns the mean (and variance of the mean) off the on and off pulse cal levels.

Referenced by Pulsar::DynamicCalSpectrumPlot::get_plot_array().

◆ combine()

void Pulsar::Integration::combine ( const Integration from)
protected

Combine from into this.

Users of this method should be aware that it does not keep full track of all the parameters of an Integration. It is designed to be used for low level arithmetic style addition only, not fully consistent combination. The supplied tscrunch routines should be used for such purposes.

This method is provided for experimental purposes and should not be used lightly. If the time spans of the two combined subints are not contiguous, several parameters in the result are no longer meaningful. Also, there is no way of knowing whether the profiles are aligned in phase. Developers who use this operator should perform the necessary rotations at the archive level (where the polyco resides) before summing the data in the Integrations.

References Pulsar::Profile::average(), get_duration(), get_nchan(), Pulsar::get_Profile(), get_Profile(), and get_weight().

◆ copy()

void Pulsar::Integration::copy ( const Integration subint,
bool  management = true 
)
protectedvirtual

Copy the profiles and attributes through set_ get_ methods.

Copy the common information from another Integration

References verbose.

◆ dedisperse()

void Pulsar::Integration::dedisperse ( )

Remove dispersion delays with respect to centre frequency.

Calls Dispersion::transform

References Pulsar::ColdPlasma< Corrector, History >::transform().

◆ defaraday()

void Pulsar::Integration::defaraday ( )

Remove Faraday rotation with respect to centre frequency.

Calls FaradayRotation::transform

Referenced by Pulsar::Archive::defaraday().

◆ find_max_phase()

float Pulsar::Integration::find_max_phase ( ) const

Returns the centre phase of the region with maximum total intensity.

◆ find_min_phase()

float Pulsar::Integration::find_min_phase ( float  dc = 0.10) const

Returns the centre phase of the region with minimum total intensity.

References verbose.

◆ find_peak_edges()

void Pulsar::Integration::find_peak_edges ( int &  rise,
int &  fall 
) const

Find the bins in which the total intensity exceeds a threshold.

◆ find_transitions()

void Pulsar::Integration::find_transitions ( int &  hi2lo,
int &  lo2hi,
int &  buf 
) const

Find the transitions between high and low states in total intensity.

◆ fscrunch()

void Pulsar::Integration::fscrunch ( unsigned  nscrunch = 0)
protected

Integrate profiles from neighbouring chans.

Parameters
nscrunchnumber of neighbouring frequency channels to integrate; if zero, then all channels are integrated into one

References Pulsar::FrequencyIntegrate::transform().

◆ get() [1/2]

template<class T >
T* Pulsar::Integration::get ( )

e.g. Integration* integration; MyExtension* ext = integration->get<MyExtension>();

◆ get() [2/2]

template<class T >
const T* Pulsar::Integration::get ( ) const

e.g. const Integration* integration; const MyExtension* ext = integration->get<MyExtension>();

◆ get_centre_frequency()

◆ get_extension() [1/2]

Pulsar::Integration::Extension * Pulsar::Integration::get_extension ( unsigned  iext)
virtual

Return a pointer to the specified extension.

Simply calls get_extension const

◆ get_extension() [2/2]

const Pulsar::Integration::Extension * Pulsar::Integration::get_extension ( unsigned  iext) const
virtual

Return a pointer to the specified extension.

Derived classes need only define this method, as the non-const version implemented by the Integration base class simply calls this method.

Referenced by Pulsar::TimeIntegrate::transform().

◆ get_nbin()

virtual unsigned Pulsar::Integration::get_nbin ( ) const
pure virtual

◆ get_nchan()

◆ get_npol()

◆ get_Stokes() [1/2]

void Pulsar::Integration::get_Stokes ( std::vector< Stokes< float > > &  S,
unsigned  iother,
Signal::Dimension  abscissa = Signal::Phase 
) const

Returns a vector of Stokes parameters along the specified dimension.

The vector of Stokes parameters may be calculated with either pulse phase or observing frequency as the abscissa.

Return values
Sa vector of Stokes parameters as a function of the given dimension
Parameters
iotherthe index in the other dimension from which to draw S
abscissathe dimension of the vector abscissa

By default, "get_Stokes (S, ichan);" will return the polarimetric profile from chan, ichan. To get the polarimetric spectra from the middle of the pulse profile, for example, call "get_Stokes (S, get_nbin()/2, Axis::Frequency);"

References Signal::Coherence, Signal::Frequency, Pulsar::get_Stokes(), Signal::Phase, and Signal::Stokes.

◆ get_Stokes() [2/2]

Stokes< float > Pulsar::Integration::get_Stokes ( unsigned  ichan,
unsigned  ibin 
) const

Return the Stokes 4-vector for the frequency channel and phase bin.

Return values
Stokes4-vector for the given frequency channel and phase bin
Parameters
ichanthe frequency channel
ibinthe phase bin
Precondition
The Integration must contain full polarimetric information. That is, get_state must return either Signal::Stokes or Signal::Coherence. An exception is thrown otherwise.

References Signal::Coherence, and Signal::Stokes.

◆ get_weight()

◆ getadd()

template<class T >
T* Pulsar::Integration::getadd ( )

If the specified extension type T does not exist, an atempt is made to add it using add_extension.

◆ invint()

void Pulsar::Integration::invint ( )
protected

Transform from Stokes (I,Q,U,V) to the polarimetric invariant interval.

Precondition
The profile baselines must have been removed (unchecked).

◆ mixable()

bool Pulsar::Integration::mixable ( const Integration integ,
std::string &  reason 
) const
protected

Test if integration may be combined with this.

This function defines the set of observing and processing parameters that should be equal (within certain limits) before two Integrations may be combined using operators.

Parameters
integpointer to Integration to be compared with this
Return values
reasonif match fails, describes why in English
Returns
true if archive matches this

References get_bandwidth(), get_basis(), get_centre_frequency(), get_dispersion_measure(), get_nbin(), get_nchan(), get_npol(), and get_state().

◆ new_PolnProfile()

Pulsar::PolnProfile * Pulsar::Integration::new_PolnProfile ( unsigned  ichan)

Returns a pointer to a new PolnProfile instance.

Returns a pointer to a new PolnProfile instance specified by ichan.

References Pulsar::get_Profile().

Referenced by Pulsar::PulsarCalibrator::add_pulsar(), Pulsar::ReceptionCalibrator::add_pulsar(), Pulsar::FaradayRotation::apply(), and Pulsar::MatrixTemplateMatching::get_toas().

◆ new_Profile()

Pulsar::Profile * Pulsar::Integration::new_Profile ( )
protectedvirtual

All new Profile instances are created through this method.

By over-riding this method, inherited types may re-define the type of Profile to which the elements of the profiles vector point.

◆ remove_baseline()

void Pulsar::Integration::remove_baseline ( const PhaseWeight baseline = 0)

Remove the baseline from all profiles.

If baseline is not specified, this method calls Integration::baseline to find the baseline mask.

This mask is then used to remove the baseline from each of the profiles over all polarizations and frequencies. If the dispersion measure and folding period have been previously set, the baseline phase is shifted according to the dispersion relation.

◆ resize()

void Pulsar::Integration::resize ( unsigned  new_npol = 0,
unsigned  new_nchan = 0,
unsigned  new_nbin = 0 
)
protectedvirtual

Set the dimensions of the data container.

If any current dimension is greater than that requested, the Profiles will be deleted and the dimension resized. If any current dimension is smaller than that requested, the dimension will be resized and new Profiles will be constructed. If any of the supplied paramaters is equal to zero, the dimension is left unchanged.

References Pulsar::new_Profile().

Referenced by Pulsar::IntegrationManager::insert(), and Pulsar::Archive::resize_Integration().

◆ reverse_chan()

void Pulsar::Integration::reverse_chan ( )
protected

Reverse the order of frequency channels.

Reverse the order of frequency channels for each polarization.

Referenced by Pulsar::Archive::reverse_chan().

◆ set_centre_frequency()

void Pulsar::Integration::set_centre_frequency ( unsigned  ichan,
double  frequency 
)

Set the Profile centre frequency attributes of the given channel.

Set the centre frequency of the given channel.

Parameters
ichanthe index of the channel to be set
frequencythe frequency of the given channel in MHz

Referenced by Pulsar::PatchFrequency::add_channels(), Pulsar::UVMArchive::load_header(), Pulsar::ASPArchive::load_Integration(), Pulsar::ASCIIArchive::load_Integration(), Pulsar::PRESTOArchive::load_Integration(), Pulsar::ExampleArchive::load_Integration(), Pulsar::EPOSArchive::load_Integration(), Pulsar::WAPPArchive::load_Integration(), and Pulsar::FrequencyIntegrate::transform().

◆ set_weight()

void Pulsar::Integration::set_weight ( unsigned  ichan,
float  weight 
)

Set the Profile weight attributes of the given channel.

Set the weight of the given channel.

Parameters
ichanthe index of the channel to be set
weightthe weight of the given channel

Referenced by Pulsar::Weight::copy_weights(), Pulsar::ChannelZapMedian::operator()(), Pulsar::SystemCalibrator::precalibrate(), Pulsar::ImageCorrection::transform(), Pulsar::IntegrationWeight::weight(), and Pulsar::ChannelZapMedian::weight().

◆ total()

Pulsar::Integration * Pulsar::Integration::total ( ) const

Return an orphaned pscrunched dedispersed fscrunched clone of self.

This method is primarily designed for use by the Integration::find_* methods. After calling fscrunch, the resulting Profile may have a different centre frequency than that of the Integration. Therefore, the Profile is dedispersed to match the phase referenced at the frequency returned by Integration::get_centre_frequency.

Referenced by Pulsar::Archive::total().

◆ weighted_frequency()

double Pulsar::Integration::weighted_frequency ( unsigned  chan_start = 0,
unsigned  chan_end = 0 
) const

Computes the weighted centre frequency of an interval of sub-channels.

Returns
the new weighted centre frequency (in MHz, rounded to nearest kHz)
Parameters
chan_startthe first chan included in the calculation
chan_endone more than the index of the last chan

Referenced by Pulsar::FrequencyIntegrate::transform().

Member Data Documentation

◆ match_max_frequency_difference

double Pulsar::Integration::match_max_frequency_difference = 0.1
static

Maximum centre frequency difference in Integration::mixable.

Maximum frequency difference in MHz


The documentation for this class was generated from the following files:
  • Integration.h
  • Integration.C
  • Integration_combine.C
  • Integration_insert.C
  • Integration_mixable.C
  • Integration_remove.C
  • Integration_resize.C
  • IntegrationExtension.h
  • Integration_cal_levels.C
  • Integration_convert_state.C
  • Integration_dedisperse.C
  • Integration_find.C
  • Integration_fscrunch.C
  • Integration_get_Stokes.C
  • Integration_invint.C
  • Integration_new_PolnProfile.C
  • Integration_orphan.C
  • Integration_remove_baseline.C
  • Integration_rotate.C
  • Integration_total.C
  • Integration_transform.C
  • Integration_weighted_frequency.C
  • StrategySet.C
  • Integration_defaraday.C

Generated using doxygen 1.8.17