T2Observatory.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2008 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Util/tempo2/T2Observatory.h
10 
11 #ifndef __Tempo2_Observatory_h
12 #define __Tempo2_Observatory_h
13 
14 #include "Pulsar/Site.h"
15 #include <vector>
16 
17 namespace Tempo2
18 {
19 
21  class Observatory : public Pulsar::Site
22  {
23  public:
24 
27 
28  bool is_alias_of(const std::string& name) const;
29  inline bool is_alias_of(const Observatory &obs) const{
30  return this->is_alias_of(obs.get_name());
31  }
32  inline bool is_alias_of(const char c) const{
33  return this->is_alias_of(std::string(1,c));
34  }
35 
37  std::string get_name () const;
38  void set_name (const std::string&);
39 
41  void get_xyz (double& x, double& y, double& z) const;
42  void set_xyz (double x, double y, double z);
43 
45  void get_sph (double& lat, double& lon, double& rad) const;
46 
48  std::string get_old_code () const;
49  void set_old_code (const std::string&);
50 
52  char get_code () const;
53  void set_code (char);
54 
55  std::vector<std::string> aliases;
56  protected:
57 
58  std::string name;
59  std::string old_code;
60  char code;
61  double x, y, z;
62 
63  };
64 
65  const Observatory* observatory (const std::string& telescope_name);
66 
67 }
68 
69 #endif
70 
A convenient exception handling class.
Definition: Error.h:54
void get_xyz(double &x, double &y, double &z) const
Get the geocentric XYZ coordinates in metres.
Definition: T2Observatory.C:83
char code(const std::string &telescope_name)
Convert a telescope name to a single-character tempo code.
Definition: tempo++.C:167
void get_sph(double &lat, double &lon, double &rad) const
Get the latitude and longitude in radians, radius in metres.
Definition: T2Observatory.C:89
const Observatory * observatory(const std::string &telescope_name)
Return the Observatory data given the telescope name.
Definition: Observatory.C:130
char get_code() const
Get the observatory number (from $TEMPO2/observatory/aliases)
Definition: T2Observatory.C:29
Template class manages Reference::Able objects.
Definition: Reference.h:74
Observatory()
Default constructor.
Definition: T2Observatory.C:23
Site coordinates.
Definition: Site.h:25
std::string get_old_code() const
Get the "old-style" telescope ID code.
Definition: T2Observatory.C:58
Observatory data available from TEMPO.
Definition: T2Observatory.h:26
std::string get_name() const
Get the observatory name.
Definition: T2Observatory.C:68

Generated using doxygen 1.8.17