Data as a function of pulse phase. More...

#include <PhaseSeries.h>

Inheritance diagram for dsp::PhaseSeries:
dsp::TimeSeries dsp::DataSeries dsp::Observation OwnStream Reference::Able Reference::HeapTracked

Public Member Functions

 PhaseSeries ()
 Default constructor.
 
 PhaseSeries (const PhaseSeries &)
 Copy constructor.
 
PhaseSeriesoperator= (const PhaseSeries &)
 Assigment operator.
 
 ~PhaseSeries ()
 Destructor.
 
PhaseSeriesclone () const
 Clone operator.
 
virtual void resize (int64_t nsamples)
 Allocate the space required to store nsamples time samples. More...
 
void resize_hits (int64_t nbin)
 Allocate the space required for the hits array. More...
 
void combine (const PhaseSeries *)
 Add the given PhaseSeries to this.
 
void set_reference_phase (double phase)
 Set the reference phase (phase of bin zero)
 
double get_reference_phase () const
 Get the reference phase (phase of bin zero)
 
void set_folding_period (double _folding_period)
 Set the period at which to fold data (in seconds) More...
 
double get_folding_period () const
 Get the period at which to fold data (in seconds) More...
 
void set_folding_predictor (const Pulsar::Predictor *)
 Set the phase predictor with which the data were folded.
 
const Pulsar::Predictorget_folding_predictor () const
 Get the phase predictor with which the data were folded. More...
 
bool has_folding_predictor () const
 Return true if the folding predictor attribute is set.
 
void set_pulsar_ephemeris (const Pulsar::Parameters *)
 Set the pulsar ephemeris used to fold.
 
const Pulsar::Parametersget_pulsar_ephemeris () const
 Returns the pulsar ephemeris stored. More...
 
bool has_pulsar_ephemeris () const
 Return true if the pulsar ephemeris attribute is set.
 
double get_integration_length () const
 Get the number of seconds integrated.
 
void increment_integration_length (double seconds)
 Increment the integration length.
 
MJD get_end_time () const
 Get the end time.
 
void set_end_time (const MJD &mjd)
 Set the end time.
 
unsigned get_nbin () const
 Get the number of phase bins.
 
unsigned get_hit (unsigned ibin, unsigned ichan=0) const
 Get the hit for the given bin and channel.
 
unsigned * get_hits (unsigned ichan=0)
 Get the hits array for the specified ichan.
 
const unsigned * get_hits (unsigned ichan=0) const
 
uint64_t get_hits_size () const
 
void set_hits (unsigned value)
 Set the hits in all bins and channels. More...
 
unsigned get_hits_nchan ()
 Get the number of channels in the hits array.
 
void set_hits_nchan (unsigned _hits_nchan)
 Set the number of channels in the hits array.
 
MJD get_mid_time (bool phased=true) const
 Get the mid-time of the integration. More...
 
void zero ()
 Reset all phase bin totals to zero.
 
bool combinable_rate (double) const
 Over-ride Observation::combinable_rate.
 
void set_ndat_expected (uint64_t)
 Set the expected number of time samples.
 
uint64_t get_ndat_expected () const
 Return the expected number of time samples.
 
uint64_t get_ndat_total () const
 Return the total number of time samples.
 
uint64_t get_ndat_folded () const
 Return the number of time samples folded into the profiles for all channels.
 
uint64_t get_ndat_folded (unsigned ichan) const
 Return the number of time samples folded into the profiles.
 
void set_extensions (Extensions *)
 Set the Extensions to be communicated to the Archiver class.
 
const Extensions * get_extensions () const
 Get the Extensions to be communicated to the Archiver class.
 
Extensions * get_extensions ()
 
bool has_extensions () const
 Return true if Extensions have been set.
 
virtual void copy_configuration (const Observation *copy)
 Copy the configuration of another PhaseSeries instance (hits array)
 
void set_hits_memory (Memory *)
 Set the hits memory manager.
 
const Memoryget_hits_memory () const
 Get the hits memory manager.
 
