TimeScale.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2014 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/Plotting/Pulsar/TimeScale.h
10
11#ifndef __Pulsar_TimeScale_h
12#define __Pulsar_TimeScale_h
13
14#include "Pulsar/PlotScale.h"
15
16namespace Pulsar {
17
18 class Archive;
19
21 class TimeScale : public PlotScale {
22
23 public:
24
26 enum Units { Time, HourAngle, MJD, Subint };
27
29 TimeScale ();
30
31 // Text interface to the TimeScale class
32 class Interface : public TextInterface::To<TimeScale>
33 {
34 public:
35 Interface (TimeScale* = 0);
36 };
37
38 TextInterface::Parser* get_interface () { return new Interface(this); }
39
41 void init (const Archive*);
42
44 void get_indeces (const Archive*, unsigned& min, unsigned& max) const;
45
47 void get_ordinates (const Archive*, std::vector<float>& x_axis) const;
48
50 std::string get_label () const;
51
53 float get_scale (const Archive*) const;
54
56 void set_units (Units s) { units = s; }
58 Units get_units () const { return units; }
59
61 void set_origin_norm (float f) { origin_norm = f; }
63 float get_origin_norm () const { return origin_norm; }
64
65 protected:
66
69
72
74 std::string label;
75
76 };
77
78 std::ostream& operator << (std::ostream& os, TimeScale::Units units);
79
80 std::istream& operator >> (std::istream& is, TimeScale::Units& units);
81
82}
83
84#endif
The primary interface to pulsar observational data.
Definition Archive.h:46
PlotScale()
Default constructor.
Definition PlotScale.C:20
Represents an axis with a time ordinate.
Definition TimeScale.h:21
Units units
Units on the time axis.
Definition TimeScale.h:68
Units
The units on the time axis.
Definition TimeScale.h:26
float origin_norm
Origin on the time axis.
Definition TimeScale.h:71
std::string label
Label on the time axis.
Definition TimeScale.h:74
void get_indeces(const Archive *, unsigned &min, unsigned &max) const
Return the min and max as the sub-integration index.
Definition TimeScale.C:121
Units get_units() const
Get the units on the time axis.
Definition TimeScale.h:58
void set_units(Units s)
Set the units on the time axis.
Definition TimeScale.h:56
std::string get_label() const
Get a description of the units.
Definition TimeScale.C:127
TimeScale()
Default constructor.
Definition TimeScale.C:19
void get_ordinates(const Archive *, std::vector< float > &x_axis) const
Get the ordinate values.
Definition TimeScale.C:132
void init(const Archive *)
Initialize internal attributes according to Archive data.
Definition TimeScale.C:25
void set_origin_norm(float f)
Set the world-normalized coordinates of the origin on the time axis.
Definition TimeScale.h:61
float get_scale(const Archive *) const
Get the conversion factor from device to world normalized.
float get_origin_norm() const
Get the world-normalized coordinates of the origin on the time axis.
Definition TimeScale.h:63
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0