The primary interface to pulsar observational data. More...

#include <Archive.h>

Inheritance diagram for Pulsar::Archive:
Pulsar::IntegrationManager Pulsar::Container Reference::Able Reference::HeapTracked Pulsar::BasicArchive Pulsar::EPNArchive Pulsar::PuMaArchive Pulsar::TimerArchive Pulsar::ASCIIArchive Pulsar::ASPArchive Pulsar::BPPArchive Pulsar::ExampleArchive Pulsar::FITSArchive Pulsar::PRESTOArchive Pulsar::UVMArchive Pulsar::WAPPArchive Pulsar::BasebandArchive Pulsar::ScintArchive

Classes

class  Expert
 Provides access to private and protected member of Archive. More...
 
class  Extension
 
class  Interface
 Provides a text interface to get and set Archive attributes. More...
 
class  Match
 Policy used to determine if two archives match. More...
 

Public Member Functions

 Archive ()
 Default constructor.
 
 Archive (const Archive &archive)
 Copy constructor. More...
 
virtual ~Archive ()
 Destructor.
 
Archiveoperator= (const Archive &a)
 Assignment operator. More...
 
void bscrunch (unsigned nscrunch)
 Integrate pulse profiles in phase. More...
 
void fold (unsigned nfold)
 Integrate neighbouring sections of the pulse profiles. More...
 
void pscrunch ()
 Integrate profiles in polarization. More...
 
void fscrunch (unsigned nscrunch=0)
 Integrate profiles in frequency. More...
 
void tscrunch (unsigned nscrunch=0)
 Integrate profiles in time. More...
 
void rotate (double time)
 Phase rotate each profile by time seconds.
 
void rotate_phase (double phase)
 Rotate each profile by phase.
 
void append (const Archive *archive)
 Append the Integrations from the specifed archive. More...
 
void remove_chan (unsigned first, unsigned last)
 Delete the specified inclusive channel range from the Archive.
 
void update_centre_frequency ()
 Update the centre frequency.
 
void centre (double phase_offset=0.5)
 Phase rotate pulsar Integrations so that pulse phase zero is centred. More...
 
void centre_max_bin (double phase_offset=0.5)
 Phase rotate pulsar Integrations so centre the maximum amplitude. More...
 
void convert_state (Signal::State state)
 Convert data to the specified state. More...
 
Signal::Basis get_basis () const
 Convenience interface to Receiver::get_basis.
 
void dedisperse ()
 Rotate the Profiles to remove dispersion delays b/w chans. More...
 
void defaraday ()
 Correct the Faraday rotation of Q into U. More...
 
void transform (const Jones< float > &)
 Perform the transformation on each polarimetric profile.
 
void transform (const std::vector< Jones< float > > &)
 Perform frequency response on each polarimetric profile.
 
void transform (const std::vector< std::vector< Jones< float > > > &)
 Perform the time and frequency response on each polarimetric profile.
 
void invint ()
 Transform Stokes I,Q,U,V into the polarimetric invariant interval.
 
PhaseWeightbaseline () const
 Return a new PhaseWeight instance with the baseline phase bins masked.
 
void remove_baseline ()
 Remove the baseline from all profiles.
 
void uniform_weight (float new_weight=1.0)
 Set the weight of each profile to the given number.
 
bool standard_match (const Archive *arch, std::string &reason) const
 Test if arch matches (enough for a pulsar - standard match)
 
bool calibrator_match (const Archive *arch, std::string &reason) const
 Test if arch matches (enough for a pulsar - calibrator match)
 
bool processing_match (const Archive *arch, std::string &reason) const
 Test if arch matches (enough for a pulsar - pulsar match)
 
bool mixable (const Archive *arch, std::string &reason) const
 Test if arch is mixable (enough for append)
 
double weighted_frequency (unsigned ichan, unsigned start, unsigned end) const
 Computes the weighted channel frequency over an Integration interval. More...
 
void bscrunch_to_nbin (unsigned new_nbin)
 Call bscrunch with the appropriate value. More...
 
void fscrunch_to_nchan (unsigned new_nchan)
 Call fscrunch with the appropriate value. More...
 
void tscrunch_to_nsub (unsigned new_nsub)
 Call tscrunch with the appropriate value. More...
 
MJD start_time () const
 Return the MJD at the start of the first sub-integration.
 
MJD end_time () const
 Return the MJD at the end of the last sub-integration.
 