- Public Member Functions inherited from dsp::TimeSeries
 TimeSeries ()
 Null constructor.
 
 TimeSeries (const TimeSeries &ts)
 Copy constructor.
 
virtual TimeSeriesnull_clone () const
 Returns a null-instantiation (calls new)
 
virtual TimeSeriesswap_data (DataSeries &ts)
 Swaps the two TimeSeries if DataSeries is a TimeSeries. Returns '*this'.
 
virtual TimeSeriesswap_data (TimeSeries &ts)
 Swaps the two TimeSeries's. Returns '*this'.
 
virtual ~TimeSeries ()
 Destructor.
 
virtual TimeSeriesoperator= (const TimeSeries &copy)
 Set this equal to copy.
 
void copy (const Observation *)
 Call TimeSeries::copy if Observation is a TimeSeries.
 
void copy (const DataSeries *)
 Call TimeSeries::copy if DataSeries is a TimeSeries.
 
virtual void copy (const TimeSeries *ts)
 Same as operator= but takes a pointer.
 
virtual TimeSeriesoperator+= (const TimeSeries &data)
 Add each value in data to this.
 
virtual TimeSeriesoperator*= (float mult)
 Multiple each value by this scalar.
 
Order get_order () const
 Get the order.
 
void set_order (Order order)
 Set the order.
 
virtual void copy_data (const TimeSeries *data, uint64_t idat_start=0, uint64_t ndat=0)
 Copy the data of another TimeSeries instance.
 
virtual void internal_match (const TimeSeries *)
 Match the internal memory layout of another TimeSeries. More...
 
virtual void internal_match (const DataSeries *)
 Match the internal memory layout of another TimeSeries.
 
virtual void set_nbit (unsigned)
 Disable the set_nbit method of the Observation base class.
 
virtual void resize (uint64_t nsamples)
 Allocate the space required to store nsamples time samples. More...
 
virtual void decrease_ndat (uint64_t new_ndat)
 Decrease the array lengths without changing the base pointers.
 
TimeSeriesuse_data (float *_buffer, uint64_t _ndat)
 For nchan=1, npol=1 data this uses the data in 'buffer'.
 
float * get_datptr (unsigned ichan=0, unsigned ipol=0)
 Return pointer to the specified data block.
 
const float * get_datptr (unsigned ichan=0, unsigned ipol=0) const
 Return pointer to the specified data block.
 
float * get_dattfp ()
 Return pointer to the specified data block.
 
const float * get_dattfp () const
 Return pointer to the specified data block.
 
virtual void seek (int64_t offset)
 Offset the base pointer by offset time samples.
 
void prepend (const dsp::TimeSeries *, uint64_t pre_ndat=0)
 Append the given TimeSeries to the end of 'this' Copy data from given TimeSeries in front of the current position.
 
int64_t get_input_sample () const
 Return the sample offset from the start of the data source.
 
void set_input_sample (uint64_t sample)
 Used to arrange pieces in order during input buffering.
 
uint64_t get_nfloat_span () const
 Get the span (number of floats)
 
double mean (unsigned ichan, unsigned ipol)
 Return the mean of the data for the specified channel and poln.
 
virtual void check (float min=-10.0, float max=10.0)
 Check that each floating point value is roughly as expected.
 
void set_zeroed_data (bool _zeroed_data)
 Set the zeroed data flag.
 
bool get_zeroed_data () const
 Get the zeroed data flag.
 
void finite_check () const
 
void set_match (TimeSeries *)
 
void set_engine (Engine *)
 
Engine * get_engine () const
 
unsigned get_stride () const
 
- Public Member Functions inherited from dsp::DataSeries
 DataSeries ()
 Null constructor.
 
 DataSeries (const DataSeries &ds)
 Copy constructor.
 
void initi ()
 Called by constructor to initialise variables.
 
virtual ~DataSeries ()
 Destructor.
 
virtual DataSeriesoperator= (const DataSeries &copy)
 Set this equal to copy.
 
void set_ndat (uint64_t)
 Enforces that ndat*ndim must be an integer number of bytes.
 
