DynamicSpectrum.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2010 by Paul Demorest
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 #ifndef __Pulsar_DynamicSpectrum_h
10 #define __Pulsar_DynamicSpectrum_h
11 
12 #include "Pulsar/Algorithm.h"
13 #include "Estimate.h"
14 #include "MJD.h"
15 
16 namespace Pulsar
17 {
18  class Archive;
19  class Flux;
20 
22  class DynamicSpectrum : public Algorithm
23  {
24  public:
25 
28 
31 
33  void set_Archive(const Archive* _arch);
34 
36  void set_flux_method(Flux *flux);
37 
40 
42  void compute();
43 
45  void reset();
46 
48  Estimate<double> get_ds(unsigned ichan, unsigned isub);
49 
51  const double *get_ds();
52 
54  const double *get_ds_err();
55 
57  const unsigned get_nchan() const { return nchan; }
58 
60  const unsigned get_nsub() const { return nsub; }
61 
63  const MJD get_rel_epoch(unsigned isub);
64 
66  const double get_freq(unsigned ichan, unsigned isub=0);
67 
69  void unload(const std::string& filename, const std::string& command="");
70 
72  static DynamicSpectrum *load(const std::string& filename);
73 
74  protected:
75 
78 
81 
83  bool computed;
84 
86  unsigned nchan;
87 
89  unsigned nsub;
90 
92  double *ds_data;
93 
95  double *ds_data_err;
96 
98  double ds_max;
99 
101  double ds_min;
102 
103  };
104 
105 }
106 
107 
108 #endif
109 
110 
111 
void set_flux_method(Flux *flux)
Set the flux computation method.
Definition: DynamicSpectrum.C:62
const double get_freq(unsigned ichan, unsigned isub=0)
Get freq of a given channel.
Definition: DynamicSpectrum.C:95
DynamicSpectrum()
Default constructor.
Definition: DynamicSpectrum.C:17
Computes average flux of a Profile.
Definition: Flux.h:30
const double * get_ds()
Get pointer to values.
Definition: DynamicSpectrum.C:78
static DynamicSpectrum * load(const std::string &filename)
Load results from a file.
Definition: DynamicSpectrum.C:173
double * ds_data_err
Dynamic spectrum uncertainty array.
Definition: DynamicSpectrum.h:100
void set_Archive(const Archive *_arch)
Set the Archive to use.
Definition: DynamicSpectrum.C:43
The primary interface to pulsar observational data.
Definition: Archive.h:45
const unsigned get_nchan() const
Get number of channels in ds.
Definition: DynamicSpectrum.h:62
U get_error() const
bool computed
Has DS been computed.
Definition: DynamicSpectrum.h:88
double ds_max
The max DS value.
Definition: DynamicSpectrum.h:103
const double * get_ds_err()
Get pointer to uncertainties.
Definition: DynamicSpectrum.C:84
unsigned nchan
Num chans in use.
Definition: DynamicSpectrum.h:91
~DynamicSpectrum()
Destructor.
Definition: DynamicSpectrum.C:28
Computes dynamic spectrum (flux vs time/freq) of an Archive.
Definition: DynamicSpectrum.h:27
double ds_min
The min DS value.
Definition: DynamicSpectrum.h:106
void compute()
Compute dynamic spectrum.
Definition: DynamicSpectrum.C:101
T get_value() const
const unsigned get_nsub() const
Get number of subints in ds.
Definition: DynamicSpectrum.h:65
const MJD get_rel_epoch(unsigned isub)
Get time of subint relative to start of file.
Definition: DynamicSpectrum.C:90
Reference::To< Flux > get_flux_method()
Provide access to the flux method.
Definition: DynamicSpectrum.h:44
Defines the PSRCHIVE library.
Definition: CalSource.h:17
double * ds_data
Dynamic spectrum array (nchan by nsubint)
Definition: DynamicSpectrum.h:97
unsigned nsub
Num subints in use.
Definition: DynamicSpectrum.h:94
void reset()
Reset memory allocation.
Definition: DynamicSpectrum.C:33
void unload(const std::string &filename, const std::string &command="")
Unload the results to a file.
Definition: DynamicSpectrum.C:135
Reference::To< const Archive > arch
The input archive.
Definition: DynamicSpectrum.h:82
Reference::To< Flux > flux
The flux method.
Definition: DynamicSpectrum.h:85

Generated using doxygen 1.8.17