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 
17 namespace Pulsar {
18 
19  class Archive;
20 
22  class PhaseScale : public PlotScale {
23 
24  public:
25 
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 
73  float origin_norm;
74 
76  float origin;
77  };
78 }
79 
80 #endif
float origin
Origin on the phase axis.
Definition: PhaseScale.h:81
PhaseScale()
Default constructor.
Definition: PhaseScale.C:14
virtual double get_gate_duty_cycle() const
Get the fraction of the pulse period recorded (in turns)
Definition: Integration.h:220
void get_indeces(const Archive *, unsigned &min, unsigned &max) const
Return the min and max as the phase bin index.
Definition: PhaseScale.C:47
float get_scale(const Archive *) const
Get the conversion factor from turns to units.
Definition: PhaseScale.C:69
The primary interface to pulsar observational data.
Definition: Archive.h:45
Phase::Unit units
Units on the phase axis.
Definition: PhaseScale.h:72
void set_origin_norm(float f)
Set the world-normalized coordinates of the origin on the phase axis.
Definition: PhaseScale.h:62
void get_ordinates(const Archive *data, std::vector< float > &axis) const
Get the ordinate values.
Definition: PhaseScale.C:55
Integration * get_Integration(unsigned subint)
Return pointer to the specified Integration.
Definition: IntegrationManager.C:41
void init(const Archive *)
Initialize internal attributes according to Archive data.
Definition: PhaseScale.C:23
Reperesents an axis with pulse phase ordinate.
Definition: PhaseScale.h:27
Phase::Unit get_units() const
Get the units on the phase axis.
Definition: PhaseScale.h:59
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:78
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void set_units(Phase::Unit s)
Set the units on the phase axis.
Definition: PhaseScale.h:57
float get_origin_norm() const
Get the world-normalized coordinates of the origin on the phase axis.
Definition: PhaseScale.h:64
Phase::Unit origin_units
Units at the time set_origin is called.
Definition: PhaseScale.h:75
virtual double get_folding_period() const =0
Get the folding or topocentric pulsar period (in seconds)
virtual unsigned get_nbin() const =0
Get the number of pulsar phase bins used.

Generated using doxygen 1.8.17