53 |
#ifndef SUNPOS_GRENA_H |
#ifndef SUNPOS_GRENA_H |
54 |
#define SUNPOS_GRENA_H |
#define SUNPOS_GRENA_H |
55 |
|
|
56 |
#include <iostream> |
#include <math.h> |
|
#include <cmath> |
|
|
|
|
57 |
#ifndef PI |
#ifndef PI |
58 |
# define PI 3.14159265358979 |
# define PI 3.14159265358979 |
59 |
#endif |
#endif |
66 |
*/ |
*/ |
67 |
typedef struct SunPos_struct{ |
typedef struct SunPos_struct{ |
68 |
// input data |
// input data |
69 |
double t; ///< Ephemeris Julian Day, offset such that 0 = noon 1 Jan 2003. |
double t_G; ///< Julian Day, offset such that 0 = noon 1 Jan 2003. |
70 |
|
double Delta_t; ///< Difference between UT and Terrestrial Time, in seconds. Zero is probably OK here. |
71 |
double latitude; ///< Latitude (N = positive??), in RADIANS. |
double latitude; ///< Latitude (N = positive??), in RADIANS. |
72 |
double longitude; ///< Longitude (E = positive??), in RADIANS. |
double longitude; ///< Longitude (E = positive??), in RADIANS. |
73 |
double p; ///< Pressure, in ATM (used for refraction calculation) |
double p; ///< Pressure, in ATM (used for refraction calculation) |
85 |
*/ |
*/ |
86 |
void SunPos_calc_time(SunPos *S, double UT, int Day, int Month, int Year, double Delta_t); |
void SunPos_calc_time(SunPos *S, double UT, int Day, int Month, int Year, double Delta_t); |
87 |
|
|
88 |
/** Set time directly in days since noon 1 Jan 2003 UTC. */ |
/** Set Julian Day time directly in days since noon 1 Jan 2003 UTC. |
89 |
void SunPos_set_time(SunPos *S, double t); |
@param t_G Julian Day (offset such that 0 = noon 1 Jan 2003 UTC) |
90 |
|
@param Delta_t @see SunPos_struct. |
91 |
|
*/ |
92 |
|
void SunPos_set_time(SunPos *S, double t_G, double Delta_t); |
93 |
|
|
94 |
/** Set location of observer on Earth |
/** Set location of observer on Earth |
95 |
@param latitude latitude in RADIANS! |
@param latitude latitude in RADIANS! |
101 |
@param p Pressure in ATM |
@param p Pressure in ATM |
102 |
@param T Temperature in °C |
@param T Temperature in °C |
103 |
*/ |
*/ |
104 |
void SunPos_set_pressure_temp(SunPos *S, double p, double T) |
void SunPos_set_pressure_temp(SunPos *S, double p, double T); |
105 |
|
|
106 |
/** |
/** |
107 |
Calculate the sun position in local spherical coordinates. |
Calculate the sun position in local spherical coordinates. |
111 |
*/ |
*/ |
112 |
void SunPos_calc_zen_azi(SunPos *S, double *zenith, double *azimuth); |
void SunPos_calc_zen_azi(SunPos *S, double *zenith, double *azimuth); |
113 |
|
|
114 |
|
#endif /* SUNPOS_GRENA_H */ |
115 |
|
|