double integration_length () const
 Returns the total time integrated into all Integrations (in seconds)
 
bool type_is_cal () const
 Return true if the observation is a calibrator.
 
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.15) const
 Returns the centre phase of the region with minimum total intensity. More...
 
float rms_baseline (float dc=0.4)
 Returns geometric mean of baseline RMS for each Integration. More...
 
virtual Interfaceget_interface ()
 Return a text interface that can be used to access this instance.
 
Expertexpert ()
 Provide access to the expert interface.
 
const Expertexpert () const
 Provide access to the expert interface.
 
const Matchget_standard_match () const
 Policy determines if a standard/template matches an observation.
 
void set_standard_match (Match *)
 
const Matchget_calibrator_match () const
 Policy determines if a calibrator matches an observation.
 
void set_calibrator_match (Match *)
 
const Matchget_processing_match () const
 Policy determines if data were processed identically.
 
void set_processing_match (Match *)
 
const Matchget_mixable () const
 Policy determines if data can be combined/integrated.
 
void set_mixable (Match *)
 
template<class T >
const T * get () const
 
template<class T >
T * get ()
 
template<class T >
T * getadd ()
 
Copying and Cloning

The copy methods copy data from other Archive instances; the clone, extract, and total methods return pointers to new copy-constructed instances.

void copy (const Archive &)
 Copy all base class attributes, Extensions, and Integrations.
 
void copy (const Archive *)
 Copy all base class attributes, Extensions, and Integrations.
 
virtual Archiveclone () const =0
 Return a new copy constructed instance equal to this. More...
 
Archivetotal (bool tscrunch=true) const
 Return pointer to a new fscrunched, tscrunched and pscrunched clone. More...
 
Archiveextract (std::vector< unsigned > &subints) const
 Return pointer to a new instance with only the specified subints.
 
Common Attributes

These pure virtual methods provide access to the common attributes stored by all derived classes.

virtual std::string get_telescope () const =0
 Get the name of the telescope used.
 
virtual void set_telescope (const std::string &code)=0
 Set the name of the telescope used.
 
virtual Signal::State get_state () const =0
 Get the state of the profile data.
 
virtual void set_state (Signal::State state)=0
 Set the state of the profile data.
 
virtual Signal::Scale get_scale () const =0
 Get the scale in which flux density is measured.
 
virtual void set_scale (Signal::Scale scale)=0
 Set the scale in which flux density is measured.
 
virtual Signal::Source get_type () const =0
 Get the observation type (psr, cal)
 
virtual void set_type (Signal::Source type)=0
 Set the observation type (psr, cal)
 
virtual std::string get_source () const =0
 Get the source name.
 
virtual void set_source (const std::string &source)=0
 Set the source name.
 
virtual sky_coord get_coordinates () const =0
 Get the coordinates of the source.
 
virtual void set_coordinates (const sky_coord &coordinates)=0
 Set the coordinates of the source.
 
virtual double get_centre_frequency () const =0
 Get the centre frequency of the observation.
 
virtual void set_centre_frequency (double cf)=0
 Set the centre frequency of the observation.
 
virtual double get_bandwidth () const =0
 Get the overall bandwidth of the observation.
 
virtual void set_bandwidth (double bw)=0
 Set the overall bandwidth of the observation.
 
virtual double get_dispersion_measure () const =0
 Get the dispersion measure (in ${\rm pc\, cm}^{-3}$)
 
virtual void set_dispersion_measure (double dm)=0
 Set the dispersion measure (in ${\rm pc\, cm}^{-3}$)
 
virtual bool get_dedispersed () const =0
 Inter-channel dispersion delay has been removed.
 
virtual void set_dedispersed (bool done=true)=0
 Set the value to be returned by get_dedispersed.
 
virtual double get_rotation_measure () const =0
 Get the rotation measure (in ${\rm rad\, m}^{-2}$)
 
virtual void set_rotation_measure (double rm)=0
 Set the rotation measure (in ${\rm rad\, m}^{-2}$)
 
virtual bool get_faraday_corrected () const =0
 Data has been corrected for ISM faraday rotation.
 
virtual void set_faraday_corrected (bool done=true)=0
 Set the value to be returned by get_ism_rm_corrected.
 
virtual bool get_poln_calibrated () const =0
 Data has been calibrated for polarimetric response of instrument.
 
