Passband.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2003 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/Base/Extensions/Pulsar/Passband.h
10
11#ifndef __Pulsar_Passband_h
12#define __Pulsar_Passband_h
13
14#include "Pulsar/ArchiveExtension.h"
15
16namespace Pulsar {
17
19
21
22 public:
23
25 Passband ();
26
28 Passband (const Passband& extension);
29
31 const Passband& operator= (const Passband& extension);
32
34 ~Passband ();
35
37 Passband* clone () const { return new Passband( *this ); }
38
41 class Interface;
42
43 std::string get_short_name () const { return "band"; }
44
46 unsigned get_nchan () const;
47
49 unsigned get_npol () const;
50
52 unsigned get_nband () const;
53
55 bool has_data () const;
56
58 void resize (unsigned nchan, unsigned npol, unsigned nband=1);
59
61 const std::vector<float>&
62 get_passband (unsigned ipol, unsigned iband=0) const;
63
65 void set_passband (const std::vector<float>&,
66 unsigned ipol, unsigned iband=0);
67
69 void set_passband (const float* data, unsigned ipol, unsigned iband=0);
70
72 void zero ();
73
74 protected:
75
77 unsigned nchan;
78
80
81 unsigned npol;
82
84
86 unsigned nband;
87
89
91 std::vector< std::vector<float> > passband;
92
94 void range_check (unsigned ipol, unsigned iband, const char* method) const;
95
96 };
97
98}
99
100#endif
Passband()
Default constructor.
Definition Passband.C:14
Definition ArchiveExtension.h:24
unsigned nband
Number of frequency bands.
Definition Passband.h:86
TextInterface::Parser * get_interface()
Return a text interfaces that can be used to access this instance.
Definition Passband.C:165
~Passband()
Destructor.
Definition Passband.C:42
void resize(unsigned nchan, unsigned npol, unsigned nband=1)
Set the number of channels, polarizations, and bands.
Definition Passband.C:70
unsigned npol
Number of polarizations.
Definition Passband.h:81
Passband * clone() const
Clone method.
Definition Passband.h:37
void zero()
Set all passband datum (not dimensions) to zero.
Definition Passband.C:86
unsigned get_npol() const
Get the number of polarizations.
Definition Passband.C:53
std::string get_short_name() const
Return an abbreviated name that can be typed relatively quickly.
Definition Passband.h:43
Passband()
Default constructor.
Definition Passband.C:14
bool has_data() const
Return true if nchan * npol * nband != 0.
Definition Passband.C:64
const std::vector< float > & get_passband(unsigned ipol, unsigned iband=0) const
Get the specified passband.
Definition Passband.C:95
unsigned get_nchan() const
Get the number of frequency channels in each passband.
Definition Passband.C:47
void range_check(unsigned ipol, unsigned iband, const char *method) const
Throw an exception if ipol or iband are out of range.
Definition Passband.C:129
std::vector< std::vector< float > > passband
Average passbands.
Definition Passband.h:91
unsigned nchan
Number of frequency channels.
Definition Passband.h:77
const Passband & operator=(const Passband &extension)
Operator =.
Definition Passband.C:31
unsigned get_nband() const
Get the number of bands.
Definition Passband.C:59
void set_passband(const std::vector< float > &, unsigned ipol, unsigned iband=0)
Set the specified passband.
Definition Passband.C:102
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0