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 
16 namespace 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 
71  float origin_norm;
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
void TimerProfile_load(FILE *fptr, Profile *profile, bool big_endian=true)
load a Profile from a timer archive
Definition: TimerProfile_load.C:22
void set_origin_norm(float f)
Set the world-normalized coordinates of the origin on the time axis.
Definition: TimeScale.h:66
const float * get_amps() const
Return a pointer to the amplitudes array.
Definition: ProfileAmps.C:141
Units
The units on the time axis.
Definition: TimeScale.h:31
virtual unsigned get_nsubint() const =0
Get the number of sub-integrations stored in the file.
Any quantity recorded as a function of pulse phase.
Definition: Profile.h:45
The primary interface to pulsar observational data.
Definition: Archive.h:45
float origin_norm
Origin on the time axis.
Definition: TimeScale.h:76
char code(const std::string &telescope_name)
unsigned get_nbin() const
Return the number of bins.
Definition: ProfileAmps.h:50
Units get_units() const
Get the units on the time axis.
Definition: TimeScale.h:63
const ExtensionType * get() const
Template method searches for an Extension of the specified type.
float get_origin_norm() const
Get the world-normalized coordinates of the origin on the time axis.
Definition: TimeScale.h:68
void init(const Archive *)
Initialize internal attributes according to Archive data.
Definition: TimeScale.C:25
Directional * get_Directional() const
Get a Directional object set up for this telescope.
Definition: Telescope.C:75
std::string label
Label on the time axis.
Definition: TimeScale.h:79
MJD end_time() const
Return the MJD at the end of the last sub-integration.
Definition: Archive.C:308
double get_Index(unsigned subint) const
Get the custom index value associated with an Integration.
Definition: IntegrationOrder.C:68
Represents an axis with a time ordinate.
Definition: TimeScale.h:26
Contains information about the telescope used for the observation.
Definition: Telescope.h:26
MJD start_time() const
Return the MJD at the start of the first sub-integration.
Definition: Archive.C:299
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
std::string get_Unit() const
Return a string describing the units of this state.
Definition: IntegrationOrder.C:45
Units units
Units on the time axis.
Definition: TimeScale.h:73
std::string get_IndexState() const
Return a string describing the type of indexing used.
Definition: IntegrationOrder.C:40
void get_indeces(const Archive *, unsigned &min, unsigned &max) const
Return the min and max as the sub-integration index.
Definition: TimeScale.C:121
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void TimerProfile_unload(FILE *fptr, const Profile *profile, int poln)
unload a Profile to a timer archive
Definition: TimerProfile_unload.C:26
virtual sky_coord get_coordinates() const =0
Get the coordinates of the source.
std::string get_label() const
Get a description of the units.
Definition: TimeScale.C:127
float get_scale(const Archive *) const
Get the conversion factor from device to world normalized.
void set_units(Units s)
Set the units on the time axis.
Definition: TimeScale.h:61
Alternative ways of ordering Integration instances.
Definition: IntegrationOrder.h:29

Generated using doxygen 1.8.17