virtual void set_poln_calibrated (bool done=true)=0
 Set the value to be returned by get_poln_calibrated.
 
Data Access

These methods provide access to the data contained in the Archive.

Note that get_Integration is implemented by the IntegrationManager base class.

Profileget_Profile (unsigned subint, unsigned pol, unsigned chan)
 Return pointer to the specified profile. More...
 
const Profileget_Profile (unsigned subint, unsigned pol, unsigned chan) const
 Return pointer to the specified profile.
 
TEMPO Interface

These methods provide access to the pulsar ephemeris and predictor as used by TEMPO.

void set_ephemeris (const Parameters *ephemeris, bool update=true)
 Install the given ephemeris and call update_model. More...
 
const Parametersget_ephemeris () const
 Return a pointer to the current archive ephemeris.
 
bool has_ephemeris () const
 Return true if the Archive has an ephemeris.
 
void set_model (const Predictor *model, bool apply=true)
 Install the given predictor and shift profiles to align.
 
const Predictorget_model () const
 Return a pointer to the current phase predictor.
 
bool has_model () const
 Returns true if the Archive has a model.
 
void update_model ()
 Create a new predictor and align the Integrations to the new model. More...
 
Extension Interface

Derived classes can provide access to the additional information available in their associated file format 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 Archive instance. More...
 
- Public Member Functions inherited from Pulsar::IntegrationManager
 IntegrationManager ()
 null constructor
 
 IntegrationManager (const IntegrationManager &archive)
 copy constructor
 
IntegrationManageroperator= (const IntegrationManager &archive)
 operator =
 
virtual ~IntegrationManager ()
 destructor
 
Integrationget_Integration (unsigned subint)
 Return pointer to the specified Integration. More...
 
Integrationget_last_Integration ()
 Return a pointer to the last Integration.
 
Integrationget_first_Integration ()
 Return a pointer to the first Integration.
 
const Integrationget_Integration (unsigned subint) const
 Return const pointer to the specified Integration.
 
const Integrationget_last_Integration () const
 Return a const pointer to the last Integration.
 
const Integrationget_first_Integration () const
 Return a const pointer to the first Integration.
 
virtual Integrationnew_Integration (const Integration *copy=0)=0
 Construct new Integration instance.
 
virtual unsigned get_nsubint () const =0
 Get the number of sub-integrations stored in the file. More...
 
Expertexpert ()
 Provide access to the expert interface. More...
 
- 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 void agent_report ()
 Report on the status of the plugins.
 
static void agent_list ()
 List the successfully loaded plugins.
 
static void set_verbosity (unsigned level)
 Set the verbosity level (0 to 3)
 
Factories

These factories return pointers to new instances of derived classes.

static Archivenew_Archive (const std::string &class_name)
 Factory returns a null-constructed instance of the named class. More...
 
static Archiveload (const std::string &name)
 Factory returns a new instance loaded from filename.
 
static unsigned get_instance_count ()
 Returns the number of Archive 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 Functor< void(Archive *) > remove_baseline_strategy
 The default baseline removal strategy.
 
- Static Public Attributes inherited from Pulsar::IntegrationManager
static unsigned verbose = 1
 A verbosity flag that can be set for debugging purposes.
 

Protected Member Functions

Integrationuse_Integration (Integration *)
 Return the given Integration ready for use.
 
void init_Integration (Integration *subint, bool check_phase=false)
 Initialize an Integration to reflect Archive attributes. More...
 
void resize_Integration (Integration *integration)
 Provide Integration::resize access to Archive-derived classes.
 
void apply_model (Integration *subint, const Predictor *old=0)
 Apply the current model to the Integration. More...
 
void update_model (unsigned old_nsubint, bool clear_model=false)
 Update the predictor model and correct the Integration set. More...
 
void update_model (const MJD &time, bool clear_model=false)
 Update the predictor to include the specifed MJD.
 
void create_updated_model (bool clear_model)
 Creates polynomials to span the Integration set. More...
 
bool good_model (const Predictor *test_model) const
 Returns true if the given model spans the Integration set. More...
 
bool zero_phase_aligned () const
 Return true if all Integration::zero_phase_aligned flags are set.
 
- Protected Member Functions inherited from Pulsar::IntegrationManager
virtual void set_nsubint (unsigned num_sub)=0
 Set the number of sub-integrations. More...
 