void set_ndim (unsigned)
 Enforces that ndat*ndim must be an integer number of bytes.
 
void set_npol (unsigned)
 Set the number of polarizations. More...
 
void set_nchan (unsigned)
 Set the number of channels. More...
 
uint64_t get_ndat_allocated ()
 return the number of samples the current buffer can hold
 
bool reshape_required ()
 Return true if reshape of data series required.
 
virtual void resize (uint64_t nsamples, unsigned char *&old_buffer)
 
void reshape ()
 Reshape the buffer to match the current attributes.
 
void reshape (unsigned npol, unsigned ndim)
 Reshape the buffer to match the specified attributes.
 
virtual unsigned char * get_udatptr (unsigned ichan=0, unsigned ipol=0)
 Return pointer to the specified block of time samples. More...
 
virtual const unsigned char * get_udatptr (unsigned ichan=0, unsigned ipol=0) const
 Return pointer to the specified block of time samples. More...
 
virtual uint64_t get_subsize ()
 Stride (in bytes) between the same time sample in different chan/pol.
 
unsigned char * internal_get_buffer ()
 Return the internal memory base address.
 
const unsigned char * internal_get_buffer () const
 
uint64_t internal_get_size () const
 Return the internal memory size.
 
uint64_t internal_get_subsize () const
 Return the internal memory sub-division size.
 
virtual void set_memory (Memory *)
 Set the memory manager.
 
const Memoryget_memory () const
 
- Public Member Functions inherited from dsp::Observation
 Observation ()
 Null constructor.
 
 Observation (const Observation &)
 Copy constructor.
 
 Observation (const Observation *)
 Copy from pointer constructor.
 
const Observationoperator= (const Observation &)
 Assignment operator.
 
virtual ~Observation ()
 Virtual destructor (see Effective C++ Item 14)
 
virtual void set_basis (Signal::Basis _basis)
 Set the type of receiver feeds.
 
Signal::Basis get_basis () const
 Return the type of receiver feeds.
 
virtual void set_state (Signal::State _state)
 Set the state of the signal.
 
Signal::State get_state () const
 Return the state of the signal.
 
virtual void set_type (Signal::Source _type)
 Set the source type.
 
Signal::Source get_type () const
 Return the source type.
 
unsigned get_ndim () const
 Return the dimension of each datum.
 
unsigned get_nchan () const
 Return the number of channels into which the band is divided.
 
unsigned get_npol () const
 Return the number of polarizations.
 
unsigned get_nbit () const
 Return the number of bits per value.
 
uint64_t bits_per_sample () const
 Return the number of bits in a single time sample (over all channels, pols, and dimensions)
 
uint64_t get_ndat () const
 Return the number of time samples in container.
 
virtual void set_telescope (const std::string &name)
 Set the telescope name.
 
std::string get_telescope () const
 Return the telescope name.
 
virtual void set_receiver (const std::string &name)
 Set the receiver name.
 
std::string get_receiver () const
 Return the receiver name.
 
virtual void set_source (const std::string &name)
 Set the source name.
 
std::string get_source () const
 Return the source name.
 
virtual void set_coordinates (sky_coord _coordinates)
 Set the coordinates of the source.
 
sky_coord get_coordinates () const
 Return the coordinates of the source.
 
virtual void set_centre_frequency (double cf)
 Set the centre frequency of the band-limited signal in MHz.
 
double get_centre_frequency () const
 Return the centre frequency of the band-limited signal in MHz.
 
double get_centre_frequency (unsigned ichan) const
 Returns the centre frequency of the specified channel in MHz.
 
double get_base_frequency () const
 Returns the centre frequency of the reference channel in MHz.
 
unsigned get_unswapped_ichan (unsigned ichan) const
 Returns the unswapped channel index of the specified channel.
 
virtual void set_bandwidth (double _bandwidth)
 Set the bandwidth of signal in MHz (-ve = lsb; +ve = usb)
 
double get_bandwidth () const
 Return the bandwidth of signal in MHz (-ve = lsb; +ve = usb)
 
