Transposer.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2004 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/General/Pulsar/Transposer.h
10
11#ifndef __Pulsar_Transposer_h
12#define __Pulsar_Transposer_h
13
14#include "Pulsar/Algorithm.h"
15
16#include "Reference.h"
17#include "Types.h"
18
19namespace Pulsar {
20
21 class Archive;
22 class Integration;
23 class Profile;
24 class Dimensions;
25
27 class Transposer : public Algorithm {
28
29 public:
30
32 Transposer (const Archive* archive = 0);
33
35 ~Transposer ();
36
38 void set_Archive (const Pulsar::Archive* archive);
39
41 void set_dim (unsigned idim, Signal::Dimension dim);
42
44 unsigned get_ndim (unsigned idim);
45
47 Dimensions get_stride (const Dimensions& dimensions) const;
48
50 Dimensions get_stride () const;
51
53 void get_amps (std::vector<float>& amps) const;
54
56 void get_amps (const Integration*, float*, const Dimensions& stride) const;
57
59 void get_amps (const Profile*, float*, unsigned jbin) const;
60
62 bool verbose;
63
64 protected:
65
66 void range_check (unsigned idim, const char* method) const;
67
69 Signal::Dimension dim[4];
70
71 };
72
74 class Dimensions {
75
76 public:
77
79 Dimensions (const Pulsar::Archive* archive = 0);
80
82 unsigned get_ndim (Signal::Dimension axis) const;
83
84 protected:
85
86 friend class Transposer;
87
89 void set_if_zero (unsigned ndim);
90
92 void set_ndim (Signal::Dimension axis, unsigned ndim);
93
94 unsigned nsub;
95 unsigned npol;
96 unsigned nchan;
97 unsigned nbin;
98
99 };
100
101}
102
103#endif
Data manipulation implementations.
Definition Algorithm.h:19
The primary interface to pulsar observational data.
Definition Archive.h:46
Provides enumerated access to the dimensions of an Archive.
Definition Transposer.h:74
void set_if_zero(unsigned ndim)
Set the size of the remaining dimension.
Definition Transposer.C:148
void set_ndim(Signal::Dimension axis, unsigned ndim)
Set the size of the specified dimension.
Definition Transposer.C:173
unsigned get_ndim(Signal::Dimension axis) const
Get the size of the specified dimension.
Definition Transposer.C:156
Dimensions(const Pulsar::Archive *archive=0)
Default constructor.
Definition Transposer.C:136
Array of Profiles integrated over the same time interval.
Definition Integration.h:37
Any quantity recorded as a function of pulse phase.
Definition Profile.h:40
Dimensions get_stride() const
Get the stride.
Definition Transposer.C:54
bool verbose
verbosity flag
Definition Transposer.h:62
unsigned get_ndim(unsigned idim)
Get the size of the specified dimension.
Definition Transposer.C:40
void set_Archive(const Pulsar::Archive *archive)
Set the Archive from which data will be read.
Definition Transposer.C:29
Transposer(const Archive *archive=0)
Default constructor.
Definition Transposer.C:14
void get_amps(std::vector< float > &amps) const
Returns amplitude data; ordered according to the specified dimension.
Definition Transposer.C:78
~Transposer()
Destructor.
Definition Transposer.C:25
void set_dim(unsigned idim, Signal::Dimension dim)
Set the specified dimension.
Definition Transposer.C:34
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0