Sun position
Sun position algorithm
|
Go to the documentation of this file.
56 #define SITE_LATITUDE_deg -37.8236
57 #define SITE_LONGITUDE_deg 144.9913
58 #define SITE_HEIGHT_m 30.0
59 #define SITE_PRESSURE_hPa 1013.0
60 #define SITE_TEMPERATURE_degC 15.0
61 #define SITE_TIMEZONE_h 10.0
140 char azStr[24], elStr[24];
162 printf(
"Full sun calculation\n");
166 printf(
" Sun Azimuth: %s, Elevation: %s\n", azStr, elStr);
180 char azStr[24], elStr[24];
203 printf(
"Fast sun calculation\n");
204 for (i = 0; i < 100; i++) {
212 printf(
" Sun Azimuth: %s, Elevation: %s\n", azStr, elStr);
general.h - definitions of general use to (standard) C programs
V3D_Vector appCirsV
Direction of object in apparent or CIRS coordinates (effectively a unit vector).
#define SITE_TIMEZONE_h
East zones +ve, west -ve (hours)
This structure contains relatively constant data, and is set up by one of the three functions sky_ini...
skyio.h - output and formatting routines and a read routine
static char * skyio_radToDmsStr(char destStr[], size_t destStrSize, double angle_rad, unsigned decimals)
Routine to take an angle in radian and return a string in degrees, arcminutes and arcseconds form - [...
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...
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...
Struct used for holding an object's coordinates in equatorial apparent or Intermediate coordinates.
void sun_nrelTopocentric(double j2kUtc_d, const Sky_DeltaTs *deltas, const Sky_SiteProp *site, Sky_SiteHorizon *topo)
Calls sun_nrelApparent() to calculate the Sun's position in apparent coordinates using the NREL Sun P...
void skyfast_getApprox(double t_cy, Sky_TrueEquatorial *approx)
Get the best approximation to the celestial object's apparent coordinates and distance,...
#define SITE_PRESSURE_hPa
Atmospheric pressure (hPa = mbar)
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.
double j2kTT_cy
Julian centuries since J2000.0, TT timescale [T].
void demo2(void)
Sample code using the greatly simplified calculation of the position of the Sun using interpolated co...
#define REQUIRE_NOT_NULL(pointer_)
,
#define SITE_TEMPERATURE_degC
Temperature (degrees Celsius)
This structure contains the continuously varying time (and earth rotation) data, in various forms tha...
#define SITE_LONGITUDE_deg
East lons +ve, west -ve (degrees)
#define SITE_HEIGHT_m
Height above sea level (metres)
double eqEq_rad
Equation of the Equinoxes (radian).
void sky0_appToTirs(const V3D_Vector *appV, double j2kUT1_d, double eqEq_rad, V3D_Vector *terInterV)
Convert a position in geocentric apparent coordinates to geocentric coordinates in the Terrestrial In...
double azimuth_rad
azimuth (radian)
void skyfast_init(double tStartUtc_d, int fullRecalcInterval_mins, const Sky_DeltaTs *deltas, void(*getApparent)(double j2kTT_cy, Sky_TrueEquatorial *pos))
Initialise those items that take a long time to calculate, but which do not need to be recalculated f...
#define SITE_LATITUDE_deg
North lats +ve, south -ve (deg)
double timeZone_d
time zone offset from UTC (fraction of a day)
double distance_au
Distance to object (Astronomical Units) or 0.0 for far distant objects (that is, those with negligibl...
void sunTopocentricFast(double j2kUtc_d, const Sky_DeltaTs *dTs, const Sky_SiteProp *site, Sky_SiteHorizon *topo)
Uses previously calculated values of the Sun's apparent coordinates and interpolation to quickly calc...
double sky_unixTimeToJ2kd(time_t unixTime)
Convert a time in Unix system time format to days since 2000 Jan 1, noon UTC.
void sky_setSiteTimeZone(double timeZone_h, Sky_SiteProp *site)
Set the time zone offset for this site.
void demo1(void)
Sample code demonstrating the calculation of the position of the Sun using rectangular coordinates.
void sky_setSiteTempPress(double temperature_degC, double pressure_hPa, Sky_SiteProp *site)
Set refraction coefficients based on atmospheric temperature and pressure at the site.
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...
sky.h - structures and routines for astronomical observing & tracking
vectors3d.h - Three dimensional geometry, vectors and matrices
void sun_nrelApparent(double j2kTT_cy, Sky_TrueEquatorial *pos)
Calculate the Sun's position as a unit vector and a distance, in apparent coordinates.
void skyio_printJ2kd(double j2kd)
Write out a J2KD as a calendar date and time.
double elevation_rad
elevation (or altitude) (radian)
double j2kUT1_d
days since J2000.0, UT1 timescale [Du]
skyfast.h - set up and use interpolation for rapid calculation of a celestial object's apparent coord...
sun.h - routines to calculate the Sun's position
Coordinates of a celestial object in the horizon frame, in both rectangular and polar forms.