virtual void set_start_time (MJD _start_time)
 Set the start time of the leading edge of the first time sample.
 
MJD get_start_time () const
 Return the start time of the leading edge of the first time sample.
 
virtual void set_rate (double _rate)
 Set the sampling rate (time samples per second in Hz)
 
double get_rate () const
 Return the sampling rate (time samples per second in Hz)
 
virtual void set_scale (double _scale)
 Set the amount by which data has been scaled.
 
double get_scale () const
 Return the amount by which data has been scaled.
 
virtual void set_swap (bool _swap)
 Set true if frequency channels are out of order (band swappped)
 
bool get_swap () const
 Return true if frequency channels are out of order (band swappped)
 
virtual void set_nsub_swap (unsigned _nsub)
 Set the number of sub-bands that must be band swapped.
 
unsigned get_nsub_swap () const
 Return the number of sub-bands that must be band swapped.
 
virtual void set_dual_sideband (int _dual)
 Set to 1 if the spectrum in each channel has dual-sideband frequency order. More...
 
int get_dual_sideband () const
 Return the dual-sideband. More...
 
virtual void set_dc_centred (bool _centred)
 Set true if centre channel is centred on centre frequency. More...
 
bool get_dc_centred () const
 
virtual void set_identifier (const std::string &_id)
 Set the observation identifier.
 
std::string get_identifier () const
 Return the observation identifier.
 
virtual void set_machine (const std::string &_m)
 Set the instrument used to record signal.
 
std::string get_machine () const
 Return the instrument used to record signal.
 
virtual void set_format (const std::string &_f)
 Set the format used to record signal.
 
std::string get_format () const
 Return the format used to record signal.
 
virtual void set_dispersion_measure (double dm)
 Set the pulsar dispersion mesure.
 
double get_dispersion_measure () const
 Returns the pulsar dispersion measure.
 
virtual void set_rotation_measure (double rm)
 Set the pulsar rotation mesure.
 
double get_rotation_measure () const
 Returns the pulsar rotation measure.
 
virtual void set_mode (const std::string &_mode)
 Set the observation mode.
 
std::string get_mode () const
 Return the observation mode.
 
virtual void set_calfreq (double _calfreq)
 Set the calibrator frequency.
 
double get_calfreq () const
 get the calibrator frequency
 
virtual void set_oversampling_factor (const Rational &_osf)
 Set the oversampling factor.
 
const Rationalget_oversampling_factor () const
 Get the oversampling factor.
 
virtual void set_deripple (const std::vector< dsp::FIRFilter > &_deripple)
 
const std::vector< dsp::FIRFilter > & get_deripple () const
 
unsigned get_deripple_stages () const
 
virtual void set_pfb_dc_chan (const bool _pfb_dc_chan)
 set/get the DC PFB channel flag (for inverse filterbank)
 
bool get_pfb_dc_chan () const
 
virtual void set_pfb_nchan (unsigned nchan)
 set/get the number of channels output by the PFB per input channel
 
unsigned get_pfb_nchan () const
 
virtual void change_state (Signal::State new_state)
 Change the state and correct other attributes accordingly.
 
bool state_is_valid (std::string &reason) const
 Return true if the state of the Observation is valid. More...
 
bool get_detected () const
 Returns true if state is Detected, Coherence, or Stokes.
 
void change_start_time (int64_t _ndat)
 Change the start time by the number of time samples specified.
 
uint64_t get_idat (const MJD &mjd)
 Return the nearest time sample corresponding to the specified MJD.
 
void rescale (double factor)
 Multiply scale by factor.
 
virtual uint64_t get_nbytes (uint64_t nsamples) const
 Return the size in bytes of nsamples time samples.
 
uint64_t get_nbytes () const
 Return the size in bytes of ndat time samples.
 
uint64_t verbose_nbytes (uint64_t nsamples) const
 
float get_nbyte () const
 Return the size in bytes of one time sample.
 
virtual uint64_t get_nsamples (uint64_t nbytes) const
 Return the number of samples in nbytes bytes.
 
void copy_dimensions (const Observation *)
 Copy the dimensions of another observation.
 
