Sun position
Sun position algorithm
sky.h
Go to the documentation of this file.
1 #ifndef SKY_H
2 #define SKY_H
3 /*============================================================================*/
4 /*!\file
5  * \brief sky.h - structures and routines for astronomical observing & tracking
6  *
7  * \author David Hoadley
8  *
9  * \details
10  * This collection is in two parts:
11  * - time routines. Routines for handling the different timescales used
12  * in astronomy, and for calculating the rotational orientation of
13  * the Earth. The timescales involved are TT, UT1 and UTC
14  * (see \ref page-timescales). Also included here is a routine to set
15  * polar motion parameters.
16  * - site routines. Data that is specific to an observing site on the
17  * Earth, and routines to convert astronomical coordinates to
18  * site-specific (i.e. topocentric) coordinates at the site. More
19  * than one site may be supported simultaneously, if required.
20  *
21  * The routines are designed to provide an efficient implementation of
22  * the necessary calculations. When combined with the routines in the
23  * skyfast.h and skyfast.c module, they enable accurate tracking with
24  * even a small processor.
25  *
26  * Other modules required:
27  * - sun.h (and sun.c) if you want to track the Sun, using either the
28  * NREL Solar Position Algorithm, or a simplified approximate one.
29  * - moon.h (and moon.c) if you want to track the Moon, using the
30  * NREL Moon Position Algorithm
31  * - (future) a module for tracking other planets
32  * - (future) a module for tracking stars
33  * - skyio.h (and skyio.c) for input-output routines: conversions of
34  * angles to and from strings in sexagesimal (e.g. degrees, minutes
35  * and seconds) form; writing out a day number as a date & time.
36  * - vectors3d.h (and vectors3d.c) which implements the rectangular
37  * matrix and vector operations used by these algorithms,
38  *
39  * You will need to separately include one of the following modules:
40  * - sky0.h (and sky0.c) for nutation routines and sidereal time
41  * routines suitable for tracking the Sun or the Moon using the
42  * NREL Solar Position Algorithm and Moon Position Algorithm
43  * - (future) sky1.h (and sky1.c) for IAU 1980 precession, nutation and
44  * sidereal time routines, suitable for tracking stars
45  * - (future) sky2.h (and sky2.c) for IAU 2000 precession, nutation and
46  * sidereal time routines, suitable for tracking stars
47  *
48  *==============================================================================
49  */
50 /*
51  * Copyright (c) 2020, David Hoadley <vcrumble@westnet.com.au>
52  * All rights reserved.
53  *
54  * Redistribution and use in source and binary forms, with or without
55  * modification, are permitted provided that the following conditions are met:
56  *
57  * * Redistributions of source code must retain the above copyright notice, this
58  * list of conditions and the following disclaimer.
59  * * Redistributions in binary form must reproduce the above copyright notice,
60  * this list of conditions and the following disclaimer in the documentation
61  * and/or other materials provided with the distribution.
62  *
63  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
64  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
65  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
66  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
67  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
68  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
69  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
70  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
71  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
72  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
73  * POSSIBILITY OF SUCH DAMAGE.
74  */
75 /*------------------------------------------------------------------------------
76  * Notes:
77  * Character set: UTF-8. (Non ASCII characters appear in this file)
78  * Things you might want to edit: definition of macro INCLUDE_MJD_ROUTINES
79  * definition of macro POSIX_SYSTEM
80  *----------------------------------------------------------------------------*/
81 
82 #include <time.h>
83 
84 #include "general.h"
85 #include "vectors3d.h"
86 
87 /*
88  * Global #defines and typedefs
89  */
90 
91 /*! Struct used for holding an object's coordinates in equatorial apparent or
92  * Intermediate coordinates.
93  * Apparent coordinates are those referred to the true equator and equinox of
94  * the time indicated in field #timestamp_cy.
95  * Intermediate coordinates are in the Celestial Intermediate Reference System
96  * (CIRS), referred to the true equator of time #timestamp_cy and to the
97  * Celestial Intermediate Origin (CIO) instead of the equinox.
98  * If the object is in Apparent coordinates, the Equation of the Equinoxes
99  * (#eqEq_rad) field is required as part of converting to topocentric
100  * coordinates. If the object is in CIRS coordinates, field #eqEq_rad can be
101  * ignored.
102  *
103  * This structure is returned by the sun_nrelApparent(), moon_nrelApparent(),
104  * (future)planet_getApparent() and (future)star_getApparent() functions, and
105  * importantly for tracking, the skyfast_getApprox() function.*/
106 typedef struct {
107  double timestamp_cy; /*!< Time applying to the other figures in
108  this struct (centuries since J2000.0, TT
109  timescale) */
110  V3D_Vector appCirsV; /*!< Direction of object in apparent or CIRS
111  coordinates (effectively a unit vector). */
112  double distance_au; /*!< Distance to object (Astronomical Units) or
113  0.0 for far distant objects (that is, those
114  with negligible diurnal parallax) */
115  double eqEq_rad; /*!< Equation of the Equinoxes (radian). */
117 
118 /*! Coordinates of a celestial object in the horizon frame, in both
119  rectangular and polar forms.
120  - The rectangular coordinate vector has the orientation
121  + x points to North horizon,
122  + y points to East horizon,
123  + z points to the zenith.
124  (This is a left-handed set.)
125  - In the polar form, the azimuth is measured clockwise from North
126  (i.e. east = +90°).
127  - This combined rectangular & polar form is used because it happens to
128  be most convenient to calculate both forms at once. */
129 typedef struct {
130  V3D_Vector rectV; /*!< unit vector in horizon coordinates */
131  double azimuth_rad; /*!< azimuth (radian) */
132  double elevation_rad; /*!< elevation (or altitude) (radian) */
134 
135 
136 #ifdef __cplusplus
137 extern "C" {
138 #endif
139 
140 
141 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142  * The TIME routines and structs
143  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
144 
145 /*
146  * Global #defines and typedefs
147  */
148 
149 /* Un-comment the following line if you want routines that convert calendar
150  dates and times to and from Modified Julian Date (MJD) format (where
151  MJD = JD - 2 400 000.5). */
152 /*--- #define INCLUDE_MJD_ROUTINES ---*/
153 
154 /* Un-comment the following line if you want to use either of the routines
155  that use the struct timespec data type (available on POSIX-compliant
156  systems). These are sky_unixTimespecToJ2kd() & sky_unixTimespecToMjd()*/
157 /*--- #define POSIX_SYSTEM ---*/
158 
159 /*! This structure contains relatively constant data, and is set up by one
160  of the three functions sky_initTime(), sky_initTimeSimple() or
161  sky_initTimeDetailed(). The data which can vary
162  is not expected to vary any more frequently than once per day or even
163  less. Do not modify any of the fields in this structure directly; use
164  the routines in this file to make all changes. In general, you won't
165  need to access any of the individual fields here. */
166 typedef struct {
167  double deltaUT_d; //!< UT1 - UTC, scaled to days
168  double deltaT_d; //!< TT - UT1, scaled to days
169  double deltaTT_d; //!< TT - UTC, scaled to days
170 } Sky_DeltaTs;
171 
172 /*! This structure contains the continuously varying time (and earth
173  rotation) data, in various forms that we will find useful.
174 
175  Do not modify any of these fields directly - use
176  the sky_updateTimes() function to update them.
177 
178  But you will almost certainly want to read the values of any of the
179  individual fields, and/or pass them to functions. In particular, the
180  field #j2kTT_cy is passed to many routines.
181 
182  Notation used in section B of the _Astronomical Almanac_ 2007 is shown
183  in [square brackets]. */
184 typedef struct {
185  double mjdUtc; //!< Modified Julian Date (= JD - 2 400 000.5), UTC
186  double j2kUT1_d; //!< days since J2000.0, UT1 timescale [Du]
187  double j2kTT_d; //!< days since J2000.0, TT timescale [D]
188  double j2kTT_cy; //!< Julian centuries since J2000.0, TT timescale [T]
189  double era_rad; //!< Earth Rotation Angle (radian) [θ]
190 } Sky_Times;
191 
192 /*! This structure contains polar motion parameters and a rotation
193  matrix. Do not modify any of these fields directly - use the
194  sky_setPolarMotion() function to do that. In general, you won't
195  need to access any of the individual fields here. */
196 typedef struct {
197  bool correctionInUse; // if false, polar motion is being ignored
198  double xPolar_as; // polar motion in x (arcseconds)
199  double yPolar_as; // polar motion in y (arcseconds)
200  V3D_Matrix corrM; // polar motion rotation matrix
201 } Sky_PolarMot;
202 
203 /*
204  * Global functions available to be called by other modules
205  */
206 /* 1. Initialise this module by choosing one of the following 3 fns */
207 void sky_initTime(int deltaAT_s, double deltaUT_s, Sky_DeltaTs *d);
209 void sky_initTimeDetailed(double mjdUtc,
210  double usnoMjdBase,
211  double usnoCoeffC11,
212  double usnoCoeffC12,
213  int deltaAT_s,
214  Sky_DeltaTs *d);
215 
216 /* 2. Get the time in "J2KD" form from one of the following functions. */
217 double sky_calTimeToJ2kd(int year, int month, int day,
218  int hour, int minute, double second,
219  double tz_h);
220 double sky_unixTimeToJ2kd(time_t unixTime);
221 #ifdef POSIX_SYSTEM
222 double sky_unixTimespecToJ2kd(struct timespec uTs);
223 #endif
224 
225 #ifdef INCLUDE_MJD_ROUTINES
226 /* 2b. Alternatively get time in MJD form from one of the following fns */
227 double sky_calTimeToMjd(int year, int month, int day,
228  int hour, int minute, double second,
229  double tz_h);
230 double sky_unixTimeToMjd(time_t unixTime);
231 #ifdef POSIX_SYSTEM
232 double sky_unixTimespecToMjd(struct timespec uTs);
233 #endif
234 #endif
235 
236 
237 /* 3. Call the following to update the other astronomical times */
238 void sky_updateTimes(double j2kUtc_d,
239  const Sky_DeltaTs *d,
240  Sky_Times *t);
241 
242 #ifdef INCLUDE_MJD_ROUTINES
243 /* 3b. Update the other astronomical times */
244 void sky_updateTimesFromMjd(double mjdUtc,
245  const Sky_DeltaTs *d,
246  Sky_Times *t);
247 #endif
248 
249 
250 /* 4. Call routines (from other modules, not this one) to obtain the
251  position of your chosen star, planet or the sun in apparent coordinates
252  (i.e. w.r.t true equator and equinox at the time of interest). As part
253  of that process, you will have obtained the equation of the equinoxes.*/
254 
255 /* 5. Call one of the following to update the rotational position of the
256  Earth and convert your apparent position in to coordinates in the
257  Terrestrial Intermediate Reference system. Choose one of
258  sky0_appToTirs() - if you are tracking the Sun or Moon using
259  the NREL SPA or SAMPA functions.
260  astc1_appToTirs() - if you are using the IAU 1980 nutation
261  routines etc.
262  astc2_appToTirs() - if you are using the IAU 2000 routines
263 */
264 
265 /* 6. Call sky_siteTirsToTopo() for each observing site or solar panel
266  location to convert the TIRS coordinates to topocentric coordinates at
267  the site or sites. */
268 
269 
270 /* Repeat 2, 3, 4, 5 and 6 in a loop at whatever rate suits you */
271 
272 /* 6. From time to time, (no more than daily) call the following to update
273  polar motion parameters, if you need to take polar motion into account*/
274 void sky_setPolarMotion(double xPolar_as,
275  double yPolar_as,
276  double t_cy,
277  Sky_PolarMot *polar);
278 /* 6b. If you have called the routine above, you must also call the routine
279  sky_adjustSiteForPolarMotion() for every observing site you are
280  calculating positions for */
281 
282 /* Other routines */
283 void sky_j2kdToCalTime(double j2k_d,
284  int *year,
285  int *month,
286  int *day,
287  int *hour,
288  int *minute,
289  double *second);
290 
291 #ifdef INCLUDE_MJD_ROUTINES
292 void sky_mjdToCalTime(double mjd,
293  int *year,
294  int *month,
295  int *day,
296  int *hour,
297  int *minute,
298  double *second);
299 #endif
300 
301 
302 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
303  * The SITE routines and structs
304  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
305 
306 /*
307  * Global #defines and typedefs
308  */
309 /*! Site properties. Declare one object of the following type for each site
310  that you want to calculate sky positions for (typically one site). Do
311  not modify any of the fields in this structure directly; use the
312  routines in this file to make all changes. In general, you won't need
313  to access any of the individual fields here (except possibly
314  #timeZone_d) */
315 typedef struct {
316  double astLat_rad; //!< Astronomical latitude of site (ϕA) (radian)
317  double astLong_rad; //!< Astronomical longitude of site (radian)
318  double geocRadius_km; //!< Approx geocentric radius of site (≈ ae*ρ)(km)
319  double rhoSin_au; //!< ae*ρ*sin(ϕ - ϕ′) geocentre-to-site x (AU)
320  double rhoCos_au; //!< -ae*ρ*cos(ϕ - ϕ′) geocentre-to-site z (AU)
321  double diurnalAberr; //!< Diurnal aberration: caused by earth rotation
322  double refracPT; //!< Refraction correction: pressure & temperature
323  double timeZone_d; //!< time zone offset from UTC (fraction of a day)
324  V3D_Matrix *azElM; //!< points to either azElPolM or azElBaseM
325  V3D_Matrix azElPolM; //!< rotation matrix from TIRS to Az/El coords
326  V3D_Matrix azElBaseM; //!< as above, but excluding polar motion correctn
327  V3D_Matrix haDecM; //!< rotation matrix from Az/El to HA/Dec coords
328 } Sky_SiteProp;
329 
330 
331 /*
332  * Global functions available to be called by other modules
333  */
334 /* To initialise the Sky_SiteProp structure, call one of the following two
335  sky_setSiteLocation() functions for each site, and then call
336  sky_setSiteTempPressure() and sky_setSiteTimeZone() as required */
337 void sky_setSiteLocation(double latitude_deg,
338  double longitude_deg,
339  double height_m,
340  Sky_SiteProp *site);
341 void sky_setSiteLoc2(double astLat_deg,
342  double astLong_deg,
343  double geodLat_deg,
344  double geodLong_deg,
345  double height_m,
346  Sky_SiteProp *site);
347 void sky_setSiteTempPress(double temperature_degC,
348  double pressure_hPa,
349  Sky_SiteProp *site);
350 void sky_setSiteTimeZone(double timeZone_h,
351  Sky_SiteProp *site);
352 
353 /* Call the following if you have a surface for which you want to calculate
354  the incidence angle of the rays from the celestial object being tracked.
355  Typically this surface would be a solar panel, and you want the angle
356  at which the Sun's rays are striking the surface. */
357 void sky_setupSiteSurface(double azimuth_deg,
358  double slope_deg,
359  Sky_SiteHorizon *surface);
360 
361 /* Call the following if you have called sky_setPolarMotion() to change
362  polar motion parameters. */
364  Sky_SiteProp *site);
365 
366 
367 /* You will need to call one or more of the following functions each time
368  around your main loop, to convert to site-specific coords. (Typically
369  you will call sky_siteTirsToTopo() to convert from terrestrial
370  intermediate coordinates to topocentric coordinates.) */
371 void sky_siteTirsToTopo(const V3D_Vector *terInterV,
372  double dist_au,
373  const Sky_SiteProp *site,
374  Sky_SiteHorizon *topo);
375 void sky_siteAzElToHaDec(const V3D_Vector *topoV,
376  const Sky_SiteProp *site,
377  double *hourAngle_rad,
378  double *declination_rad);
379 double sky_siteIncidence_rad(const V3D_Vector *topoV,
380  const V3D_Vector *surfaceV);
381 
382 
383 /*
384  * Global variables accessible by other modules
385  */
386 
387 #ifdef __cplusplus
388 }
389 #endif
390 
391 /*! \page page-sky-h Edits you may want to make to sky.h
392  *
393  * Define the macro INCLUDE_MJD_ROUTINES if you have use for any of the
394  * routines sky_calTimeToMjd(), sky_unixTimeToMjd(), sky_unixTimespecToMjd(),
395  * sky_updateTimesFromMjd(), or sky_mjdToCalTime(). None of these routines are
396  * essential for tracking celestial objects.
397  *
398  * Define the macro POSIX_SYSTEM if you are using a system that supports the
399  * POSIX standard (a common Unix standard) and you have a use for either of the
400  * routines sky_unixTimespecToJ2kd() or sky_unixTimespecToMjd()
401  */
402 
403 #endif /* SKY_H */
404 
Sky_SiteProp::azElPolM
V3D_Matrix azElPolM
rotation matrix from TIRS to Az/El coords
Definition: sky.h:325
general.h
general.h - definitions of general use to (standard) C programs
Sky_TrueEquatorial::appCirsV
V3D_Vector appCirsV
Direction of object in apparent or CIRS coordinates (effectively a unit vector).
Definition: sky.h:110
sky_j2kdToCalTime
void sky_j2kdToCalTime(double j2k_d, int *year, int *month, int *day, int *hour, int *minute, double *second)
This procedure converts the integral part of the date in "J2KD" form to a calendar date and the fract...
Definition: sky-time.c:321
Sky_DeltaTs::deltaT_d
double deltaT_d
TT - UT1, scaled to days.
Definition: sky.h:168
Sky_DeltaTs
This structure contains relatively constant data, and is set up by one of the three functions sky_ini...
Definition: sky.h:166
Sky_DeltaTs::deltaTT_d
double deltaTT_d
TT - UTC, scaled to days.
Definition: sky.h:169
sky_siteTirsToTopo
void sky_siteTirsToTopo(const V3D_Vector *terInterV, double dist_au, const Sky_SiteProp *site, Sky_SiteHorizon *topo)
Transform a coordinate vector from the Terrestrial Intermediate Reference System to topocentric Az/El...
Definition: sky-site.c:378
sky_setPolarMotion
void sky_setPolarMotion(double xPolar_as, double yPolar_as, double t_cy, Sky_PolarMot *polar)
Update polar motion correction.
Definition: sky-time.c:570
Sky_SiteProp::astLat_rad
double astLat_rad
Astronomical latitude of site (ϕA) (radian)
Definition: sky.h:316
sky_updateTimes
void sky_updateTimes(double j2kUtc_d, const Sky_DeltaTs *d, Sky_Times *t)
Convert the given "J2KD" in the UTC timescale to the other timescales, and pre-calculate some other q...
Definition: sky-time.c:206
Sky_TrueEquatorial
Struct used for holding an object's coordinates in equatorial apparent or Intermediate coordinates.
Definition: sky.h:106
sky_setSiteLocation
void sky_setSiteLocation(double latitude_deg, double longitude_deg, double height_m, Sky_SiteProp *site)
Initialise the site structure by calculating those site-related values that do not change with time.
Definition: sky-site.c:105
Sky_Times::j2kTT_cy
double j2kTT_cy
Julian centuries since J2000.0, TT timescale [T].
Definition: sky.h:188
Sky_SiteProp::azElM
V3D_Matrix * azElM
points to either azElPolM or azElBaseM
Definition: sky.h:324
Sky_Times
This structure contains the continuously varying time (and earth rotation) data, in various forms tha...
Definition: sky.h:184
Sky_SiteProp::geocRadius_km
double geocRadius_km
Approx geocentric radius of site (≈ ae*ρ)(km)
Definition: sky.h:318
Sky_SiteProp::haDecM
V3D_Matrix haDecM
rotation matrix from Az/El to HA/Dec coords
Definition: sky.h:327
Sky_SiteProp::rhoSin_au
double rhoSin_au
ae*ρ*sin(ϕ - ϕ′) geocentre-to-site x (AU)
Definition: sky.h:319
Sky_Times::era_rad
double era_rad
Earth Rotation Angle (radian) [θ].
Definition: sky.h:189
Sky_TrueEquatorial::eqEq_rad
double eqEq_rad
Equation of the Equinoxes (radian).
Definition: sky.h:115
Sky_SiteProp
Site properties.
Definition: sky.h:315
Sky_DeltaTs::deltaUT_d
double deltaUT_d
UT1 - UTC, scaled to days.
Definition: sky.h:167
Sky_SiteHorizon::azimuth_rad
double azimuth_rad
azimuth (radian)
Definition: sky.h:131
Sky_TrueEquatorial::timestamp_cy
double timestamp_cy
Time applying to the other figures in this struct (centuries since J2000.0, TT timescale)
Definition: sky.h:107
sky_adjustSiteForPolarMotion
void sky_adjustSiteForPolarMotion(const Sky_PolarMot *polar, Sky_SiteProp *site)
Modify our azEl rotation matrix to incorporate a polar motion rotation matrix.
Definition: sky-site.c:347
Sky_SiteProp::timeZone_d
double timeZone_d
time zone offset from UTC (fraction of a day)
Definition: sky.h:323
sky_setupSiteSurface
void sky_setupSiteSurface(double azimuth_deg, double slope_deg, Sky_SiteHorizon *surface)
Set the orientation and slope of a surface (such as a solar panel) for which you want to calculate th...
Definition: sky-site.c:317
V3D_Matrix
3x3 matrix.
Definition: vectors3d.h:51
Sky_TrueEquatorial::distance_au
double distance_au
Distance to object (Astronomical Units) or 0.0 for far distant objects (that is, those with negligibl...
Definition: sky.h:112
sky_initTimeDetailed
void sky_initTimeDetailed(double mjdUtc, double usnoMjdBase, double usnoCoeffC11, double usnoCoeffC12, int deltaAT_s, Sky_DeltaTs *d)
This is one of three alternative routines for setting up the various delta time values for use in ong...
Definition: sky-time.c:134
V3D_Vector
3x1 vector.
Definition: vectors3d.h:57
Sky_Times::j2kTT_d
double j2kTT_d
days since J2000.0, TT timescale [D]
Definition: sky.h:187
sky_unixTimeToJ2kd
double sky_unixTimeToJ2kd(time_t unixTime)
Convert a time in Unix system time format to days since 2000 Jan 1, noon UTC.
Definition: sky-time.c:275
Sky_PolarMot
This structure contains polar motion parameters and a rotation matrix.
Definition: sky.h:196
sky_setSiteTimeZone
void sky_setSiteTimeZone(double timeZone_h, Sky_SiteProp *site)
Set the time zone offset for this site.
Definition: sky-site.c:293
Sky_SiteProp::astLong_rad
double astLong_rad
Astronomical longitude of site (radian)
Definition: sky.h:317
sky_setSiteTempPress
void sky_setSiteTempPress(double temperature_degC, double pressure_hPa, Sky_SiteProp *site)
Set refraction coefficients based on atmospheric temperature and pressure at the site.
Definition: sky-site.c:261
sky_initTime
void sky_initTime(int deltaAT_s, double deltaUT_s, Sky_DeltaTs *d)
This is one of three alternative routines for setting up the various delta time values for use in ong...
Definition: sky-time.c:96
Sky_SiteProp::rhoCos_au
double rhoCos_au
-ae*ρ*cos(ϕ - ϕ′) geocentre-to-site z (AU)
Definition: sky.h:320
vectors3d.h
vectors3d.h - Three dimensional geometry, vectors and matrices
Sky_SiteHorizon::elevation_rad
double elevation_rad
elevation (or altitude) (radian)
Definition: sky.h:132
Sky_Times::mjdUtc
double mjdUtc
Modified Julian Date (= JD - 2 400 000.5), UTC.
Definition: sky.h:185
Sky_Times::j2kUT1_d
double j2kUT1_d
days since J2000.0, UT1 timescale [Du]
Definition: sky.h:186
sky_siteAzElToHaDec
void sky_siteAzElToHaDec(const V3D_Vector *topoV, const Sky_SiteProp *site, double *hourAngle_rad, double *declination_rad)
Take a topocentric position vector in Azimuth/Elevation frame and use it to calculate the observed Ho...
Definition: sky-site.c:511
sky_initTimeSimple
void sky_initTimeSimple(Sky_DeltaTs *d)
This is one of three alternative routines for setting up the various delta time values for use in ong...
Definition: sky-time.c:181
Sky_SiteProp::refracPT
double refracPT
Refraction correction: pressure & temperature.
Definition: sky.h:322
sky_siteIncidence_rad
double sky_siteIncidence_rad(const V3D_Vector *topoV, const V3D_Vector *surfaceV)
Calculate the incidence angle of rays from the celestial object described by topoV (such as the sun) ...
Definition: sky-site.c:547
sky_setSiteLoc2
void sky_setSiteLoc2(double astLat_deg, double astLong_deg, double geodLat_deg, double geodLong_deg, double height_m, Sky_SiteProp *site)
Alternative initialisation function to sky_setSiteLocation().
Definition: sky-site.c:156
sky_calTimeToJ2kd
double sky_calTimeToJ2kd(int year, int month, int day, int hour, int minute, double second, double tz_h)
Return the number of days (and fraction of a day) since noon 2000 Jan 1 (UTC) of the given calendar d...
Definition: sky-time.c:241
Sky_SiteProp::azElBaseM
V3D_Matrix azElBaseM
as above, but excluding polar motion correctn
Definition: sky.h:326
Sky_SiteProp::diurnalAberr
double diurnalAberr
Diurnal aberration: caused by earth rotation.
Definition: sky.h:321
Sky_SiteHorizon
Coordinates of a celestial object in the horizon frame, in both rectangular and polar forms.
Definition: sky.h:129
Sky_SiteHorizon::rectV
V3D_Vector rectV
unit vector in horizon coordinates
Definition: sky.h:130