PhaseScale.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2006 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/More/Plotting/Pulsar/PhaseScale.h
10
11#ifndef __Pulsar_PhaseScale_h
12#define __Pulsar_PhaseScale_h
13
14#include "Pulsar/PlotScale.h"
15#include "PhaseRange.h"
16
17namespace Pulsar {
18
19 class Archive;
20
22 class PhaseScale : public PlotScale {
23
24 public:
25
27 PhaseScale ();
28
29 // Text interface to the PhaseScale class
30 class Interface : public TextInterface::To<PhaseScale> {
31 public:
32 Interface (PhaseScale* = 0);
33 };
34
36 void init (const Archive*);
37
39 void get_indeces (const Archive*, unsigned& min, unsigned& max) const;
40
42 void get_ordinates (const Archive* data, std::vector<float>& axis) const;
43
45 std::string get_label () const;
46
48 float get_scale (const Archive*) const;
49 float get_scale (const Archive*, Phase::Unit) const;
50
52 void set_units (Phase::Unit s) { units = s; }
54 Phase::Unit get_units () const { return units; }
55
57 void set_origin_norm (float f) { origin_norm = f; }
59 float get_origin_norm () const { return origin_norm; }
60
61 void set_origin (float f) { origin = f; origin_units = units; }
62 float get_origin () const { return origin; }
63
64 protected:
65
67 Phase::Unit units;
68
70 Phase::Unit origin_units;
71
74
76 float origin;
77 };
78}
79
80#endif
The primary interface to pulsar observational data.
Definition Archive.h:46
void get_ordinates(const Archive *data, std::vector< float > &axis) const
Get the ordinate values.
Definition PhaseScale.C:55
std::string get_label() const
Get a description of the units.
Definition PhaseScale.C:117
float origin_norm
Origin on the phase axis in world-normalized coordinates.
Definition PhaseScale.h:73
float get_scale(const Archive *) const
Get the conversion factor from turns to units.
Definition PhaseScale.C:69
void get_indeces(const Archive *, unsigned &min, unsigned &max) const
Return the min and max as the phase bin index.
Definition PhaseScale.C:47
PhaseScale()
Default constructor.
Definition PhaseScale.C:14
Phase::Unit get_units() const
Get the units on the phase axis.
Definition PhaseScale.h:54
float get_origin_norm() const
Get the world-normalized coordinates of the origin on the phase axis.
Definition PhaseScale.h:59
Phase::Unit units
Units on the phase axis.
Definition PhaseScale.h:67
void set_units(Phase::Unit s)
Set the units on the phase axis.
Definition PhaseScale.h:52
void set_origin_norm(float f)
Set the world-normalized coordinates of the origin on the phase axis.
Definition PhaseScale.h:57
float origin
Origin on the phase axis.
Definition PhaseScale.h:76
Phase::Unit origin_units
Units at the time set_origin is called.
Definition PhaseScale.h:70
void init(const Archive *)
Initialize internal attributes according to Archive data.
Definition PhaseScale.C:23
PlotScale()
Default constructor.
Definition PlotScale.C:20
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0