Types.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2002 - 2016 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/Util/genutil/Types.h
10
11#ifndef __Types_h
12#define __Types_h
13
14#include "Conventions.h"
15#include <string>
16
18namespace Signal {
19
33
34
52
68
99
100 unsigned State2npol (State s);
101
102 const char* source_string (Source source);
103 const char* state_string (State state);
104 const char* basis_string (Basis basis);
105
106 const std::string Source2string (Source source);
107 const std::string State2string (State state);
108 const std::string Basis2string (Basis basis);
109 const std::string Scale2string (Scale scale);
110
111 Basis string2Basis (const std::string& ss);
112 Source string2Source (const std::string& ss);
113 State string2State (const std::string& ss);
114 Scale string2Scale (const std::string& ss);
115
117 bool valid_state (State state, unsigned ndim, unsigned npol,
118 std::string& reason);
119
121 State pscrunch (State state);
122
123 std::ostream& operator << (std::ostream& ostr, Source source);
124 std::istream& operator >> (std::istream& is, Source& source);
125
126 std::ostream& operator << (std::ostream& ostr, State state);
127 std::istream& operator >> (std::istream& is, State& state);
128
129 std::ostream& operator << (std::ostream& ostr, Scale scale);
130 std::istream& operator >> (std::istream& is, Scale& scale);
131
132}
133
134/* note that Basis extraction and insertion operators are defined in
135 Conventions.h */
136
137#endif
138
Defines various signal types.
Definition Conventions.h:16
std::ostream & operator<<(std::ostream &, Basis)
Basis output operator.
Definition Conventions.C:14
Dimension
Dimensions of the data (so far)
Definition Types.h:21
@ Frequency
Radio Frequency in MHz.
Definition Types.h:25
@ Phase
Pulsar Phase, for instance.
Definition Types.h:29
@ Space
Mathematical space (real, complex, jones, etc.)
Definition Types.h:31
@ Polarization
Light.
Definition Types.h:27
@ Time
Time given in MJD.
Definition Types.h:23
State pscrunch(State state)
Returns the state resulting from a pscrunch operation.
Definition Types.C:159
bool valid_state(State state, unsigned ndim, unsigned npol, std::string &reason)
Tells you if your state is consistent with your npol and ndim.
Definition Types.C:93
std::istream & operator>>(std::istream &, Basis &)
Basis input operator.
Definition Conventions.C:27
Source
Sources of observed signals.
Definition Types.h:54
@ PolnCal
A polarization calibrator, such as the linear noise diode.
Definition Types.h:60
@ Unknown
An unknown source.
Definition Types.h:56
@ Calibrator
A calibrator solution.
Definition Types.h:66
@ FluxCalOff
Near a flux calibrator, such as two degrees off Hydra A.
Definition Types.h:64
@ Pulsar
A pulsar.
Definition Types.h:58
@ FluxCalOn
A flux calibrator, such as Hydra A + the linear noise diode.
Definition Types.h:62
Scale
The scale in which units are measured.
Definition Types.h:36
@ Volts
Calibrated voltage.
Definition Types.h:40
@ Energy
Uncalibrated energy.
Definition Types.h:42
@ EMF
Uncalibrated voltage.
Definition Types.h:38
@ FluxDensity
Uncalibrated flux density.
Definition Types.h:46
@ Joules
Calibrated energy.
Definition Types.h:44
@ ReferenceFluxDensity
Reference flux density.
Definition Types.h:48
@ Jansky
Calibrated flux density.
Definition Types.h:50
State
Possible states of the data.
Definition Types.h:71
@ PseudoStokes
PseudoStokes S0,S2,S2,S3.
Definition Types.h:87
@ NthPower
Square-law detected nth power.
Definition Types.h:79
@ Analytic
In-phase and Quadrature sampled voltages (complex)
Definition Types.h:75
@ FourthMoment
Fourth moment of the electric field (covariance of Stokes parameters)
Definition Types.h:97
@ QQ_State
Just QQ.
Definition Types.h:95
@ PP_State
Just PP.
Definition Types.h:93
@ Coherence
PP, QQ, Re[PQ], Im[PQ].
Definition Types.h:83
@ Invariant
Stokes invariant interval.
Definition Types.h:89
@ Nyquist
Nyquist sampled voltages (real)
Definition Types.h:73
@ Other
Other.
Definition Types.h:91
@ Stokes
Stokes I,Q,U,V.
Definition Types.h:85
@ PPQQ
Square-law detected, two polarizations.
Definition Types.h:81
@ Intensity
Square-law detected total power.
Definition Types.h:77

Generated using doxygen 1.14.0