Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.apo.nmsu.edu/Telescopes/TCC/html/tcs_site_8cc_source.html
Дата изменения: Tue Sep 15 02:25:38 2015
Дата индексирования: Sun Apr 10 01:16:18 2016
Кодировка:

Поисковые слова: annular solar eclipse
lsst.tcc: src/tcsSite.cc Source File
lsst.tcc  1.2.2-3-g89ecb63
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tcsSite.cc
Go to the documentation of this file.
1 #include <sstream>
2 #include <stdexcept>
3 #include "slalib.h"
4 #include "coordConv/physConst.h"
5 #include "tcc/telConst.h"
6 #include "tcc/tcsShim.h"
7 #include "tcc/tcsSite.h"
8 
9 namespace {
10 
11  void nullRefSub (int mode,
12  double refa, double refb,
13  double hm, double tlat, double temp, double press,
14  double humid, double tlr, double wavel,
15  double xin, double yin, double zin,
16  double *xout, double *yout, double *zout
17  ) {
18  *xout = xin;
19  *yout = yin;
20  *zout = zin;
21  }
22 
23 }
24 
25 namespace tcc {
26 
28  timestamp(0)
29  {
30  for (int i = 0, end = aux.size(); i < end; ++i) {
31  aux[i] = 0;
32  }
33  // this should work, but clang rejects it
34  // aux.fill(0);
35  };
36 
38  double tai,
39  coordConv::Site const &site
40  ) {
41  int stat;
42  stat = tcsItimeo(
43  -site.utc_tai, // TAI-UTC (s)
44  site.ut1_tai - site.utc_tai, // UT1-UTC (s)
45  site.poleX * coordConv::RadPerDeg, // polar-motion x-component (radians)
46  site.poleY * coordConv::RadPerDeg, // polar-motion y-component (radians)
47  &teo); // TCSpk earth orientation
48  if (stat != 0) {
49  std::ostringstream os;
50  os << "tcsItimeo error: " << stat;
51  throw std::runtime_error(os.str());
52  }
53 
54  stat = tcsIsite(
55  &teo, // TCSpk earth orientation
56  site.meanLong * coordConv::RadPerDeg, // longitude (radians, E +ve)
57  site.meanLat * coordConv::RadPerDeg, // geodetic latitude (radians)
58  site.elev, // height above sea level (m)
59  site.wavelen / coordConv::AngstromsPerMicron, // wavelength (micrometres)
60  0,
61 // &nullRefSub, // special refraction function; disable refraction correction
62  &tsite); // TCSpk site location and conditions
63  if (stat != 0) {
64  std::ostringstream os;
65  os << "tcsIsite error: " << stat;
66  throw std::runtime_error(os.str());
67  }
68 
69  tsite.press = 0; // disable refraction correction
70 
71  // from tcsSlow (expensive to call and we already have the results)
72  double taiDays = tai / coordConv::SecPerDay;
73  tsite.t0 = taiDays;
74  double ttDays = taiDays + teo.ttmtai;
75  tsite.tt0 = ttDays;
76  tsite.ttj = slaEpj(ttDays);
77 
78  double d = floor(tai);
79  tsite.st0 = slaDranrm(slaGmsta(d, (tai-d) - teo.delat + teo.delut) + tsite.tlong + slaEqeqx(ttDays));
80  tsite.refar = 0; // disable refraction correction
81  tsite.refbr = 0; // disable refraction correction
82  // tcsite.amprms intentionally left blank; it isn't needed and isn't readily available from coordConv
83 
84  timestamp = tai;
85  }
86 
87  std::string TcsSite::__repr__() const {
88  std::ostringstream os;
89  os << *this;
90  return os.str();
91  }
92 
93  std::ostream &operator<<(std::ostream &os, TcsSite const &tcsSite) {
94  os << "# TcsSite" << std::endl;
95 
96  os << "timestamp " << tcsSite.timestamp << " # timestamp (TAI, MJD seconds)" << std::endl;
97 
98  os << "tcsSite.teo: TCSpk time information" << std::endl;
99  os << tcsSite.teo;
100 
101  os << "tcsSite.tsite: TCSpk site information" << std::endl;
102  os << tcsSite.tsite;
103 
104  // start with only three readings; show more if we use more
105  for (int i = 0; i < 3; ++i) {
106  os << "aux[" << i << "] " << tcsSite.aux.at(i) << " # Auxiliary data readings" << std::endl;
107  }
108 
109  return os;
110  }
111 
112 }
TIMEO teo
time information
Definition: tcsSite.h:38
std::tr1::array< double, MAXAUX > aux
auxiliary data for pointing model terms
Definition: tcsSite.h:40
std::string __repr__() const
Definition: tcsSite.cc:87
double timestamp
tai of last update; 0 if never updated
Definition: tcsSite.h:37
SITE tsite
site information
Definition: tcsSite.h:39
std::ostream & operator<<(std::ostream &os, ChebyshevPolynomial const &cheby)
Definition: cheby.cc:12
size_type size() const
void update(double tai, coordConv::Site const &site)
Definition: tcsSite.cc:37
double tai()
Definition: tai.cc:7
reference at(size_type __n)