1.3.49
Loading...
Searching...
No Matches
SolarPosition.h
Go to the documentation of this file.
1
16
#ifndef SOLARPOSITION
17
#define SOLARPOSITION
18
19
#include "
Context.h
"
20
21
class
SolarPosition
{
22
public
:
24
27
explicit
SolarPosition
(
helios::Context
*context_ptr);
28
30
36
SolarPosition
(
float
UTC_hrs,
float
latitude_deg,
float
longitude_deg,
helios::Context
*context_ptr);
37
39
static
int
selfTest
(
int
argc = 0,
char
**argv =
nullptr
);
40
42
[[nodiscard]]
helios::Time
getSunriseTime
()
const
;
43
45
[[nodiscard]]
helios::Time
getSunsetTime
()
const
;
46
48
[[nodiscard]]
float
getSunElevation
()
const
;
49
51
[[nodiscard]]
float
getSunZenith
()
const
;
52
54
[[nodiscard]]
float
getSunAzimuth
()
const
;
55
57
[[nodiscard]]
helios::vec3
getSunDirectionVector
()
const
;
58
60
[[nodiscard]]
helios::SphericalCoord
getSunDirectionSpherical
()
const
;
61
63
66
void
setSunDirection
(
const
helios::SphericalCoord
&sundirection);
67
69
78
[[nodiscard]]
float
getSolarFlux
(
float
pressure_Pa,
float
temperature_K,
float
humidity_rel,
float
turbidity)
const
;
79
81
90
[[nodiscard]]
float
getSolarFluxPAR
(
float
pressure_Pa,
float
temperature_K,
float
humidity_rel,
float
turbidity)
const
;
91
93
102
[[nodiscard]]
float
getSolarFluxNIR
(
float
pressure_Pa,
float
temperature_K,
float
humidity_rel,
float
turbidity)
const
;
103
105
112
[[nodiscard]]
float
getDiffuseFraction
(
float
pressure_Pa,
float
temperature_K,
float
humidity_rel,
float
turbidity)
const
;
113
115
121
[[nodiscard]]
float
getAmbientLongwaveFlux
(
float
temperature_K,
float
humidity_rel)
const
;
122
124
129
[[nodiscard]]
float
calibrateTurbidityFromTimeseries
(
const
std::string ×eries_shortwave_flux_label_Wm2)
const
;
130
132
135
void
enableCloudCalibration
(
const
std::string ×eries_shortwave_flux_label_Wm2);
136
138
void
disableCloudCalibration
();
139
140
private
:
141
helios::Context
*context;
142
143
float
UTC;
144
float
latitude;
145
float
longitude;
146
147
bool
issolarpositionoverridden =
false
;
148
helios::SphericalCoord
sun_direction;
149
150
std::string cloudcalibrationlabel;
151
152
[[nodiscard]]
helios::SphericalCoord
calculateSunDirection(
const
helios::Time
&time,
const
helios::Date
&date)
const
;
153
154
void
GueymardSolarModel(
float
pressure,
float
temperature,
float
humidity,
float
turbidity,
float
&Eb_PAR,
float
&Eb_NIR,
float
&fdiff)
const
;
155
156
void
applyCloudCalibration(
float
&R_calc_Wm2,
float
&fdiff_calc)
const
;
157
158
static
float
turbidityResidualFunction(
float
turbidity, std::vector<float> ¶meters,
const
void
*a_solarpositionmodel);
159
};
160
161
#endif
plugins
solarposition
include
SolarPosition.h
Generated by
1.9.8