DAS
3.1.6 - 18/09/2017
|
#include <math.h>
#include <string.h>
#include <stdio.h>
Go to the source code of this file.
Functions | |
int | S_date (void) |
Returns date. This function calculates the month and day of month, given the day number (number of day in year, sometimes confusingly called the "Julian Day", but I know that you will never call it that). Requires: Year and day number: S_year NOTE: 2-digit year "xx" is assumed "19xx" DEFAULT S_year = 2001 S_daynum RANGE: -1 to a large positive integer . More... | |
int | S_solpos (void) |
Returns ..... This function calculates the apparent solar position and intensity (theoretical maximum solar energy) based on the date, time, and location on Earth. Requires: Date and time: S_year DEFAULT 2001 S_month S_day S_hour DEFAULT 12 S_minute DEFAULT 0 S_second DEFAULT 0 Location: S_latitude S_longitude Location/time adjuster: S_timezone Atmospheric pressure and temperature: S_press DEFAULT 1013.0 mb S_temp DEFAULT 10.0 degrees C Tilt of flat surface that receives solar energy: S_aspect DEFAULT 180 (South) S_tilt DEFAULT 0 (Horizontal) . More... | |
Variables | |
static double | bottom |
static double | c2 |
static double | ca |
static double | cd |
static double | cdcl |
static double | ce |
static double | cecl |
static double | ch |
static double | cl |
static double | cp |
static double | cssha |
static double | ct |
static double | cz |
static double | d2 |
static double | degrad = 57.295779513 |
static double | delta |
static double | elev |
static int | imon |
static int | leap |
static int | lenyr [2] = { 365, 366 } |
static int | month_days [2][13] |
static int | ndy |
static double | p |
static double | prestemp |
static double | raddeg = 0.0174532925 |
static double | refcor |
static double | s2 |
double | S_amass |
O: Relative optical airmass. More... | |
double | S_ampress |
O: Pressure-corrected airmass. More... | |
double | S_aspect = 180.0 |
double | S_azim |
O: Solar azimuth angle: N=0, E=90, S=180, W=270. More... | |
double | S_cosinc |
O: Cosine of solar incidence angle on panel. More... | |
int | S_day = -99 |
I/O: Day of month (May 27 = 27, etc.) I/O: Day of month (May 27 = 27, etc.) S_solpos needs this, but S_date will calculate it from S_daynum. More... | |
double | S_dayang |
T: Day angle (daynum*360/year-length) degrees. More... | |
int | S_daynum = -999 |
I/O: Day number (day of year; Feb 1 = 32 ) I/O: Day number (day of year; Feb 1 = 32 ) S_date needs this, but S_solpos will calculate it from S_month and S_day. More... | |
double | S_declin |
double | S_eclong |
T: Ecliptic longitude, degrees */. More... | |
double | S_ecobli |
T: Obliquity of ecliptic */. More... | |
double | S_ectime |
T: Time of ecliptic calculations */. More... | |
double | S_elevref |
double | S_eqntim |
T: Equation of time (TST - LMT), minutes */. More... | |
double | S_erv |
double | S_etr |
double | S_etrn |
double | S_etrtilt |
double | S_gmst |
T: Greenwich mean sidereal time, hours */. More... | |
int | S_hour = 12 |
I: Hour of day, 0 - 23, DEFAULT = 12 I: Hour of day, 0 - 23, DEFAULT = 12. More... | |
double | S_hrang |
double | S_julday |
double | S_latitude = -99.0 |
I: Latitude, degrees north (south negative) */. More... | |
double | S_lmst |
T: Local mean sidereal time, degrees */. More... | |
double | S_longitude = -999.0 |
I: Longitude, degrees east (west negative) */. More... | |
int | S_minute = 0 |
I: Minute of hour, 0 - 59, DEFAULT = 0 I: Minute of hour, 0 - 59, DEFAULT = 0. More... | |
double | S_mnanom |
T: Mean anomaly, degrees */. More... | |
double | S_mnlong |
T: Mean longitude, degrees */. More... | |
int | S_month = -99 |
I/O: Month number (Jan = 1, Feb = 2, etc.) I/O: Month number (Jan = 1, Feb = 2, etc.) S_solpos needs this, but S_date will calculate it from S_daynum. More... | |
double | S_press = 1013.0 |
double | S_prime |
O: Factor that normalizes Kt, Kn, etc. */. More... | |
double | S_rascen |
T: Right ascension, degrees */. More... | |
double | S_sbcf |
O: Shadow-band correction factor */. More... | |
int | S_second = 0 |
I: Second of minute, 0 - 59, DEFAULT = 0 I: Second of minute, 0 - 59, DEFAULT = 0. More... | |
double | S_solcon = 1367.0 |
T: Solar constant, 1367 W/sq m */. More... | |
double | S_ssha |
T: Sunset(/rise) hour angle, degrees */. More... | |
double | S_sunrise |
double | S_sunset |
double | S_temp = 0.0 |
double | S_tilt = 0.0 |
I: Degrees tilt from horizontal of panel */. More... | |
double | S_timezone = -99.0 |
double | S_tst |
T: True solar time, minutes from midnight */. More... | |
double | S_tstfix |
T: True solar time - local standard time */. More... | |
double | S_unprime |
O: Factor that denormalizes Kt', Kn', etc. */. More... | |
double | S_utime |
T: Universal (Greenwich) standard time */. More... | |
int | S_year = 2001 |
I: 4-digit year (2-digit is assumed 19xx) I: 4-digit year (2-digit is assumed 19xx) DEFAULT = 2001. More... | |
double | S_zenetr |
double | S_zenref |
static double | sa |
static double | sd |
static double | se |
static double | sl |
static double | sp |
static double | st |
static double | sz |
static double | t1 |
static double | t2 |
static double | tanelev |
static double | top |
int S_date | ( | void | ) |
Returns date.
This function calculates the month and day of month, given the day number (number of day in year, sometimes confusingly called the "Julian Day", but I know that you will never call it that).
Requires:
Year and day number:
S_year NOTE: 2-digit year "xx" is assumed "19xx" DEFAULT S_year = 2001
S_daynum RANGE: -1 to a large positive integer
.
Definition at line 166 of file SOLPOS.C.
References imon, leap, lenyr, month_days, ndy, S_day, S_daynum, S_month, and S_year.
Referenced by SZACalc().
int S_solpos | ( | void | ) |
Returns .....
This function calculates the apparent solar position and intensity (theoretical maximum solar energy) based on the date, time, and location on Earth.
Requires:
Date and time:
S_year DEFAULT 2001
S_month
S_day
S_hour DEFAULT 12
S_minute DEFAULT 0
S_second DEFAULT 0
Location:
S_latitude
S_longitude
Location/time adjuster:
S_timezone
Atmospheric pressure and temperature:
S_press DEFAULT 1013.0 mb
S_temp DEFAULT 10.0 degrees C
Tilt of flat surface that receives solar energy:
S_aspect DEFAULT 180 (South)
S_tilt DEFAULT 0 (Horizontal)
.
Definition at line 246 of file SOLPOS.C.
References bottom, c2, ca, cd, cdcl, ce, cecl, ch, cl, cp, cssha, ct, cz, d2, degrad, delta, elev, leap, month_days, p, prestemp, raddeg, refcor, s2, S_amass, S_ampress, S_aspect, S_azim, S_cosinc, S_day, S_dayang, S_daynum, S_declin, S_eclong, S_ecobli, S_ectime, S_elevref, S_eqntim, S_erv, S_etr, S_etrn, S_etrtilt, S_gmst, S_hour, S_hrang, S_julday, S_latitude, S_lmst, S_longitude, S_minute, S_mnanom, S_mnlong, S_month, S_press, S_prime, S_rascen, S_sbcf, S_second, S_solcon, S_ssha, S_sunrise, S_sunset, S_temp, S_tilt, S_timezone, S_tst, S_tstfix, S_unprime, S_utime, S_year, S_zenetr, S_zenref, sa, sd, se, sl, sp, st, sz, t1, t2, tanelev, and top.
Referenced by SZACalc().
|
static |
Definition at line 113 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 114 of file SOLPOS.C.
Referenced by realft(), and S_solpos().
|
static |
Definition at line 115 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 116 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 117 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 118 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 119 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 120 of file SOLPOS.C.
Referenced by DatOrBinFormat(), DXL_ByteHex(), DXL_HexBin(), DXL_TxStr(), FlushCR_EOF(), FlushLine(), ReadHeader_ASCII(), ReadLogFile(), and S_solpos().
|
static |
Definition at line 121 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 122 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 123 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 124 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 125 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 126 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 127 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 129 of file SOLPOS.C.
Referenced by PID_Calc(), and S_solpos().
|
static |
Definition at line 130 of file SOLPOS.C.
Referenced by E_Almucantar(), E_DirectSun(), E_IRefSun(), MIGEActualZenAz(), MIGEAntiSunTrack(), MIGESunTrack(), and S_solpos().
|
static |
Definition at line 103 of file SOLPOS.C.
Referenced by S_date(), and S_solpos().
|
static |
Definition at line 107 of file SOLPOS.C.
Referenced by S_date(), and S_solpos().
|
static |
Definition at line 131 of file SOLPOS.C.
Referenced by CloseColPickCB(), ColorPickCB(), CONFP_opt_page1(), CONFP_opt_page2(), CONFP_opt_page3(), CONFP_opt_page4(), CONFP_param_page1(), D2D_AreaInputTemp(), D_DoLens(), D_PlotTools(), DB_AreaInput(), DXL_RxStr(), E_Radio(), MAPDefPix(), MDCreateColFor_Sh(), MIGEAz(), MIGEZen(), OMU_DoPeltPow(), S_solpos(), spline(), and StepperPagForm().
|
static |
Definition at line 132 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 133 of file SOLPOS.C.
Referenced by D_save_bif(), S_solpos(), and SaveDataOffLine().
|
static |
Definition at line 135 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 136 of file SOLPOS.C.
Referenced by S_solpos().
double S_amass |
double S_ampress |
double S_aspect = 180.0 |
I: Azimuth of panel surface (direction it faces) N=0, E=90, S=180, W=270, DEFAULT = 180
Definition at line 43 of file SOLPOS.C.
Referenced by S_solpos(), and SZACalc().
double S_azim |
O: Solar azimuth angle: N=0, E=90, S=180, W=270.
Definition at line 45 of file SOLPOS.C.
Referenced by D_AutoExecution(), E_Almucantar(), E_DirectSun(), E_IRefSun(), MIGEActualZenAz(), MIGEAntiSunTrack(), MIGEAz(), MIGESunTrack(), S_solpos(), SD_PosAADev(), SZA_FirstCalc(), and Task_Timer().
double S_cosinc |
O: Cosine of solar incidence angle on panel.
Definition at line 46 of file SOLPOS.C.
Referenced by S_solpos().
int S_day = -99 |
I/O: Day of month (May 27 = 27, etc.) I/O: Day of month (May 27 = 27, etc.) S_solpos needs this, but S_date will calculate it from S_daynum.
Definition at line 33 of file SOLPOS.C.
Referenced by S_date(), and S_solpos().
double S_dayang |
T: Day angle (daynum*360/year-length) degrees.
Definition at line 47 of file SOLPOS.C.
Referenced by S_solpos().
int S_daynum = -999 |
I/O: Day number (day of year; Feb 1 = 32 ) I/O: Day number (day of year; Feb 1 = 32 ) S_date needs this, but S_solpos will calculate it from S_month and S_day.
Definition at line 34 of file SOLPOS.C.
Referenced by S_date(), S_solpos(), and SZACalc().
double S_declin |
T: Declination–zenith angle of solar noon at equator, degrees NORTH
Definition at line 48 of file SOLPOS.C.
Referenced by S_solpos().
double S_eclong |
T: Ecliptic longitude, degrees */.
Definition at line 50 of file SOLPOS.C.
Referenced by S_solpos().
double S_ecobli |
double S_ectime |
T: Time of ecliptic calculations */.
Definition at line 52 of file SOLPOS.C.
Referenced by S_solpos().
double S_elevref |
O: Solar elevation angle, deg. from horizon, refracted
Definition at line 53 of file SOLPOS.C.
Referenced by S_solpos().
double S_eqntim |
T: Equation of time (TST - LMT), minutes */.
Definition at line 55 of file SOLPOS.C.
Referenced by S_solpos().
double S_erv |
T: Earth radius vector (multiplied to solar constant)
Definition at line 56 of file SOLPOS.C.
Referenced by S_solpos().
double S_etr |
O: Extraterrestrial (top-of-atmosphere) W/sq m global horizontal solar irradiance
Definition at line 58 of file SOLPOS.C.
Referenced by S_solpos().
double S_etrn |
O: Extraterrestrial (top-of-atmosphere) W/sq m direct normal solar irradiance
Definition at line 60 of file SOLPOS.C.
Referenced by S_solpos().
double S_etrtilt |
O: Extraterrestrial (top-of-atmosphere) W/sq m global irradiance on a tilted surface
Definition at line 62 of file SOLPOS.C.
Referenced by S_solpos().
double S_gmst |
T: Greenwich mean sidereal time, hours */.
Definition at line 64 of file SOLPOS.C.
Referenced by S_solpos().
int S_hour = 12 |
I: Hour of day, 0 - 23, DEFAULT = 12 I: Hour of day, 0 - 23, DEFAULT = 12.
Definition at line 35 of file SOLPOS.C.
Referenced by S_solpos(), and SZACalc().
double S_hrang |
T: Hour angle–hour of sun from solar noon, degrees WEST
Definition at line 65 of file SOLPOS.C.
Referenced by S_solpos().
double S_julday |
T: Julian Day of 1 JAN 2000 minus 2,400,000 days (in order to regain single precision)
Definition at line 67 of file SOLPOS.C.
Referenced by S_solpos().
double S_latitude = -99.0 |
I: Latitude, degrees north (south negative) */.
Definition at line 69 of file SOLPOS.C.
Referenced by S_solpos(), and SZACalc().
double S_lmst |
T: Local mean sidereal time, degrees */.
Definition at line 71 of file SOLPOS.C.
Referenced by S_solpos().
double S_longitude = -999.0 |
I: Longitude, degrees east (west negative) */.
Definition at line 70 of file SOLPOS.C.
Referenced by S_solpos(), and SZACalc().
int S_minute = 0 |
I: Minute of hour, 0 - 59, DEFAULT = 0 I: Minute of hour, 0 - 59, DEFAULT = 0.
Definition at line 36 of file SOLPOS.C.
Referenced by S_solpos(), and SZACalc().
double S_mnanom |
double S_mnlong |
int S_month = -99 |
I/O: Month number (Jan = 1, Feb = 2, etc.) I/O: Month number (Jan = 1, Feb = 2, etc.) S_solpos needs this, but S_date will calculate it from S_daynum.
Definition at line 37 of file SOLPOS.C.
Referenced by S_date(), and S_solpos().
double S_press = 1013.0 |
I: Surface pressure, millibars, used for refraction correction and S_ampress
Definition at line 75 of file SOLPOS.C.
Referenced by S_solpos(), and SZACalc().
double S_prime |
O: Factor that normalizes Kt, Kn, etc. */.
Definition at line 76 of file SOLPOS.C.
Referenced by S_solpos().
double S_rascen |
double S_sbcf |
O: Shadow-band correction factor */.
Definition at line 77 of file SOLPOS.C.
Referenced by S_solpos().
int S_second = 0 |
I: Second of minute, 0 - 59, DEFAULT = 0 I: Second of minute, 0 - 59, DEFAULT = 0.
Definition at line 38 of file SOLPOS.C.
Referenced by S_solpos(), and SZACalc().
double S_solcon = 1367.0 |
T: Solar constant, 1367 W/sq m */.
Definition at line 78 of file SOLPOS.C.
Referenced by S_solpos().
double S_ssha |
T: Sunset(/rise) hour angle, degrees */.
Definition at line 79 of file SOLPOS.C.
Referenced by S_solpos().
double S_sunrise |
O: Sunrise time, minutes from midnight, local, no refraction
Definition at line 80 of file SOLPOS.C.
Referenced by S_solpos(), SZA_FirstCalc(), and Task_Timer().
double S_sunset |
O: Sunset time, minutes from midnight, local, no refraction
Definition at line 82 of file SOLPOS.C.
Referenced by S_solpos(), SZA_FirstCalc(), and Task_Timer().
double S_temp = 0.0 |
I: Ambient dry-bulb temperature, degrees C, used for refraction correction
Definition at line 84 of file SOLPOS.C.
Referenced by S_solpos(), and SZACalc().
double S_tilt = 0.0 |
I: Degrees tilt from horizontal of panel */.
Definition at line 85 of file SOLPOS.C.
Referenced by S_solpos(), and SZACalc().
double S_timezone = -99.0 |
I: Time zone, east (west negative). USA: Mountain = -7, Central = -6, etc.
Definition at line 86 of file SOLPOS.C.
Referenced by S_solpos(), and SZACalc().
double S_tst |
T: True solar time, minutes from midnight */.
Definition at line 88 of file SOLPOS.C.
Referenced by S_solpos().
double S_tstfix |
T: True solar time - local standard time */.
Definition at line 89 of file SOLPOS.C.
Referenced by S_solpos().
double S_unprime |
O: Factor that denormalizes Kt', Kn', etc. */.
Definition at line 90 of file SOLPOS.C.
Referenced by S_solpos().
double S_utime |
T: Universal (Greenwich) standard time */.
Definition at line 91 of file SOLPOS.C.
Referenced by S_solpos().
int S_year = 2001 |
I: 4-digit year (2-digit is assumed 19xx) I: 4-digit year (2-digit is assumed 19xx) DEFAULT = 2001.
Definition at line 39 of file SOLPOS.C.
Referenced by S_date(), S_solpos(), and SZACalc().
double S_zenetr |
T: Solar zenith angle, no atmospheric correction (= ETR)
Definition at line 92 of file SOLPOS.C.
Referenced by AutoRange(), ChkMaster(), D_AutoExecution(), D_BuildH(), D_FixSZA(), D_WaitSZA(), DB_Pause(), E_AAMeasure(), E_Almucantar(), E_DirectSun(), E_IRefSun(), FTP_Back_UP(), HeaderInPlot(), MIGEActualZenAz(), MIGEAntiSunTrack(), MIGESunTrack(), S_solpos(), SZA_FindMin(), SZA_FirstCalc(), Task_CCD_Temp(), Task_LIS_Temp(), and Task_Timer().
double S_zenref |
O: Solar zenith angle, deg. from zenith, refracted
Definition at line 94 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 137 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 138 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 139 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 140 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 141 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 142 of file SOLPOS.C.
Referenced by D_Average(), D_Homing(), D_Positioning(), D_Timing(), DB_GetCCD(), DemoInitMotor(), DXL_RxStr(), HomeAzimFast(), HomeFiltersFast(), HomeGratingFast(), HomeNDFiltersFast(), HomeTrack(), HomeZenithFast(), MDCreateSplashExe(), MDCreateWaitShell(), S_solpos(), SD_PosAADev(), SD_Position(), SD_PosOMUDev(), and Task_HomeGrat().
|
static |
Definition at line 143 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 145 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 146 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 144 of file SOLPOS.C.
Referenced by S_solpos().
|
static |
Definition at line 147 of file SOLPOS.C.
Referenced by S_solpos().