virtual void resize (unsigned nsubint, bool instances=true)
 Resize the Integration vector. More...
 
void append (const IntegrationManager *more_subints)
 Append new_Integration copies of Integration objects to self.
 
void manage (IntegrationManager *more_subints)
 Append use_Integration modifications of Integration objects to self.
 
void manage (Integration *integration)
 Directly append the Integration instance (no copy)
 
void insert (unsigned isubint, Integration *integration)
 Insert the Integration instance into the specified location.
 
void unmanage (const Integration *)
 Remove the Integration instance.
 
void unmanage (unsigned isubint)
 Remove the Integration at the specified index.
 
template<class StrictWeakOrdering >
void sort (StrictWeakOrdering comp=temporal_order)
 Sort the Integrations according to the specified order.
 
void load_all ()
 
- Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 
void __dereference (bool auto_delete=true) const
 

Static Protected Member Functions

static std::string get_revision (const char *revision)
 Parses the revision number out of the CVS Revision string.
 

Protected Attributes

std::string unload_filename
 Name of file to which the archive will be written on call to unload()
 
Reference::To< Parametersephemeris
 The pulsar ephemeris, as used by TEMPO.
 
Reference::To< Predictormodel
 The pulsar phase model, as created using TEMPO.
 
Reference::To< Expertexpert_interface
 Expert interface.
 
Reference::To< Interfacetext_interface
 Text interface.
 
Reference::To< Matchstandard_match_policy
 
Reference::To< Matchcalibrator_match_policy
 
Reference::To< Matchprocessing_match_policy
 
Reference::To< Matchmixable_policy
 

Friends

class Expert
 

File I/O

These pure virtual methods must be defined by derived classes in order to handle loading and unloading data to and from specific file formats.

static Option< std::string > unload_class
 Name of class to which data are converted if unload_file unimplemented.
 
static Option< bool > no_clobber
 Default policy for overwriting archive files.
 
virtual bool can_unload () const =0
 Return true if the unload method is implemented.
 
void unload (const char *filename=0) const
 Write the archive to filename. More...
 
void unload (const std::string &filename) const
 Convenience interface to Archive::unload (const char*)
 
std::string get_filename () const
 Get the name of the file to which the archive will be unloaded.
 
void set_filename (const std::string &filename)
 Set the filename of the Archive. More...
 
void update ()
 Update the current archive, saving current Integration data.
 
void refresh ()
 Completely reload the archive, deleting all data.
 
virtual void load_header (const char *filename)=0
 Load the header information from filename.
 
virtual Integrationload_Integration (const char *filename, unsigned subint)=0
 Load the specified Integration from filename, returning new instance.
 
virtual void unload_file (const char *filename) const =0
 Unload the Archive (header and Integration data) to filename.
 

Dimension Attributes

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

virtual unsigned get_nbin () const =0
 Get the number of pulsar phase bins used.
 
virtual unsigned get_nchan () const =0
 Get the number of frequency channels used.
 
virtual unsigned get_npol () const =0
 Get the number of polarizations.
 
virtual void resize (unsigned nsubint, unsigned npol=0, unsigned nchan=0, unsigned nbin=0)
 Resize the Integration vector with new_Integration instances. More...
 
virtual void erase (unsigned isubint)
 Remove the specified sub-integration.
 
virtual void set_nbin (unsigned numbins)=0
 Set the number of pulsar phase bins.
 
virtual void set_nchan (unsigned numchan)=0
 Set the number of frequency channels.
 
virtual void set_npol (unsigned numpol)=0
 Set the number of polarization measurements.
 

Detailed Description

The primary interface to pulsar observational data.

This virtual base class implements the primary interface to pulsar observational data, including the pulse profiles, integrations, and all auxilliary data. All file I/O and various data reduction algorithms are accessed via this class.

Constructor & Destructor Documentation

◆ Archive()

Pulsar::Archive::Archive ( const Archive archive)

Copy constructor.

The Archive copy constructor must never be called, call Archive::copy.

Member Function Documentation

◆ add_extension()

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

Add an Extension to the Archive instance.

This method ensures that only one instance of the Extension type is stored in the Archive.

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

References Pulsar::Archive::Extension::get_extension_name().

Referenced by Pulsar::Editor::add_extension(), Pulsar::SetReceiver::apply(), getadd(), and Pulsar::FITSArchive::load_DigitiserCounts().

◆ append()

