Sun position
Sun position algorithm
|
Single calculation of the Sun's position
{
double j2kUtc_d;
char azStr[24], elStr[24];
&site);
&site);
printf("Full sun calculation\n");
printf(" Sun Azimuth: %s, Elevation: %s\n", azStr, elStr);
}
#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...
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 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...
#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.
#define SITE_TEMPERATURE_degC
Temperature (degrees Celsius)
#define SITE_LONGITUDE_deg
East lons +ve, west -ve (degrees)
#define SITE_HEIGHT_m
Height above sea level (metres)
double azimuth_rad
azimuth (radian)
#define SITE_LATITUDE_deg
North lats +ve, south -ve (deg)
double timeZone_d
time zone offset from UTC (fraction of a day)
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...
void skyio_printJ2kd(double j2kd)
Write out a J2KD as a calendar date and time.
double elevation_rad
elevation (or altitude) (radian)
Coordinates of a celestial object in the horizon frame, in both rectangular and polar forms.