bool combinable (const Observation &obs) const
 Returns true if the signal may be integrated.
 
std::string get_reason ()
 Returns the reason if combinable returns false.
 
bool contiguous (const Observation &next) const
 Return true if the first sample of next follows the last sample of this.
 
void init ()
 Set all attributes to null default.
 
void set_nbyte_nsample_policy (NbyteNsamplePolicy *)
 Set the policy that defines the bijection between number of bytes and number of samples.
 
const NbyteNsamplePolicy * get_nbyte_nsample_policy () const
 Get the policy that defines the bijection between number of bytes and number of samples.
 
virtual TextInterface::Parserget_interface ()
 Return a text interface that can be used to access this instance.
 
- Public Member Functions inherited from OwnStream
 OwnStream (const OwnStream &)
 
const OwnStreamoperator= (const OwnStream &)
 
virtual void set_cout (std::ostream &) const
 
virtual void set_cerr (std::ostream &) 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
 

Protected Member Functions

bool mixable (const Observation &obs, unsigned nbin, int64_t istart=0, int64_t fold_ndat=0)
 Return true when Observation can be integrated (and prepare for it)
 
- Protected Member Functions inherited from dsp::TimeSeries
virtual unsigned char * get_data ()
 Returns a uchar pointer to the first piece of data.
 
virtual const unsigned char * get_data () const
 Returns a uchar pointer to the first piece of data.
 
virtual void prepend_checks (const TimeSeries *, uint64_t pre_ndat)
 
void change_reserve (int64_t change) const
 Change the amount of memory reserved at the start of the buffer. More...
 
uint64_t get_reserve () const
 Get the amount of memory reserved at the start of the buffer.
 
void null_work (const TimeSeries *from)
 
- Protected Member Functions inherited from Reference::Able
Handle__reference (bool active) const
 
void __dereference (bool auto_delete=true) const
 

Protected Attributes

double folding_period
 Period at which CAL data is folded.
 
Reference::To< const Pulsar::Predictorfolding_predictor
 Phase polynomial(s) with which PSR is folded.
 
Reference::To< const Pulsar::Parameterspulsar_ephemeris
 The ephemeris (if any) that was used to generate the Pulsar::Predictor.
 
Reference::To< Extensions > extensions
 The Extensions to be communicated to the Archiver class.
 
double reference_phase
 Reference phase (phase of bin zero)
 
unsigned * hits
 Number of time samples integrated into each phase bin for each channel.
 
unsigned hits_nchan
 Number of channels in the hits array.
 
uint64_t hits_size
 Total size of the hits array (nchan * nbin)
 
uint64_t ndat_total
 Total number of time samples passed to folding routine.
 
uint64_t ndat_expected
 Total number of time samples expected to be passed to folding routine.
 
double integration_length
 The number of seconds integrated into the profile(s)
 
MJD end_time
 The MJD of the last-integrated time sample's tail edge.
 
Reference::To< Memoryhits_memory
 The hits memory manager.
 
- Protected Attributes inherited from dsp::TimeSeries
float * data
 Pointer into buffer, offset to the first time sample requested by user.
 
bool zeroed_data
 Flag for whether the data contains zero values. See ZapWeight.
 
Reference::To< Engine > engine
 
- Protected Attributes inherited from dsp::DataSeries
unsigned char * buffer = nullptr
 The data buffer.
 
uint64_t size = 0
 The size of the data buffer (in bytes)
 
uint64_t subsize = 0
 The number of BYTES in a data sub-division.
 
bool shape_changed = false
 Flag for whether the shape of the data series has changed.
 
Reference::To< Memorymemory
 The memory manager.
 
- Protected Attributes inherited from dsp::Observation
std::string telescope
 Telescope name.
 
std::string receiver
 Receiver name.
 
std::string source
 Source name. If a pulsar, should be J2000.
 
double centre_frequency = 0.0
 Centre frequency of band-limited signal in MHz.
 
double bandwidth = 0.0
 Bandwidth of signal in MHz (-ve = lsb; +ve = usb)
 
