# Diff of /trunk/models/johnpye/grena/sunpos_grena.h

revision 2470 by jpye, Sat May 28 09:12:38 2011 UTC revision 2471 by jpye, Sat May 28 10:24:10 2011 UTC
# Line 53  Line 53
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
# Line 68  Line 66
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)
# Line 86  typedef struct SunPos_struct{ Line 85  typedef struct SunPos_struct{
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
# Line 99  void SunPos_set_lat_long(SunPos *S, doub Line 101  void SunPos_set_lat_long(SunPos *S, doub
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.
# Line 109  void SunPos_set_pressure_temp(SunPos *S, Line 111  void SunPos_set_pressure_temp(SunPos *S,
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

Legend:
 Removed from v.2470 changed lines Added in v.2471