void Pulsar::Archive::append ( const Archive arch)

Append the Integrations from the specifed archive.

Add clones of the Integrations in arch to this.

◆ apply_model()

void Pulsar::Archive::apply_model ( Integration subint,
const Predictor old = 0 
)
protected

Apply the current model to the Integration.

This method aligns the Integration to the current polyco, as stored in the model attribute. The Integration is rotated by the difference between the phase predicted by the current model and that predicted by the old model.

Parameters
oldthe old polyco used to describe subint
subintpointer to the Integration to be aligned to the current model

References Pulsar::Predictor::phase().

◆ bscrunch()

void Pulsar::Archive::bscrunch ( unsigned  nscrunch)

Integrate pulse profiles in phase.

Simply calls Integration::bscrunch for each Integration

Parameters
nscrunchthe number of phase bins to add together

References Pulsar::get_Integration().

◆ bscrunch_to_nbin()

void Pulsar::Archive::bscrunch_to_nbin ( unsigned  new_nbin)

Call bscrunch with the appropriate value.

Useful wrapper for Archive::bscrunch

References Pulsar::get_Integration().

◆ centre()

void Pulsar::Archive::centre ( double  phase_offset = 0.5)

Phase rotate pulsar Integrations so that pulse phase zero is centred.

Uses the polyco model, as well as the centre frequency and mid-time of each Integration to determine the predicted pulse phase.

References Pulsar::get_Integration(), and Signal::Pulsar.

Referenced by Calibration::StandardPrepare::prepare().

◆ centre_max_bin()

void Pulsar::Archive::centre_max_bin ( double  phase_offset = 0.5)

Phase rotate pulsar Integrations so centre the maximum amplitude.

Rotate pulsar Integrations so that the bin of largest amplitude is centred

References Pulsar::Profile::find_max_bin(), Pulsar::Integration::get_folding_period(), Pulsar::IntegrationManager::get_Integration(), and get_Profile().

◆ clone()

◆ convert_state()

◆ create_updated_model()

void Pulsar::Archive::create_updated_model ( bool  clear_model)
protected

Creates polynomials to span the Integration set.

The polyco need only describe the phase and period of every Integration. When the Integrations are separated by a large amount of time, the creation of a new polyco to completely span this time results in a huge polyco.dat and a huge waste of time.

Therefore, this method attempts to create the minimum set of polyco polynomials required to describe the data. If a match is not found in the current model, a single polynomial is created and appended to the current model.

Parameters
clear_modeldelete the current model after copying its attributes

References Pulsar::Integration::get_epoch(), Pulsar::get_Integration(), and Signal::Pulsar.

◆ dedisperse()

void Pulsar::Archive::dedisperse ( )

Rotate the Profiles to remove dispersion delays b/w chans.

The dedisperse method removes the dispersive delay between each frequency channel and that of the reference frequency defined by get_centre_frequency.

References Pulsar::IntegrationManager::get_Integration(), Pulsar::IntegrationManager::get_nsubint(), and set_dedispersed().

Referenced by Calibration::StandardPrepare::prepare(), and Pulsar::SimPolnTiming::set_standard().

◆ defaraday()

void Pulsar::Archive::defaraday ( )

Correct the Faraday rotation of Q into U.

The defaraday method corrects the Faraday rotation between each frequency channel and that of the reference frequency defined by get_centre_frequency.

Precondition
The Archive must contain full polarimetric data
The noise contribution to Stokes Q and U should have been removed.

References Pulsar::Integration::defaraday(), Pulsar::get_Integration(), and Pulsar::warning.

Referenced by Pulsar::DeltaRM::set_data().

◆ find_max_phase()

float Pulsar::Archive::find_max_phase ( ) const

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

◆ find_min_phase()

float Pulsar::Archive::find_min_phase ( float  dc = 0.15) const

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

◆ find_peak_edges()

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

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

◆ find_transitions()

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

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

◆ fold()

void Pulsar::Archive::fold ( unsigned  nfold)

Integrate neighbouring sections of the pulse profiles.

Parameters
nfoldthe number of sections to integrate

References Pulsar::get_Integration().

◆ fscrunch()

void Pulsar::Archive::fscrunch ( unsigned  nscrunch = 0)

Integrate profiles in frequency.

Simply calls Integration::fscrunch for each Integration

Parameters
nscrunchthe number of frequency channels to add together