Signal::Source type
 Type of signal source (Pulsar, CAL, etc.)
 
Signal::State state
 State of the signal (Full Stokes, Total Intensity, etc.)
 
Signal::Basis basis
 Type of receiver feeds (Linear or Circular)
 
double rate = 0.0
 Time samples per second in Hz.
 
MJD start_time
 Start time of the leading edge of the first time sample.
 
std::string identifier
 Observation identifier.
 
std::string mode
 Observation mode.
 
std::string machine
 Instrument used to record signal.
 
std::string format
 Data format used to record signal.
 
sky_coord coordinates
 Coordinates of the source.
 
double dispersion_measure = 0.0
 The dispersion measure to be archived.
 
double rotation_measure = 0.0
 The rotation measure to be archived.
 
bool require_equal_sources = true
 Require equal sources in combinable.
 
bool require_equal_rates = true
 Require equal rates in combinable.
 
double scale = 1.0
 Amount by which data has been scaled.
 
bool swap = false
 Flag set when frequency channels are out of order (band swappped)
 
unsigned nsub_swap = 0
 The number of sub-bands that must be band swapped.
 
bool dc_centred = false
 Flag set when centre channel is centred on centre frequency.
 
Rational oversampling_factor
 oversampling factor
 
std::vector< FIRFilter > deripple
 information about deripple correction
 
bool pfb_dc_chan = true
 Do we have the DC, or zeroth PFB channel?
 
unsigned pfb_nchan = 0
 Number of channels output by PFB for a single input time series. More...
 

Friends

class Fold
 
class CyclicFold
 
class PhaseLockedFilterbank
 

Additional Inherited Members

- Public Types inherited from dsp::TimeSeries
enum  Order { OrderFPT, OrderTFP }
 Order of the dimensions. More...
 
- 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 inherited from dsp::TimeSeries
static bool auto_delete = true
 Automatically delete arrays on resize(0)
 
- Static Public Attributes inherited from dsp::DataSeries
static int instantiation_count = 0
 Counts number of DataSeries's in existence.
 
static int64_t memory_used = 0
 Stores the cumulative amount of memory used.
 
- Static Public Attributes inherited from dsp::Observation
static bool verbose = false
 Verbosity flag.
 

Detailed Description

Data as a function of pulse phase.

Member Function Documentation

◆ get_folding_period()

double dsp::PhaseSeries::get_folding_period ( ) const

Get the period at which to fold data (in seconds)

Get the average folding period.

◆ get_folding_predictor()

const Pulsar::Predictor * dsp::PhaseSeries::get_folding_predictor ( ) const

Get the phase predictor with which the data were folded.

Inquire the phase polynomial(s) with which to fold data.

◆ get_mid_time()

MJD dsp::PhaseSeries::get_mid_time ( bool  phased = true) const

Get the mid-time of the integration.

Parameters
phasedif true, round to the nearest reference phase

◆ get_pulsar_ephemeris()

const Pulsar::Parameters * dsp::PhaseSeries::get_pulsar_ephemeris ( ) const

Returns the pulsar ephemeris stored.

Inquire the ephemeris used to fold the data.

◆ resize()

void dsp::PhaseSeries::resize ( int64_t  nsamples)
virtual

Allocate the space required to store nsamples time samples.

Set the number of phase bins into which data will be PhaseSeriesed.

References dsp::TimeSeries::resize().

Referenced by dsp::CyclicFold::prepare_output().

◆ resize_hits()

void dsp::PhaseSeries::resize_hits ( int64_t  nbin)

Allocate the space required for the hits array.

Resize the hits arary.

◆ set_folding_period()

void dsp::PhaseSeries::set_folding_period ( double  _folding_period)

Set the period at which to fold data (in seconds)

The Pulsar::Predictor and ephemeris are set to null values upon setting the folding period

Referenced by dsp::Fold::transformation().

◆ set_hits()

void dsp::PhaseSeries::set_hits ( unsigned  value)

Set the hits in all bins and channels.

Set the hits in all bins.


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

Generated using doxygen 1.8.17