PhaseSeries.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2002 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // dspsr/Signal/Pulsar/dsp/PhaseSeries.h
10 
11 #ifndef __PhaseSeries_h
12 #define __PhaseSeries_h
13 
14 #include "dsp/TimeSeries.h"
15 
16 namespace Pulsar {
17  class Predictor;
18  class Parameters;
19 }
20 
21 namespace dsp {
22 
23  class Memory;
24 
25  class Extensions;
26 
28  class PhaseSeries : public TimeSeries {
29 
30  friend class Fold;
31  friend class CyclicFold;
32  friend class PhaseLockedFilterbank;
33 
34  public:
35 
37  PhaseSeries ();
38 
40  PhaseSeries (const PhaseSeries&);
41 
44 
46  ~PhaseSeries ();
47 
49  PhaseSeries* clone() const;
50 
52  virtual void resize (int64_t nsamples);
53 
55  void resize_hits (int64_t nbin);
56 
58  void combine (const PhaseSeries*);
59 
61  void set_reference_phase (double phase) { reference_phase = phase; }
63  double get_reference_phase () const { return reference_phase; }
64 
66 
68  void set_folding_period (double _folding_period);
70  double get_folding_period () const;
71 
77  bool has_folding_predictor () const;
78 
84  bool has_pulsar_ephemeris () const;
85 
87  double get_integration_length () const { return integration_length; }
88 
90  void increment_integration_length (double seconds)
91  { integration_length += seconds; }
92 
94  MJD get_end_time () const { return end_time; }
96  void set_end_time (const MJD& mjd) { end_time = mjd; }
97 
99  unsigned get_nbin () const { return unsigned(get_ndat()); }
100 
102  unsigned get_hit (unsigned ibin, unsigned ichan=0) const;
103 
105  unsigned* get_hits (unsigned ichan=0);
106 
107  const unsigned* get_hits (unsigned ichan=0) const;
108 
109  uint64_t get_hits_size() const { return hits_size; }
110 
112  void set_hits (unsigned value);
113 
115  unsigned get_hits_nchan () { return hits_nchan; }
116 
118  void set_hits_nchan (unsigned _hits_nchan) { hits_nchan = _hits_nchan; }
119 
121 
122  MJD get_mid_time (bool phased = true) const;
123 
125  void zero ();
126 
128  bool combinable_rate (double) const { return true; }
129 
131  void set_ndat_expected (uint64_t);
132 
134  uint64_t get_ndat_expected () const;
135 
137  uint64_t get_ndat_total () const;
138 
140  uint64_t get_ndat_folded () const;
141 
143  uint64_t get_ndat_folded (unsigned ichan) const;
144 
146  void set_extensions (Extensions*);
148  const Extensions* get_extensions () const;
149  Extensions* get_extensions ();
150 
152  bool has_extensions () const;
153 
155  virtual void copy_configuration (const Observation* copy);
156 
158  void set_hits_memory (Memory*);
159 
161  const Memory* get_hits_memory () const;
162 
163  protected:
164 
167 
170 
173 
176 
179 
181  unsigned * hits;
182 
184  unsigned hits_nchan;
185 
187  uint64_t hits_size;
188 
190  uint64_t ndat_total;
191 
193  uint64_t ndat_expected;
194 
197 
200 
202  bool mixable (const Observation& obs, unsigned nbin,
203  int64_t istart=0, int64_t fold_ndat=0);
204 
207 
208  private:
209 
211  void operator += (const PhaseSeries&);
212 
213  void init ();
214  void copy_attributes (const PhaseSeries*);
215 
216  };
217 
218 }
219 
220 #endif
Performs FFT at specific pulse phase windows.
Definition: PhaseLockedFilterbank.h:28
uint64_t get_ndat_expected() const
Return the expected number of time samples.
Definition: PhaseSeries.C:554
uint64_t get_ndat_total() const
Return the total number of time samples.
Definition: PhaseSeries.C:516
const Observation & operator=(const Observation &)
Assignment operator.
Definition: Observation.C:404
virtual MJD get_end_time() const
Return the end time of the trailing edge of the last time sample.
Definition: Observation.C:521
uint64_t get_ndat_folded() const
Return the number of time samples folded into the profiles for all channels.
Definition: PhaseSeries.C:521
void set_hits(unsigned value)
Set the hits in all bins and channels.
Definition: PhaseSeries.C:349
const Memory * get_hits_memory() const
Get the hits memory manager.
Definition: PhaseSeries.C:82
Contains all Baseband Data Reduction Library classes.
Definition: ASCIIObservation.h:17
static bool verbose
Verbosity flag.
Definition: Observation.h:39
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)
Definition: PhaseSeries.C:365
double reference_phase
Reference phase (phase of bin zero)
Definition: PhaseSeries.h:178
void set_end_time(const MJD &mjd)
Set the end time.
Definition: PhaseSeries.h:96
Data as a function of pulse phase.
Definition: PhaseSeries.h:28
void set_hits_memory(Memory *)
Set the hits memory manager.
Definition: PhaseSeries.C:73
uint64_t hits_size
Total size of the hits array (nchan * nbin)
Definition: PhaseSeries.h:187
const Extensions * get_extensions() const
Get the Extensions to be communicated to the Archiver class.
Definition: PhaseSeries.C:564
unsigned * get_hits(unsigned ichan=0)
Get the hits array for the specified ichan.
Definition: PhaseSeries.C:219
virtual void copy_configuration(const Observation *copy)
Copy the configuration of another PhaseSeries instance (hits array)
Definition: PhaseSeries.C:287
double get_integration_length() const
Get the number of seconds integrated.
Definition: PhaseSeries.h:87
uint64_t ndat_total
Total number of time samples passed to folding routine.
Definition: PhaseSeries.h:190
void set_pulsar_ephemeris(const Pulsar::Parameters *)
Set the pulsar ephemeris used to fold.
Definition: PhaseSeries.C:168
double get_rate() const
Return the sampling rate (time samples per second in Hz)
Definition: Observation.h:157
Reference::To< const Pulsar::Predictor > folding_predictor
Phase polynomial(s) with which PSR is folded.
Definition: PhaseSeries.h:169
uint64_t get_ndat() const
Return the number of time samples in container.
Definition: Observation.h:107
Fold TimeSeries data into phase-averaged profile(s)
Definition: Fold.h:34
void increment_integration_length(double seconds)
Increment the integration length.
Definition: PhaseSeries.h:90
Fold TimeSeries data into cyclic spectra.
Definition: CyclicFold.h:43
virtual TimeSeries & operator+=(const TimeSeries &data)
Add each value in data to this.
Definition: TimeSeries.C:410
bool zeroed_data
Flag for whether the data contains zero values. See ZapWeight.
Definition: TimeSeries.h:195
Stores information about digital, band-limited, time-varying signals.
Definition: Observation.h:33
virtual void zero()
Set all values to zero.
Definition: DataSeries.C:251
virtual TimeSeries & operator=(const TimeSeries &copy)
Set this equal to copy.
Definition: TimeSeries.C:225
void copy(const Observation *)
Call TimeSeries::copy if Observation is a TimeSeries.
Definition: TimeSeries.C:207
void combine(const PhaseSeries *)
Add the given PhaseSeries to this.
Definition: PhaseSeries.C:471
void resize_hits(int64_t nbin)
Allocate the space required for the hits array.
Definition: PhaseSeries.C:106
unsigned * hits
Number of time samples integrated into each phase bin for each channel.
Definition: PhaseSeries.h:181
Arrays of consecutive samples for each polarization and frequency channel.
Definition: TimeSeries.h:29
void zero()
Reset all phase bin totals to zero.
Definition: PhaseSeries.C:268
void set_hits_nchan(unsigned _hits_nchan)
Set the number of channels in the hits array.
Definition: PhaseSeries.h:118
virtual void copy_configuration(const Observation *copy)
Copy the configuration of another TimeSeries instance (not the data) This doesn't copy nchan,...
Definition: TimeSeries.C:396
void set_ndat_expected(uint64_t)
Set the expected number of time samples.
Definition: PhaseSeries.C:548
bool combinable_rate(double) const
Over-ride Observation::combinable_rate.
Definition: PhaseSeries.h:128
const Pulsar::Parameters * get_pulsar_ephemeris() const
Returns the pulsar ephemeris stored.
Definition: PhaseSeries.C:197
virtual void resize(int64_t nsamples)
Allocate the space required to store nsamples time samples.
Definition: PhaseSeries.C:97
uint64_t ndat_expected
Total number of time samples expected to be passed to folding routine.
Definition: PhaseSeries.h:193
PhaseSeries()
Default constructor.
Definition: PhaseSeries.C:40
bool has_folding_predictor() const
Return true if the folding predictor attribute is set.
Definition: PhaseSeries.C:191
MJD get_end_time() const
Get the end time.
Definition: PhaseSeries.h:94
void set_extensions(Extensions *)
Set the Extensions to be communicated to the Archiver class.
Definition: PhaseSeries.C:559
virtual void resize(uint64_t nsamples)
Allocate the space required to store nsamples time samples.
Definition: TimeSeries.C:146
void set_folding_period(double _folding_period)
Set the period at which to fold data (in seconds)
Definition: PhaseSeries.C:138
Reference::To< const Pulsar::Parameters > pulsar_ephemeris
The ephemeris (if any) that was used to generate the Pulsar::Predictor.
Definition: PhaseSeries.h:172
MJD get_mid_time(bool phased=true) const
Get the mid-time of the integration.
Definition: PhaseSeries.C:237
void set_reference_phase(double phase)
Set the reference phase (phase of bin zero)
Definition: PhaseSeries.h:61
void set_folding_predictor(const Pulsar::Predictor *)
Set the phase predictor with which the data were folded.
Definition: PhaseSeries.C:173
bool has_extensions() const
Return true if Extensions have been set.
Definition: PhaseSeries.C:574
unsigned get_hits_nchan()
Get the number of channels in the hits array.
Definition: PhaseSeries.h:115
PhaseSeries * clone() const
Clone operator.
Definition: PhaseSeries.C:88
MJD end_time
The MJD of the last-integrated time sample's tail edge.
Definition: PhaseSeries.h:199
double integration_length
The number of seconds integrated into the profile(s)
Definition: PhaseSeries.h:196
unsigned get_hit(unsigned ibin, unsigned ichan=0) const
Get the hit for the given bin and channel.
Definition: PhaseSeries.C:211
double get_reference_phase() const
Get the reference phase (phase of bin zero)
Definition: PhaseSeries.h:63
double folding_period
Period at which CAL data is folded.
Definition: PhaseSeries.h:166
MJD get_start_time() const
Return the start time of the leading edge of the first time sample.
Definition: Observation.h:152
unsigned hits_nchan
Number of channels in the hits array.
Definition: PhaseSeries.h:184
Pure virtual base class of objects that manage memory allocation and destruction.
Definition: Memory.h:23
bool get_zeroed_data() const
Get the zeroed data flag.
Definition: TimeSeries.h:162
~PhaseSeries()
Destructor.
Definition: PhaseSeries.C:61
const Pulsar::Predictor * get_folding_predictor() const
Get the phase predictor with which the data were folded.
Definition: PhaseSeries.C:182
PhaseSeries & operator=(const PhaseSeries &)
Assigment operator.
Definition: PhaseSeries.C:450
double get_folding_period() const
Get the period at which to fold data (in seconds)
Definition: PhaseSeries.C:146
Reference::To< Extensions > extensions
The Extensions to be communicated to the Archiver class.
Definition: PhaseSeries.h:175
Reference::To< Memory > hits_memory
The hits memory manager.
Definition: PhaseSeries.h:206
Order get_order() const
Get the order.
Definition: TimeSeries.C:92
unsigned get_nbin() const
Get the number of phase bins.
Definition: PhaseSeries.h:99
bool has_pulsar_ephemeris() const
Return true if the pulsar ephemeris attribute is set.
Definition: PhaseSeries.C:206
unsigned get_nchan() const
Return the number of channels into which the band is divided.
Definition: Observation.h:85

Generated using doxygen 1.8.17