References Pulsar::get_Integration().

Referenced by Calibration::StandardPrepare::choose(), Pulsar::CommonOptions::process(), Pulsar::SimPolnTiming::set_standard(), and Pulsar::StandardSNRWeight::StandardSNRWeight().

◆ fscrunch_to_nchan()

void Pulsar::Archive::fscrunch_to_nchan ( unsigned  new_chan)

Call fscrunch with the appropriate value.

Useful wrapper for Archive::fscrunch

◆ get()

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

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

References Pulsar::IntegrationManager::verbose.

◆ get_extension() [1/2]

const Pulsar::Archive::Extension * Pulsar::Archive::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 Archive base class simply calls this method.

Referenced by Pulsar::FrequencyAppend::combine(), and Pulsar::Editor::remove_extension().

◆ get_extension() [2/2]

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

Return a pointer to the specified extension.

Simply calls get_extension const

◆ get_Profile()

Pulsar::Profile * Pulsar::Archive::get_Profile ( unsigned  sub,
unsigned  pol,
unsigned  chan 
)

◆ getadd()

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

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

References add_extension().

◆ good_model()

bool Pulsar::Archive::good_model ( const Predictor test_model) const
protected

Returns true if the given model spans the Integration set.

This method tests if the given phase predictor applies to each Integration, returning false if an exception is thrown.

Parameters
test_modelthe Predictor to be tested

References Pulsar::get_Integration(), and Pulsar::Predictor::phase().

◆ init_Integration()

void Pulsar::Archive::init_Integration ( Integration subint,
bool  check_phase = false 
)
protected

Initialize an Integration to reflect Archive attributes.

After an Integration has been loaded from disk, this method ensures that various internal book-keeping attributes are initialized.

References Pulsar::Dedisperse::set_dispersion_measure(), Pulsar::ColdPlasmaHistory::set_reference_frequency(), and Pulsar::DeFaraday::set_rotation_measure().

◆ new_Archive()

Pulsar::Archive * Pulsar::Archive::new_Archive ( const std::string &  class_name)
static

Factory returns a null-constructed instance of the named class.

Return a null-constructed instance of the derived class.

References Registry::List< Parent >::get_registry(), and Registry::List< Parent >::size().

Referenced by Pulsar::Calibrator::new_solution().

◆ operator=()

Pulsar::Archive & Pulsar::Archive::operator= ( const Archive a)

Assignment operator.

operator =

◆ pscrunch()

◆ resize()

void Pulsar::Archive::resize ( unsigned  nsubint,
unsigned  npol = 0,
unsigned  nchan = 0,
unsigned  nbin = 0 
)
virtual

Resize the Integration vector with new_Integration instances.

If any current dimension is greater than that requested, the extra 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 one or more of the npol, nchan, or nbin arguments is set to zero, the dimension is left unchanged.

References Pulsar::get_Integration(), and Signal::Pulsar.

Referenced by Pulsar::BinaryPhaseOrder::combine(), Pulsar::BinLngAscOrder::combine(), Pulsar::PeriastronOrder::combine(), Pulsar::BinLngPeriOrder::combine(), Pulsar::BinLngAscOrder::organise(), Pulsar::BinLngPeriOrder::organise(), Pulsar::BinaryPhaseOrder::organise(), Pulsar::PeriastronOrder::organise(), and Pulsar::TimeIntegrate::transform().

◆ rms_baseline()

float Pulsar::Archive::rms_baseline ( float  baseline_width = 0.4)

Returns geometric mean of baseline RMS for each Integration.

Returns the geometric mean of the rms of the baseline for the 0,0th profile in each Integration. MB Feb 2004.

References Pulsar::get_Profile(), and Pulsar::Profile::stats().

◆ set_ephemeris()

void Pulsar::Archive::set_ephemeris ( const Parameters new_ephemeris,
bool  update = true 
)

Install the given ephemeris and call update_model.

Parameters
new_ephemeristhe ephemeris to be installed
updatecreate a new polyco for the new ephemeris

References Pulsar::Parameters::clone().

◆ set_filename()

void Pulsar::Archive::set_filename ( const std::string &  filename)
inline

Set the filename of the Archive.

The filename is the name of the file to which the archive will be written on the next call to Archive::unload, if no arguments are given to the Archive::unload method.

References unload_filename.

◆ total()

Pulsar::Archive * Pulsar::Archive::total ( bool  tscrunch = true) const

Return pointer to a new fscrunched, tscrunched and pscrunched clone.

This method is primarily designed for use by the Archive::find_* methods.

References Pulsar::get_Integration(), and Signal::Intensity.

Referenced by baseline(), and Pulsar::DynamicSNSpectrumPlot::get_plot_array().

◆ tscrunch()

void Pulsar::Archive::tscrunch ( unsigned  nscrunch = 0)

Integrate profiles in time.

Parameters
nscrunchnumber of neighbouring Integrations to add. If nscrunch == 0, then add all Integrations together

References Pulsar::Integrate< Container >::set_range_policy(), and Pulsar::TimeIntegrate::transform().

Referenced by Calibration::StandardPrepare::choose(), Pulsar::CommonOptions::process(), Pulsar::SimPolnTiming::set_standard(), and Pulsar::StandardSNRWeight::StandardSNRWeight().

◆ tscrunch_to_nsub()

void Pulsar::Archive::tscrunch_to_nsub ( unsigned  new_nsub)

Call tscrunch with the appropriate value.

Useful wrapper for Archive::tscrunch

◆ unload()

void Pulsar::Archive::unload ( const char *  filename = 0) const

Write the archive to filename.

To protect data, especially when writing the output archive to a file of the same name as the input archive, this method unloads data to a temporary file before renaming the archive to the requested output file name. The temporary file will be written using a unique filename in the same path as the requested output file.

References Pulsar::Integration::get_epoch(), TemporaryFile::get_filename(), Pulsar::get_Integration(), and TemporaryFile::set_removed().

Referenced by Pulsar::UnloadOptions::finish(), and unload().

◆ update_model() [1/2]

void Pulsar::Archive::update_model ( )

Create a new predictor and align the Integrations to the new model.

This method should be called when the ephemeris attribute is modified. It may also be called when the tempo support files (e.g. leap.sec, ut1.dat) change.

◆ update_model() [2/2]

void Pulsar::Archive::update_model ( unsigned  nsubint,
bool  clear = false 
)
protected

Update the predictor model and correct the Integration set.

This method economizes on the number of times that the polyco is re-created and the Integrations are re-aligned to the model.

By setting the Integration::zero_phase_aligned attribute, each sub-integration is flagged as no longer in need of alignment.

If Integration::zero_phase_aligned is false, then the Integration is re-aligned to the new model (see Archive::apply_model).

Parameters
nsubintthe number of Integrations to correct
clearif true, clear the current model

References Pulsar::get_Integration(), and Reference::To< Type, active >::ptr().

◆ weighted_frequency()

double Pulsar::Archive::weighted_frequency ( unsigned  ichan,
unsigned  start,
unsigned  end 
) const

Computes the weighted channel frequency over an Integration interval.

Returns
the new weighted centre frequency (in MHz, rounded to nearest kHz)
Parameters
ichanthe index of the requested frequency channel
startthe index of the first Integration to include in the mean
endone more than the index of the last Integration

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


The documentation for this class was generated from the following files:
  • Archive.h
  • Archive.C
  • Archive_copy.C
  • Archive_correct.C
  • Archive_extract.C
  • Archive_init_Integration.C
  • Archive_load.C
  • Archive_load_Integration.C
  • Archive_match.C
  • Archive_remove_chan.C
  • Archive_resize.C
  • Archive_unload.C
  • Archive_update_centre_frequency.C
  • Archive_verbose.C
  • Archive_verify.C
  • ArchiveExtension.h
  • Agent_static.C
  • Archive_append.C
  • Archive_apply_model.C
  • Archive_baseline.C
  • Archive_bscrunch.C
  • Archive_centre.C
  • Archive_centre_max_bin.C
  • Archive_convert_state.C
  • Archive_dedisperse.C
  • Archive_defaraday.C
  • Archive_find.C
  • Archive_fold.C
  • Archive_fscrunch.C
  • Archive_good_model.C
  • Archive_invint.C
  • Archive_pscrunch.C
  • Archive_remove_baseline.C
  • Archive_rms_baseline.C
  • Archive_rotate.C
  • Archive_set_ephemeris.C
  • Archive_set_model.C
  • Archive_total.C
  • Archive_transform.C
  • Archive_tscrunch.C
  • Archive_update_model.C
  • Archive_weighted_frequency.C

Generated using doxygen 1.8.14