meteo¶
The HydPy-Meteo model family supplies methods for calculating different meteorological factors serving as input to other (hydrological) models.
Method Features¶
- class hydpy.models.meteo.meteo_model.Model[source]¶
Bases:
AdHocModel
The Meteo base model.
- The following “run methods” are called in the given sequence during each simulation step:
Calc_EarthSunDistance_V1
Calculate the relative inverse distance between the earth and the sun according to Allen et al. (1998).Calc_SolarDeclination_V1
Calculate the solar declination according to Allen et al. (1998).Calc_SolarDeclination_V2
Calculate the solar declination according to LEG (2020).Calc_SunsetHourAngle_V1
Calculate the sunset hour angle according to Allen et al. (1998).Calc_SolarTimeAngle_V1
Calculate the solar time angle at the midpoint of the current period according to Allen et al. (1998).Calc_TimeOfSunrise_TimeOfSunset_V1
Calculate the time of sunrise and sunset of the current day according to LEG (2020), based on Thompson et al. (1981).Calc_DailyPossibleSunshineDuration_V1
Calculate the astronomically possible daily sunshine duration.Calc_PossibleSunshineDuration_V1
Calculate the astronomically possible sunshine duration according to Allen et al. (1998).Calc_PossibleSunshineDuration_V2
Calculate the astronomically possible sunshine duration according to LEG (2020).Update_LoggedSunshineDuration_V1
Log the sunshine duration values of the last 24 hours.Calc_DailySunshineDuration_V1
Calculate the sunshine duration sum of the last 24 hours.Update_LoggedGlobalRadiation_V1
Log the global radiation values of the last 24 hours.Calc_DailyGlobalRadiation_V2
Calculate the global radiation sum of the last 24 hours.Calc_ExtraterrestrialRadiation_V1
Calculate the extraterrestrial radiation according to Allen et al. (1998).Calc_ExtraterrestrialRadiation_V2
Calculate the amount of extraterrestrial radiation according to LEG (2020), based on Thompson et al. (1981).Calc_DailySunshineDuration_V2
Calculate the daily sunshine duration reversely toCalc_DailyGlobalRadiation_V1
.Calc_SunshineDuration_V1
Calculate the sunshine duration according to Allen et al. (1998).Calc_PortionDailyRadiation_V1
Calculate the relative sum of radiation according to LEG (2020).Calc_ClearSkySolarRadiation_V1
Calculate the clear sky solar radiation according to Allen et al. (1998).Calc_GlobalRadiation_V1
Calculate the global radiation according to Allen et al. (1998).Calc_UnadjustedGlobalRadiation_V1
Calculate the unadjusted global radiation according to LEG (2020).Calc_UnadjustedSunshineDuration_V1
Calculate the unadjusted sunshine duration reversely toCalc_UnadjustedGlobalRadiation_V1
.Update_LoggedUnadjustedGlobalRadiation_V1
Log the unadjusted global radiation values of the last 24 hours.Update_LoggedUnadjustedSunshineDuration_V1
Log the unadjusted sunshine duration values of the last 24 hours.Calc_DailyGlobalRadiation_V1
Calculate the daily global radiation.Calc_GlobalRadiation_V2
Adjust the current global radiation to the daily global radiation according to LEG (2020).Calc_SunshineDuration_V2
Adjust the current sunshine duration to the daily sunshine duration likeCalc_GlobalRadiation_V2
adjusts the current global radiation to the daily global radiation.
- The following “additional methods” might be called by one or more of the other methods or are meant to be directly called by the user:
Return_DailyGlobalRadiation_V1
Calculate and return the daily global radiation according to LEG (2020).Return_SunshineDuration_V1
Calculate the sunshine duration reversely toReturn_DailyGlobalRadiation_V1
and return it.
- class hydpy.models.meteo.meteo_model.Calc_EarthSunDistance_V1[source]¶
Bases:
Method
Calculate the relative inverse distance between the earth and the sun according to Allen et al. (1998).
- Requires the derived parameter:
- Requires the fixed parameter:
- Calculates the factor sequence:
- Basic equation (Allen et al. (1998), equation 23):
\(EarthSunDistance = 1 + 0.033 \cdot cos(2 \cdot Pi / 366 \cdot (DOY + 1)\)
Note that this equation differs slightly from the one given by Allen et al. (1998). The following examples show that
Calc_EarthSunDistance_V1
calculates the same distance value for a specific “day” (e.g. the 1st March) both for leap years and non-leap years. Hence, there is a tiny “jump” between 28th February and 1st March for non-leap years.Examples:
We define an initialisation period covering both a leap year (2000) and a non-leap year (2001):
>>> from hydpy.models.meteo import * >>> parameterstep() >>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-01", "2002-01-01", "1d" >>> derived.doy.update()
The following convenience function applies method
Calc_EarthSunDistance_V1
for the given dates and prints the results:>>> def test(*dates): ... for date in dates: ... model.idx_sim = pub.timegrids.init[date] ... model.calc_earthsundistance_v1() ... print(date, end=": ") ... round_(factors.earthsundistance.value)
The results are identical for both years:
>>> test("2000-01-01", "2000-02-28", "2000-02-29", ... "2000-03-01", "2000-07-01", "2000-12-31") 2000-01-01: 1.032995 2000-02-28: 1.017471 2000-02-29: 1.016988 2000-03-01: 1.0165 2000-07-01: 0.967 2000-12-31: 1.033
>>> test("2001-01-01", "2001-02-28", ... "2001-03-01", "2001-07-01", "2001-12-31") 2001-01-01: 1.032995 2001-02-28: 1.017471 2001-03-01: 1.0165 2001-07-01: 0.967 2001-12-31: 1.033
The following calculation agrees with example 8 of Allen et al. (1998):
>>> derived.doy(246) >>> model.idx_sim = 0 >>> model.calc_earthsundistance_v1() >>> factors.earthsundistance earthsundistance(0.984993)
- class hydpy.models.meteo.meteo_model.Calc_SolarDeclination_V1[source]¶
Bases:
Method
Calculate the solar declination according to Allen et al. (1998).
- Requires the derived parameter:
- Requires the fixed parameter:
- Calculates the factor sequence:
- Basic equation (Allen et al. (1998), equation 24):
\(SolarDeclination = 0.409 \cdot sin(2 \cdot Pi / 366 \cdot (DOY + 1) - 1.39)\)
Note that this equation differs slightly from the one given by Allen et al. (1998) due to reasons explained in the documentation on method
Calc_EarthSunDistance_V1
.Examples:
We define an initialisation period covering both a leap year (2000) and a non-leap year (2001):
>>> from hydpy.models.meteo import * >>> parameterstep() >>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-01", "2002-01-01", "1d" >>> derived.doy.update()
The following convenience function applies method
Calc_SolarDeclination_V1
for the given dates and prints the results:>>> def test(*dates): ... for date in dates: ... model.idx_sim = pub.timegrids.init[date] ... model.calc_solardeclination_v1() ... print(date, end=": ") ... round_(factors.solardeclination.value)
The results are identical for both years:
>>> test("2000-01-01", "2000-02-28", "2000-02-29", ... "2000-03-01", "2000-12-31") 2000-01-01: -0.401012 2000-02-28: -0.150618 2000-02-29: -0.144069 2000-03-01: -0.137476 2000-12-31: -0.402334
>>> test("2001-01-01", "2001-02-28", ... "2001-03-01", "2001-12-31") 2001-01-01: -0.401012 2001-02-28: -0.150618 2001-03-01: -0.137476 2001-12-31: -0.402334
The following calculation agrees with example 8 of Allen et al. (1998):
>>> derived.doy(246) >>> model.idx_sim = 0 >>> model.calc_solardeclination_v1() >>> factors.solardeclination solardeclination(0.117464)
- class hydpy.models.meteo.meteo_model.Calc_SolarDeclination_V2[source]¶
Bases:
Method
Calculate the solar declination according to LEG (2020).
- Requires the derived parameter:
- Requires the fixed parameter:
- Calculates the factor sequence:
- Basic equation:
\(SolarDeclination = 0.41 \cdot cos \left( \frac{2 \cdot Pi \cdot (DOY - 171)}{365} \right)\)
Examples:
We define an initialisation period covering both a leap year (2000) and a non-leap year (2001):
>>> from hydpy.models.meteo import * >>> parameterstep() >>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-01", "2002-01-01", "1d" >>> derived.doy.update()
The following convenience function applies method
Calc_SolarDeclination_V2
for the given dates and prints the results:>>> def test(*dates): ... for date in dates: ... model.idx_sim = pub.timegrids.init[date] ... model.calc_solardeclination_v2() ... print(date, end=": ") ... round_(factors.solardeclination.value)
The results are identical for both years:
>>> test("2000-01-01", "2000-02-28", "2000-02-29", ... "2000-03-01", "2000-12-31") 2000-01-01: -0.401992 2000-02-28: -0.149946 2000-02-29: -0.143355 2000-03-01: -0.136722 2000-12-31: -0.401992
>>> test("2001-01-01", "2001-02-28", ... "2001-03-01", "2001-12-31") 2001-01-01: -0.401992 2001-02-28: -0.149946 2001-03-01: -0.136722 2001-12-31: -0.401992
- class hydpy.models.meteo.meteo_model.Calc_SunsetHourAngle_V1[source]¶
Bases:
Method
Calculate the sunset hour angle according to Allen et al. (1998).
- Requires the derived parameter:
- Requires the factor sequence:
- Calculates the factor sequence:
- Basic equation (Allen et al. (1998), equation 25):
\(SunsetHourAngle = arccos(-tan(LatitudeRad) \cdot tan(SolarDeclination))\)
Example:
The following calculation agrees with example 8 of Allen et al. (1998):
>>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.doy.shape = 1 >>> derived.doy(246) >>> derived.latituderad(-.35) >>> factors.solardeclination = 0.12 >>> model.calc_sunsethourangle_v1() >>> factors.sunsethourangle sunsethourangle(1.526767)
- class hydpy.models.meteo.meteo_model.Calc_SolarTimeAngle_V1[source]¶
Bases:
Method
Calculate the solar time angle at the midpoint of the current period according to Allen et al. (1998).
- Requires the control parameter:
- Requires the derived parameters:
- Requires the fixed parameter:
- Calculates the factor sequence:
- Basic equations (Allen et al. (1998), equations 31 to 33):
\(SolarTimeAngle = Pi / 12 \cdot ((SCT + (Longitude - UTCLongitude) / 15 + S_c) - 12)\)
\(S_c = 0.1645 \cdot sin(2 \cdot b) - 0.1255 \cdot cos(b) - 0.025 \cdot sin(b)\)
\(b = (2 \cdot Pi \cdot (DOY - 80)) / 365\)
Note there are two slight deviations from the equations given by Allen et al. (1998). The first one is that positive numbers correspond to longitudes east of Greenwich and negative numbers to longitudes west of Greenwich. The second one is due to the definition of parameter
DOY
, as explained in the documentation on methodCalc_EarthSunDistance_V1
.Examples:
>>> from hydpy import pub, round_ >>> pub.timegrids = "2000-09-03", "2000-09-04", "1h" >>> from hydpy.models.meteo import * >>> parameterstep() >>> longitude(15) >>> derived.doy.update() >>> derived.sct.update() >>> derived.utclongitude.update() >>> for hour in range(24): ... model.idx_sim = hour ... model.calc_solartimeangle_v1() ... print(hour, end=": ") ... round_(factors.solartimeangle.value) 0: -3.004157 1: -2.742358 ... 11: -0.124364 12: 0.137435 ... 22: 2.755429 23: 3.017229
- class hydpy.models.meteo.meteo_model.Calc_TimeOfSunrise_TimeOfSunset_V1[source]¶
Bases:
Method
Calculate the time of sunrise and sunset of the current day according to LEG (2020), based on Thompson et al. (1981).
- Requires the control parameter:
- Requires the derived parameters:
- Requires the fixed parameter:
- Requires the factor sequence:
- Calculates the factor sequences:
- Basic equations:
\(TimeOfSunset^* = \frac{12}{Pi} \cdot acos \left( tan(SolarDeclination) \cdot tan(LatitudeRad) + \frac{0.0145}{cos(SolarDeclination) \cdot cos(LatitudeRad)} \right)\)
\(\delta = \frac{4 \cdot (UTCLongitude - Longitude)}{60}\)
\(TimeOfSunset = TimeOfSunset^* + \delta\)
\(TimeOfSunset = 24 - TimeOfSunset^* + \delta\)
Examples:
We calculate the local time of sunrise and sunset for a latitude of approximately 52°N and a longitude of 10°E, which is 5° west of the longitude that defines the local time zone:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> longitude(10.0) >>> derived.utclongitude(15.0) >>> derived.latituderad(0.9)
The sunshine duration varies between seven hours at the winter solstice and 16 hours at the summer solstice:
>>> factors.solardeclination = -0.41 >>> model.calc_timeofsunrise_timeofsunset_v1() >>> factors.timeofsunrise timeofsunrise(8.432308) >>> factors.timeofsunset timeofsunset(16.234359) >>> factors.solardeclination = 0.41 >>> model.calc_timeofsunrise_timeofsunset_v1() >>> factors.timeofsunrise timeofsunrise(4.002041) >>> factors.timeofsunset timeofsunset(20.664625)
- class hydpy.models.meteo.meteo_model.Calc_ExtraterrestrialRadiation_V1[source]¶
Bases:
Method
Calculate the extraterrestrial radiation according to Allen et al. (1998).
- Requires the derived parameters:
- Requires the fixed parameters:
- Requires the factor sequences:
SolarTimeAngle
EarthSunDistance
SolarDeclination
SunsetHourAngle
- Calculates the flux sequence:
- Basic equation for daily simulation steps (Allen et al. (1998), equation 21):
\(ExternalTerrestrialRadiation = \frac{SolarConstant}{Pi} \cdot EarthSunDistance \cdot ( SunsetHourAngle \cdot sin(LatitudeRad) \cdot sin(SolarDeclination) + cos(LatitudeRad) \cdot cos(SolarDeclination) \cdot sin(SunsetHourAngle))\)
- Basic equation for (sub)hourly steps (Allen et al. (1998), eq. 28 to 30):
\(ExternalTerrestrialRadiation = \frac{12 \cdot SolarConstant}{Pi} \cdot EarthSunDistance \cdot \Big( (\omega_2 - \omega_1) \cdot sin(LatitudeRad) \cdot sin(SolarDeclination) + cos(LatitudeRad) \cdot cos(SolarDeclination) \cdot (sin(\omega_2) - sin(\omega_1)) \Big)\)
\(\omega_1 = SolarTimeAngle - Pi \cdot Days\)
\(\omega_2 = SolarTimeAngle + Pi \cdot Days\)
Examples:
The following calculation agrees with example 8 of Allen et al. (1998) for daily time steps:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.days(1) >>> derived.latituderad(-0.35) >>> factors.earthsundistance = 0.985 >>> factors.solardeclination = 0.12 >>> factors.sunsethourangle = 1.527 >>> model.calc_extraterrestrialradiation_v1() >>> fluxes.extraterrestrialradiation extraterrestrialradiation(372.473355)
The following calculation repeats the above example for an hourly simulation time step, still covering the whole day:
>>> import numpy >>> longitude(-20) >>> derived.utclongitude(-20) >>> derived.days(1/24) >>> derived.doy.shape = 24 >>> derived.doy(246) >>> derived.sct.shape = 24 >>> derived.sct = numpy.linspace(0.5, 23.5, 24) >>> sum_ = 0.0 >>> from hydpy import round_ >>> for hour in range(24): ... model.idx_sim = hour ... model.calc_solartimeangle_v1() ... model.calc_extraterrestrialradiation_v1() ... print(hour, end=": ") ... round_(fluxes.extraterrestrialradiation.value) ... sum_ += fluxes.extraterrestrialradiation 0: 0.0 1: 0.0 2: 0.0 3: 0.0 4: 0.0 5: 0.0 6: 116.280258 7: 431.467206 8: 713.483659 9: 943.11066 10: 1104.699509 11: 1187.238194 12: 1185.101838 13: 1098.436032 14: 933.146907 15: 700.498642 16: 416.345834 17: 100.053027 18: 0.0 19: 0.0 20: 0.0 21: 0.0 22: 0.0 23: 0.0
Note that, even with identical values of the local longitude (
Longitude
) and the one of the time zone (UTCLongitude
), the calculated radiation values are not symmetrical due to the eccentricity of the Earth”s orbit (see solar time).There is a slight deviation between the directly calculated daily value and the mean of the hourly values:
>>> round_(sum_/24) 372.077574
For sub-daily simulation time steps, results are most accurate for the shortest step size. On the other hand, they can be (extremely) inaccurate for timesteps between one hour and one day. We demonstrate this by comparing the mean sub-daily values of different step sizes with the directly calculated daily value (note the apparent total fail of method
Calc_ExtraterrestrialRadiation_V1
for a step size of 720 minutes):>>> for minutes in [1, 5, 15, 30, 60, 90, 120, 144, 160, ... 180, 240, 288, 360, 480, 720, 1440]: ... derived.days(minutes/60/24) ... nmb = int(1440/minutes) ... derived.doy.shape = nmb ... derived.doy(246) ... derived.sct.shape = nmb ... derived.sct = numpy.linspace(minutes/60/2, 24-minutes/60/2, nmb) ... sum_ = 0.0 ... for idx in range(nmb): ... model.idx_sim = idx ... model.calc_solartimeangle_v1() ... model.calc_extraterrestrialradiation_v1() ... sum_ += fluxes.extraterrestrialradiation ... print(minutes, end=": ") ... round_(sum_/24 - 372.473355) 1: -0.000626 5: -0.008549 15: -0.100092 30: -0.395781 60: -0.395781 90: -0.395781 120: -0.395781 144: -14.43193 160: -9.539017 180: -0.395781 240: -44.735212 288: -25.486399 360: -0.395781 480: -44.735212 720: -372.473355 1440: -356.953632
- class hydpy.models.meteo.meteo_model.Calc_ExtraterrestrialRadiation_V2[source]¶
Bases:
Method
Calculate the amount of extraterrestrial radiation according to LEG (2020), based on Thompson et al. (1981).
- Requires the derived parameter:
- Requires the fixed parameters:
- Requires the factor sequences:
SolarDeclination
EarthSunDistance
TimeOfSunrise
TimeOfSunset
- Calculates the flux sequence:
- Basic equation:
\(ExternalTerrestrialRadiation = \frac{SolarConstant \cdot EarthSunDistance \cdot ( SunsetHourAngle \cdot sin(LatitudeRad) \cdot sin(SolarDeclination) + cos(LatitudeRad) \cdot cos(SolarDeclination) \cdot sin(SunsetHourAngle) )}{PI}\)
\(SunsetHourAngle = (TimeOfSunset - TimeOfSunset) \cdot Pi / 24\)
Examples:
First, we calculate the extraterrestrial radiation for a latitude of approximately 52°N:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.latituderad(0.9)
The sunshine duration varies between seven hours at the winter solstice and 16 hours at summer solstice, corresponding to mean daily radiations of 70 and 514 W/m².
>>> factors.solardeclination = -0.41 >>> factors.earthsundistance = 0.97 >>> factors.timeofsunrise = 8.4 >>> factors.timeofsunset = 15.6 >>> model.calc_extraterrestrialradiation_v2() >>> fluxes.extraterrestrialradiation extraterrestrialradiation(70.458396)
>>> factors.solardeclination = 0.41 >>> factors.earthsundistance = 1.03 >>> factors.timeofsunrise = 4.0 >>> factors.timeofsunset = 20.0 >>> model.calc_extraterrestrialradiation_v2() >>> fluxes.extraterrestrialradiation extraterrestrialradiation(514.367012)
- class hydpy.models.meteo.meteo_model.Calc_PossibleSunshineDuration_V1[source]¶
Bases:
Method
Calculate the astronomically possible sunshine duration according to Allen et al. (1998).
- Requires the derived parameters:
- Requires the fixed parameter:
- Requires the factor sequences:
- Calculates the factor sequence:
- Basic equation for daily timesteps Allen et al. (1998) (equation 34):
\(PossibleSunshineDuration = 24 / Pi \cdot SunsetHourAngle\)
- Basic equation for (sub)hourly timesteps:
\(PossibleSunshineDuration = min(max(12 / Pi \cdot (SunsetHourAngle - \tau), 0), Hours)\)
\[\begin{split}\tau = \begin{cases} -SolarTimeAngle - Pi \cdot Days &|\ SolarTimeAngle \leq 0 \\ SolarTimeAngle - Pi \cdot Days &|\ SolarTimeAngle > 0 \end{cases}\end{split}\]
Examples:
The following calculation agrees with example 9 of Allen et al. (1998):
>>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.days(1) >>> derived.hours(24) >>> factors.sunsethourangle(1.527) >>> model.calc_possiblesunshineduration_v1() >>> factors.possiblesunshineduration possiblesunshineduration(11.665421)
The following calculation repeats the above example for an hourly simulation time step, still covering the whole day. Therefore the ratio is only calculated during sunrise and sunset and set to 1 at daytime and 0 at nighttime:
>>> from hydpy import round_ >>> import numpy >>> derived.days(1/24) >>> derived.hours(1) >>> solartimeangles = numpy.linspace(-3.004157, 3.017229, 24) >>> sum_ = 0. >>> for hour, solartimeangle in enumerate(solartimeangles): ... factors.solartimeangle = solartimeangle ... model.calc_possiblesunshineduration_v1() ... print(hour, end=": ") ... round_(factors.possiblesunshineduration.value) ... sum_ += factors.possiblesunshineduration.value 0: 0.0 ... 5: 0.0 6: 0.857676 7: 1.0 ... 16: 1.0 17: 0.807745 18: 0.0 ... 23: 0.0
The sum of the hourly sunshine durations equals the one-step calculation result:
>>> round_(sum_) 11.665421
- class hydpy.models.meteo.meteo_model.Calc_PossibleSunshineDuration_V2[source]¶
Bases:
Method
Calculate the astronomically possible sunshine duration according to LEG (2020).
- Requires the derived parameters:
- Requires the factor sequences:
- Calculates the factor sequence:
- Basic equation:
\(PossibleSunshineDuration = max \bigl( max(SCT-Hours/2, TimeOfSunrise) - min(SCT + Hours / 2, TimeOfSunset), 0 \bigr)\)
Examples:
We focus on winter conditions with a relatively short possible sunshine duration:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> factors.timeofsunrise(8.4) >>> factors.timeofsunset(15.6)
We start with a daily simulation time step. The possible sunshine duration is, as expected, the span between sunrise and sunset:
>>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-01", "2000-01-02", "1d" >>> derived.sct.update() >>> derived.hours.update() >>> model.calc_possiblesunshineduration_v2() >>> factors.possiblesunshineduration possiblesunshineduration(7.2)
The following example calculates the possible hourly sunshine durations of the same day:
>>> pub.timegrids = "2000-01-01", "2000-01-02", "1h" >>> derived.sct.update() >>> derived.hours.update() >>> sum_ = 0.0 >>> for idx in range(24): ... model.idx_sim = idx ... model.calc_possiblesunshineduration_v2() ... print(idx+1, end=": ") ... round_(factors.possiblesunshineduration.value) ... sum_ += factors.possiblesunshineduration.value 1: 0.0 ... 9: 0.6 10: 1.0 ... 15: 1.0 16: 0.6 17: 0.0 ... 24: 0.0
The sum of the possible hourly sunshine durations equals the daily possible sunshine, of course:
>>> round_(sum_) 7.2
- class hydpy.models.meteo.meteo_model.Calc_DailyPossibleSunshineDuration_V1[source]¶
Bases:
Method
Calculate the astronomically possible daily sunshine duration.
- Requires the factor sequences:
- Calculates the factor sequence:
- Basic equation:
\(DailyPossibleSunshineDuration = TimeOfSunset - TimeOfSunrise\)
Examples:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> factors.timeofsunrise(8.4) >>> factors.timeofsunset(15.6) >>> model.calc_dailypossiblesunshineduration() >>> factors.dailypossiblesunshineduration dailypossiblesunshineduration(7.2)
- class hydpy.models.meteo.meteo_model.Update_LoggedSunshineDuration_V1[source]¶
Bases:
Method
Log the sunshine duration values of the last 24 hours.
- Requires the derived parameter:
- Requires the input sequence:
- Updates the log sequence:
Example:
The following example shows that each new method call successively moves the three memorised values to the right and stores the respective new value on the most left position:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.nmblogentries(3) >>> logs.loggedsunshineduration.shape = 3 >>> logs.loggedsunshineduration = 0.0 >>> from hydpy import UnitTest >>> test = UnitTest(model, ... model.update_loggedsunshineduration_v1, ... last_example=4, ... parseqs=(inputs.sunshineduration, ... logs.loggedsunshineduration)) >>> test.nexts.sunshineduration = 1.0, 3.0, 2.0, 4.0 >>> del test.inits.loggedsunshineduration >>> test() | ex. | sunshineduration | loggedsunshineduration | ------------------------------------------------------------- | 1 | 1.0 | 1.0 0.0 0.0 | | 2 | 3.0 | 3.0 1.0 0.0 | | 3 | 2.0 | 2.0 3.0 1.0 | | 4 | 4.0 | 4.0 2.0 3.0 |
- class hydpy.models.meteo.meteo_model.Update_LoggedGlobalRadiation_V1[source]¶
Bases:
Method
Log the global radiation values of the last 24 hours.
- Requires the derived parameter:
- Requires the input sequence:
- Updates the log sequence:
Example:
The following example shows that each new method call successively moves the three memorised values to the right and stores the respective new value on the most left position:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.nmblogentries(3) >>> logs.loggedglobalradiation.shape = 3 >>> logs.loggedglobalradiation = 0.0 >>> from hydpy import UnitTest >>> test = UnitTest(model, ... model.update_loggedglobalradiation_v1, ... last_example=4, ... parseqs=(inputs.globalradiation, ... logs.loggedglobalradiation)) >>> test.nexts.globalradiation = 1.0, 3.0, 2.0, 4.0 >>> del test.inits.loggedglobalradiation >>> test() | ex. | globalradiation | loggedglobalradiation | ----------------------------------------------------------- | 1 | 1.0 | 1.0 0.0 0.0 | | 2 | 3.0 | 3.0 1.0 0.0 | | 3 | 2.0 | 2.0 3.0 1.0 | | 4 | 4.0 | 4.0 2.0 3.0 |
- class hydpy.models.meteo.meteo_model.Calc_DailySunshineDuration_V1[source]¶
Bases:
Method
Calculate the sunshine duration sum of the last 24 hours.
- Requires the derived parameter:
- Requires the log sequence:
- Updates the factor sequence:
Example:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.nmblogentries(3) >>> logs.loggedsunshineduration.shape = 3 >>> logs.loggedsunshineduration = 1.0, 5.0, 3.0 >>> model.calc_dailysunshineduration_v1() >>> factors.dailysunshineduration dailysunshineduration(9.0)
- class hydpy.models.meteo.meteo_model.Calc_DailyGlobalRadiation_V2[source]¶
Bases:
Method
Calculate the global radiation sum of the last 24 hours.
- Requires the derived parameter:
- Requires the log sequence:
- Updates the flux sequence:
Example:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.nmblogentries(3) >>> logs.loggedglobalradiation.shape = 3 >>> logs.loggedglobalradiation = 100.0, 800.0, 600.0 >>> model.calc_dailyglobalradiation_v2() >>> fluxes.dailyglobalradiation dailyglobalradiation(500.0)
- class hydpy.models.meteo.meteo_model.Calc_PortionDailyRadiation_V1[source]¶
Bases:
Method
Calculate the relative sum of radiation according to LEG (2020).
- Requires the derived parameters:
- Requires the fixed parameter:
- Requires the factor sequences:
- Calculates the factor sequence:
Basic equations:
\[SP = S_P^*(SCT + Hours/2) - S_P^*(SCT - Hours/2)\]\[\begin{split}S_P^*(t) = \begin{cases} 0 &|\ TL_P(t) \leq 0 \\ 50 - 50 \cdot cos\bigl(1.8 \cdot TL_P(t)\bigr) - 3.4 \cdot sin\bigl(3.6 \cdot TL_P(t)\bigr)^2 &|\ 0 < TL_P(t) \leq 50 \cdot \frac{2 \cdot Pi}{360} \\ 50 - 50 \cdot cos\bigl(1.8 \cdot TL_P(t)\bigr) + 3.4 \cdot sin\bigl(3.6 \cdot TL_P(t)\bigr)^2 &|\ 50 \cdot \frac{2 \cdot Pi}{360} < TL_P(t) < 100 \cdot \frac{2 \cdot Pi}{360} \\ 100 &|\ 100 \cdot \frac{2 \cdot Pi}{360} \leq TL_P(t) \end{cases}\end{split}\]\[TL_P(t) = 100 \cdot \frac{2 \cdot Pi}{360} \cdot \frac{t - TimeOfSunrise}{TimeOfSunset - TimeOfSunrise}\]Examples:
We focus on winter conditions with a relatively short possible sunshine duration:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> factors.timeofsunrise(8.4) >>> factors.timeofsunset(15.6)
We start with an hourly simulation time step. The relative radiation sum is, as expected, zero before sunrise and after sunset. In between, it reaches its maximum around noon:
>>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-01", "2000-01-02", "1h" >>> derived.sct.update() >>> derived.hours.update() >>> for idx in range(7, 17): ... model.idx_sim = idx ... model.calc_portiondailyradiation_v1() ... print(idx+1, end=": ") ... round_(factors.portiondailyradiation.value) 8: 0.0 9: 0.853709 10: 7.546592 11: 18.473585 12: 23.126115 13: 23.126115 14: 18.473585 15: 7.546592 16: 0.853709 17: 0.0
The following examples show how method
Calc_PortionDailyRadiation_V1
works for time step sizes longer than one hour:>>> pub.timegrids = "2000-01-01", "2000-01-02", "1d" >>> derived.sct.update() >>> derived.hours.update() >>> model.idx_sim = 0 >>> model.calc_portiondailyradiation_v1() >>> factors.portiondailyradiation portiondailyradiation(100.0)
>>> pub.timegrids = "2000-01-01", "2000-01-02", "6h" >>> derived.sct.update() >>> derived.hours.update() >>> for idx in range(4): ... model.idx_sim = idx ... model.calc_portiondailyradiation_v1() ... print((idx+1)*6, end=": ") ... round_(factors.portiondailyradiation.value) 6: 0.0 12: 50.0 18: 50.0 24: 0.0
>>> pub.timegrids = "2000-01-01", "2000-01-02", "3h" >>> derived.sct.update() >>> derived.hours.update() >>> for idx in range(8): ... model.idx_sim = idx ... model.calc_portiondailyradiation_v1() ... print((idx+1)*3, end=": ") ... round_(factors.portiondailyradiation.value) 3: 0.0 6: 0.0 9: 0.853709 12: 49.146291 15: 49.146291 18: 0.853709 21: 0.0 24: 0.0
Often, method
Calc_PortionDailyRadiation_V1
calculates a small but unrealistic “bump” around noon (for example, the relative radiation is slightly smaller between 11:30 and 12:00 than it is between 11:00 and 11:30):>>> pub.timegrids = "2000-01-01", "2000-01-02", "30m" >>> derived.sct.update() >>> derived.hours.update() >>> for idx in range(15, 33): ... model.idx_sim = idx ... model.calc_portiondailyradiation_v1() ... print((idx+1)/2, end=": ") ... round_(factors.portiondailyradiation.value) 8.0: 0.0 8.5: 0.021762 9.0: 0.831947 9.5: 2.514315 10.0: 5.032276 10.5: 7.989385 11.0: 10.4842 11.5: 11.696873 12.0: 11.429242 12.5: 11.429242 13.0: 11.696873 13.5: 10.4842 14.0: 7.989385 14.5: 5.032276 15.0: 2.514315 15.5: 0.831947 16.0: 0.021762 16.5: 0.0
- class hydpy.models.meteo.meteo_model.Return_DailyGlobalRadiation_V1[source]¶
Bases:
Method
Calculate and return the daily global radiation according to LEG (2020).
- Required by the methods:
Calc_DailyGlobalRadiation_V1
Calc_UnadjustedGlobalRadiation_V1
- Requires the control parameters:
- Requires the derived parameters:
- Requires the flux sequence:
- Additional requirements:
- Basic equation:
- \[\begin{split}ExtraterrestrialRadiation \cdot \begin{cases} AngstromConstant + AngstromFactor \cdot \frac{sunshineduration}{possiblesunshineduration} &|\ sunshineduration > 0 \;\; \lor \;\; Days < 1 \\ AngstromAlternative &|\ sunshineduration = 0 \;\; \land \;\; Days \geq 1 \end{cases}\end{split}\]
Example:
You can define month-specific Angstrom coefficients to reflect the annual variability in the relationship between sunshine duration and global radiation. First, we demonstrate this on a daily timestep basis:
>>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-30", "2000-02-03", "1d" >>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.moy.update() >>> derived.days.update() >>> angstromconstant.jan = 0.1 >>> angstromfactor.jan = 0.5 >>> angstromalternative.jan = 0.2 >>> angstromconstant.feb = 0.2 >>> angstromfactor.feb = 0.6 >>> angstromalternative.feb = 0.3 >>> fluxes.extraterrestrialradiation = 340.0 >>> model.idx_sim = 1 >>> round_(model.return_dailyglobalradiation_v1(0.6, 1.0)) 136.0 >>> model.idx_sim = 2 >>> round_(model.return_dailyglobalradiation_v1(0.6, 1.0)) 190.4
If the possible sunshine duration is zero, we generally set global radiation to zero (even if the actual sunshine duration is larger than zero, which might occur as a result of inconsistencies between measured and calculated input data):
>>> round_(model.return_dailyglobalradiation_v1(0.6, 0.0)) 0.0
When actual sunshine is zero, the alternative Ångström coefficient applies:
>>> model.idx_sim = 1 >>> round_(model.return_dailyglobalradiation_v1(0.0, 1.0)) 68.0 >>> model.idx_sim = 2 >>> round_(model.return_dailyglobalradiation_v1(0.0, 1.0)) 102.0
All of the examples and explanations above hold for short simulation timesteps, except that
AngstromAlternative
never replacesAngstromConstant
:>>> pub.timegrids = "2000-01-30", "2000-02-03", "1h" >>> derived.moy.update() >>> derived.days.update() >>> model.idx_sim = 1 >>> round_(model.return_dailyglobalradiation_v1(0.0, 1.0)) 34.0
- class hydpy.models.meteo.meteo_model.Calc_ClearSkySolarRadiation_V1[source]¶
Bases:
Method
Calculate the clear sky solar radiation according to Allen et al. (1998).
- Requires the control parameters:
- Requires the derived parameter:
- Requires the flux sequence:
- Calculates the flux sequence:
- Basic equation (:cite:t`ref-Allen1998`, eq. 35):
\(ClearSkySolarRadiation = ExtraterrestrialRadiation \cdot (AngstromConstant + AngstromFactor)\)
Example:
We use the Ångström coefficients (a=0.19, b=0.55) recommended for Germany by DVWK-M 504 DVWK (2002) for January and the default values (a=0.25, b=0.5) for February:
>>> from hydpy import pub >>> pub.timegrids = "2000-01-30", "2000-02-03", "1d" >>> from hydpy.models.meteo import * >>> parameterstep() >>> angstromconstant.jan = 0.19 >>> angstromfactor.jan = 0.55 >>> angstromconstant.feb = 0.25 >>> angstromfactor.feb = 0.5 >>> derived.moy.update() >>> fluxes.extraterrestrialradiation = 200.0 >>> model.idx_sim = 1 >>> model.calc_clearskysolarradiation_v1() >>> fluxes.clearskysolarradiation clearskysolarradiation(148.0) >>> model.idx_sim = 2 >>> model.calc_clearskysolarradiation_v1() >>> fluxes.clearskysolarradiation clearskysolarradiation(150.0)
- class hydpy.models.meteo.meteo_model.Calc_GlobalRadiation_V1[source]¶
Bases:
Method
Calculate the global radiation according to Allen et al. (1998).
- Requires the control parameters:
- Requires the derived parameter:
- Requires the input sequence:
- Requires the factor sequence:
- Requires the flux sequence:
- Calculates the flux sequence:
- Basic equation (Allen et al. (1998), equation 35):
\(GlobalRadiation = ExtraterrestrialRadiation \cdot (AngstromConstant + AngstromFactor \cdot SunshineDuration / PossibleSunshineDuration)\)
Example:
We use the Ångström coefficients (a=0.19, b=0.55) recommended for Germany by DVWK-M 504 DVWK (2002) for January and the default values (a=0.25, b=0.5) for February:
>>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-30", "2000-02-03", "1d" >>> from hydpy.models.meteo import * >>> parameterstep() >>> angstromconstant.jan = 0.19 >>> angstromfactor.jan = 0.55 >>> angstromconstant.feb = 0.25 >>> angstromfactor.feb = 0.5 >>> derived.moy.update() >>> inputs.sunshineduration = 12.0 >>> factors.possiblesunshineduration = 14.0 >>> fluxes.extraterrestrialradiation = 200.0 >>> model.idx_sim = 1 >>> model.calc_globalradiation_v1() >>> fluxes.globalradiation globalradiation(132.285714) >>> model.idx_sim = 2 >>> model.calc_globalradiation_v1() >>> fluxes.globalradiation globalradiation(135.714286)
For zero possible sunshine durations,
Calc_GlobalRadiation_V1
setsGlobalRadiation
to zero:>>> factors.possiblesunshineduration = 0.0 >>> model.calc_globalradiation_v1() >>> fluxes.globalradiation globalradiation(0.0)
- class hydpy.models.meteo.meteo_model.Calc_UnadjustedGlobalRadiation_V1[source]¶
Bases:
Method
Calculate the unadjusted global radiation according to LEG (2020).
- Required submethod:
- Requires the control parameters:
- Requires the derived parameters:
- Requires the input sequence:
- Requires the factor sequences:
PossibleSunshineDuration
DailySunshineDuration
DailyPossibleSunshineDuration
PortionDailyRadiation
- Requires the flux sequence:
- Calculates the flux sequence:
- Additional requirements:
- Basic equation:
- \[\begin{split}UnadjustedGlobalRadiation = NmbLogEntries \cdot \frac{SP}{100} \cdot \begin{cases} Return\_DailyGlobalRadiation\_V1( SunshineDuration, PossibleSunshineDuration) &|\ PossibleSunshineDuration > 0 \\ Return\_DailyGlobalRadiation\_V1( DailySunshineDuration, DailyPossibleSunshineDuration) &|\ PossibleSunshineDuration = 0 \end{cases}\end{split}\]
Examples:
Method
Calc_UnadjustedGlobalRadiation_V1
uses the actual value ofPortionDailyRadiation
and methodReturn_DailyGlobalRadiation_V1
to calculate global radiation according to the current values ofSunshineDuration
andPossibleSunshineDuration
:>>> from hydpy import pub >>> pub.timegrids = "2000-01-31", "2000-02-02", "6h" >>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.nmblogentries.update() >>> derived.moy.update() >>> derived.days.update() >>> angstromconstant.jan = 0.1 >>> angstromfactor.jan = 0.5 >>> angstromalternative.jan = 0.2 >>> inputs.sunshineduration = 0.6 >>> factors.possiblesunshineduration = 1.0 >>> fluxes.extraterrestrialradiation = 340.0 >>> factors.portiondailyradiation = 50.0 >>> model.idx_sim = 3 >>> model.calc_unadjustedglobalradiation_v1() >>> fluxes.unadjustedglobalradiation unadjustedglobalradiation(272.0)
During nighttime periods, the value of
PossibleSunshineDuration
is zero. Then,Calc_GlobalRadiation_V1
uses the values ofDailySunshineDuration
andDailyPossibleSunshineDuration
as surrogates:>>> factors.possiblesunshineduration = 0.0 >>> factors.dailysunshineduration = 4.0 >>> factors.dailypossiblesunshineduration = 10.0 >>> model.calc_unadjustedglobalradiation_v1() >>> fluxes.unadjustedglobalradiation unadjustedglobalradiation(204.0)
- class hydpy.models.meteo.meteo_model.Update_LoggedUnadjustedGlobalRadiation_V1[source]¶
Bases:
Method
Log the unadjusted global radiation values of the last 24 hours.
- Requires the derived parameter:
- Requires the flux sequence:
- Updates the log sequence:
Example:
The following example shows that each new method call successively moves the three memorised values to the right and stores the respective new value on the most left position:
>>> from hydpy.models.meteo import * >>> simulationstep("8h") >>> parameterstep() >>> derived.nmblogentries.update() >>> logs.loggedunadjustedglobalradiation = 0.0 >>> from hydpy import UnitTest >>> test = UnitTest(model, ... model.update_loggedunadjustedglobalradiation_v1, ... last_example=4, ... parseqs=(fluxes.unadjustedglobalradiation, ... logs.loggedunadjustedglobalradiation)) >>> test.nexts.unadjustedglobalradiation = 1.0, 3.0, 2.0, 4.0 >>> del test.inits.loggedunadjustedglobalradiation >>> test() | ex. | unadjustedglobalradiation | loggedunadjustedglobalradiation | ------------------------------------------------------------------------------- | 1 | 1.0 | 1.0 0.0 0.0 | | 2 | 3.0 | 3.0 1.0 0.0 | | 3 | 2.0 | 2.0 3.0 1.0 | | 4 | 4.0 | 4.0 2.0 3.0 |
- class hydpy.models.meteo.meteo_model.Calc_DailyGlobalRadiation_V1[source]¶
Bases:
Method
Calculate the daily global radiation.
- Required submethod:
- Requires the control parameters:
- Requires the derived parameters:
- Requires the factor sequences:
- Requires the flux sequence:
- Updates the flux sequence:
- Additional requirements:
- Basic equation:
\(DailyGlobalRadiation = Return\_DailyGlobalRadiation\_V1( DailySunshineDuration, DailyPossibleSunshineDuration)\)
Example:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> from hydpy import pub >>> angstromconstant.jan = 0.1 >>> angstromfactor.jan = 0.5 >>> angstromconstant.feb = 0.2 >>> angstromfactor.feb = 0.6
We set the extraterrestrial radiation to 200 W/m² and the possible sunshine duration to 12 hours:
>>> fluxes.extraterrestrialradiation = 200.0 >>> factors.dailypossiblesunshineduration = 12.0
We define a daily simulation step size and update the relevant derived parameters:
>>> pub.timegrids = "2000-01-30", "2000-02-03", "1d" >>> derived.moy.update()
Applying the Ångström coefficients for January and February on the defined extraterrestrial radiation and a sunshine duration of 7.2 hours results in a daily global radiation average of 80 and 112 W/m², respectively:
>>> model.idx_sim = 1 >>> factors.dailysunshineduration = 7.2 >>> model.calc_dailyglobalradiation_v1() >>> fluxes.dailyglobalradiation dailyglobalradiation(80.0)
>>> model.idx_sim = 2 >>> model.calc_dailyglobalradiation_v1() >>> fluxes.dailyglobalradiation dailyglobalradiation(112.0)
Finally, we demonstrate for January that method
Calc_DailyGlobalRadiation_V1
calculates the same values for an hourly simulation time step, as long as the daily sum of sunshine duration remains identical:>>> pub.timegrids = "2000-01-30", "2000-02-03", "1h" >>> derived.moy.update()
The actual simulation step starts at 11 o’clock and ends at 12 o’clock:
>>> model.idx_sim = pub.timegrids.init["2000-01-31 11:00"] >>> factors.dailysunshineduration = 7.2 >>> model.calc_dailyglobalradiation_v1() >>> fluxes.dailyglobalradiation dailyglobalradiation(80.0)
- class hydpy.models.meteo.meteo_model.Return_SunshineDuration_V1[source]¶
Bases:
Method
Calculate the sunshine duration reversely to
Return_DailyGlobalRadiation_V1
and return it.- Required by the methods:
Calc_DailySunshineDuration_V2
Calc_UnadjustedSunshineDuration_V1
- Requires the control parameters:
- Requires the derived parameter:
- Basic equation:
\(\frac{possiblesunshineduration}{AngstromFactor} \cdot \left( \frac{globalradiation}{extraterrestrialradiation} - AngstromConstant \right)\)
Example:
Essentially,
Return_SunshineDuration_V1
tries to invertReturn_DailyGlobalRadiation_V1
and thus also relies on the Ångström formula. Instead of estimating global radiation from sunshine duration, it estimates sunshine duration from global radiation. We demonstrate this by repeating the first examples ofCalc_GlobalRadiation_V1
“backwards”:>>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-30", "2000-02-03", "1d" >>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.moy.update() >>> angstromconstant.jan = 0.1 >>> angstromfactor.jan = 0.5 >>> angstromalternative.jan = 0.2 >>> angstromconstant.feb = 0.2 >>> angstromfactor.feb = 0.6 >>> angstromalternative.feb = 0.3 >>> model.idx_sim = 1 >>> round_(model.return_sunshineduration_v1(136.0, 340.0, 1.0)) 0.6 >>> model.idx_sim = 2 >>> round_(model.return_sunshineduration_v1(190.4, 340.0, 1.0)) 0.6
In contrast to
Return_DailyGlobalRadiation_V1
,Return_SunshineDuration_V1
never appliesAngstromAlternative
instead ofAngstromConstant
. Hence, as in the following repeated examples,Return_SunshineDuration_V1
might invertReturn_DailyGlobalRadiation_V1
only roughly during periods with little sunshine:>>> model.idx_sim = 1 >>> round_(model.return_sunshineduration_v1(68.0, 340.0, 1.0)) 0.2 >>> model.idx_sim = 2 >>> round_(model.return_sunshineduration_v1(102.0, 340.0, 1.0)) 0.166667
We must consider additional corner cases. The first one deals with a potential zero division during nighttime. If extraterrestrial radiation is zero,
Return_SunshineDuration_V1
takes the astronomically possible sunshine duration (which should ideally also be zero) as the actual sunshine duration:>>> model.idx_sim = 1 >>> round_(model.return_sunshineduration_v1(136.0, 0.0, 0.00001)) 0.00001
Measured global radiation smaller than estimated diffusive radiation would result in negative sunshine durations when following the Ångström formula strictly. Additionally, measured global radiation larger than estimated clear-sky radiation would result in sunshine durations larger than the astronomically possible sunshine duration. The following example shows that method
Return_SunshineDuration_V1
prevents such inconsistencies by trimming the estimated sunshine duration when necessary:>>> for globrad in (0.0, 34.0, 35.0, 136.0, 203.0, 204.0, 340.0): ... sundur = model.return_sunshineduration_v1(globrad, 340.0, 1.0) ... round_((globrad, sundur)) 0.0, 0.0 34.0, 0.0 35.0, 0.005882 136.0, 0.6 203.0, 0.994118 204.0, 1.0 340.0, 1.0
- class hydpy.models.meteo.meteo_model.Calc_UnadjustedSunshineDuration_V1[source]¶
Bases:
Method
Calculate the unadjusted sunshine duration reversely to
Calc_UnadjustedGlobalRadiation_V1
.- Required submethod:
- Requires the control parameters:
- Requires the derived parameters:
- Requires the input sequence:
- Requires the factor sequences:
- Requires the flux sequence:
- Calculates the factor sequence:
- Additional requirements:
- Basic equation:
\(UnadjustedSunshineDuration = Return\_SunshineDuration \left( GlobalRadiation, NmbLogEntries \cdot \frac{PortionDailyRadiation}{100} \cdot ExtraterrestrialRadiation, PossibleSunshineDuration \right)\)
Example:
Method
Calc_UnadjustedSunshineDuration_V1
relies onReturn_SunshineDuration_V1
and thus comes with the same limitation regarding periods with little sunshine. See its documentation for further information. Here, we only demonstrate the proper passing ofGlobalRadiation
,ExtraterrestrialRadiation
(eventually reduced byPortionDailyRadiation
) andPossibleSunshineDuration
:>>> from hydpy import pub >>> pub.timegrids = "2000-01-31", "2000-02-02", "6h" >>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.nmblogentries.update() >>> derived.moy.update() >>> angstromconstant.jan = 0.1 >>> angstromfactor.jan = 0.5 >>> inputs.globalradiation = 272.0 >>> factors.possiblesunshineduration = 1.0 >>> factors.portiondailyradiation = 50.0 >>> fluxes.extraterrestrialradiation = 340.0 >>> model.idx_sim = 3 >>> model.calc_unadjustedsunshineduration_v1() >>> factors.unadjustedsunshineduration unadjustedsunshineduration(0.6)
- class hydpy.models.meteo.meteo_model.Calc_GlobalRadiation_V2[source]¶
Bases:
Method
- Adjust the current global radiation to the daily global radiation according to
- Requires the derived parameter:
- Requires the flux sequences:
- Requires the log sequence:
- Calculates the flux sequence:
- Additional requirements:
- Basic equation:
\(GlobalRadiation = UnadjustedGlobalRadiation \cdot \frac{DailyGlobalRadiation}{\sum LoggedUnadjustedGlobalRadiation / NmbLogEntries}\)
Examples:
The purpose of method
Calc_GlobalRadiation_V2
is to adjust hourly global radiation values (or those of other short simulation time steps) so that their mean over the last 24 hours equals the global radiation value directly calculated with the relative sunshine duration over the last 24 hours. We try to explain this somewhat counterintuitive approach by extending the documentation examples on methodCalc_DailyGlobalRadiation_V1
.Again, we start with a daily simulation time step:
>>> from hydpy.models.meteo import * >>> simulationstep("1d") >>> parameterstep() >>> derived.nmblogentries.update()
For such a daily simulation time step, the values of the sequences
UnadjustedGlobalRadiation
,DailyGlobalRadiation
, andLoggedUnadjustedGlobalRadiation
must be identical:>>> model.idx_sim = 1 >>> fluxes.unadjustedglobalradiation = 200.0 >>> fluxes.dailyglobalradiation = 200.0 >>> logs.loggedunadjustedglobalradiation = 200.0
After calling
Calc_GlobalRadiation_V2
, the same holds for the adjusted global radiation sum:>>> model.calc_globalradiation_v2() >>> fluxes.globalradiation globalradiation(200.0)
Intuitively, one would not expect method
Calc_GlobalRadiation_V2
to have any effect when applied on daily simulation time steps at all. However, it corrects “wrong” predefined global radiation values:>>> fluxes.dailyglobalradiation = 280.0 >>> model.calc_globalradiation_v2() >>> fluxes.globalradiation globalradiation(280.0)
We now demonstrate how method
Calc_GlobalRadiation_V2
works for hourly simulation time steps:>>> simulationstep("1h") >>> derived.nmblogentries.update()
The daily global radiation value does not depend on the simulation timestep. We reset it to 200 W/m²:
>>> fluxes.dailyglobalradiation = 200.0
The other global radiation values must be smaller and vary throughout the day. We set them in agreement with the logged sunshine duration specified in the documentation on method
Calc_DailyGlobalRadiation_V1
:>>> fluxes.unadjustedglobalradiation = 960.0 >>> logs.loggedunadjustedglobalradiation = ( ... 960.0, 960.0, 240.0, 120.0, 120.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ... 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 120.0, 480.0, 720.0, 840.0, 960.0)
Compared with the total 24 hours, the simulation time steps around noon are relatively sunny, both for the current and the last day (see the first and the last entry of the log sequence for the sunshine duration). Accordingly, the hourly global radiation values’ mean (230 W/m²) is larger than the directly calculated daily mean (200 W/m²). Method
Calc_GlobalRadiation_V2
uses the fraction of both sums to calculate the adjusted global radiation (\(960 \cdot 200 / 230\)):>>> model.calc_globalradiation_v2() >>> fluxes.globalradiation globalradiation(834.782609)
- class hydpy.models.meteo.meteo_model.Calc_SunshineDuration_V1[source]¶
Bases:
Method
Calculate the sunshine duration according to Allen et al. (1998).
- Requires the control parameters:
- Requires the derived parameter:
- Requires the input sequence:
- Requires the factor sequence:
- Requires the flux sequence:
- Calculates the factor sequence:
- Basic equation (Allen et al. (1998), equation 35, rearranged):
\(SunshineDuration = \left(\frac{GlobalRadiation}{ExtraterrestrialRadiation}-AngstromConstant \right) \cdot \frac{PossibleSunshineDuration}{AngstromFactor}\)
Example:
Essentially,
Calc_SunshineDuration_V1
invertsCalc_GlobalRadiation_V1
and thus also relies on the Ångström formula. Instead of estimating global radiation from sunshine duration, it estimates global radiation from sunshine duration. We demonstrate this by repeating the examples ofCalc_GlobalRadiation_V1
“backwards”:>>> from hydpy import pub, round_ >>> pub.timegrids = "2000-01-30", "2000-02-03", "1d" >>> from hydpy.models.meteo import * >>> parameterstep() >>> angstromconstant.jan = 0.19 >>> angstromfactor.jan = 0.55 >>> angstromconstant.feb = 0.25 >>> angstromfactor.feb = 0.5 >>> derived.moy.update() >>> factors.possiblesunshineduration = 14.0 >>> fluxes.extraterrestrialradiation = 200.0 >>> model.idx_sim = 1 >>> inputs.globalradiation = 132.285714 >>> model.calc_sunshineduration_v1() >>> factors.sunshineduration sunshineduration(12.0) >>> model.idx_sim = 2 >>> inputs.globalradiation = 135.714286 >>> model.calc_sunshineduration_v1() >>> factors.sunshineduration sunshineduration(12.0)
Calc_SunshineDuration_V1
setsSunshineDuration
to zero for zero extraterrestrial radiation:>>> fluxes.extraterrestrialradiation = 0.0 >>> model.calc_sunshineduration_v1() >>> factors.sunshineduration sunshineduration(0.0)
Inconsistencies between global radiation measurements and the Ångström formula (and the selected coefficients) can result in unrealistic sunshine duration estimates. Method
Calc_SunshineDuration_V1
reduces this problem by lowering too high values to the possible sunshine duration and increasing too low values to zero:>>> fluxes.extraterrestrialradiation = 200.0 >>> inputs.globalradiation = 210.0 >>> model.calc_sunshineduration_v1() >>> factors.sunshineduration sunshineduration(14.0)
>>> inputs.globalradiation = 0.0 >>> model.calc_sunshineduration_v1() >>> factors.sunshineduration sunshineduration(0.0)
- class hydpy.models.meteo.meteo_model.Update_LoggedUnadjustedSunshineDuration_V1[source]¶
Bases:
Method
Log the unadjusted sunshine duration values of the last 24 hours.
- Requires the derived parameter:
- Requires the factor sequence:
- Updates the log sequence:
Example:
The following example shows that each new method call successively moves the three memorised values to the right and stores the respective new value on the most left position:
>>> from hydpy.models.meteo import * >>> simulationstep("8h") >>> parameterstep() >>> derived.nmblogentries.update() >>> logs.loggedunadjustedsunshineduration = 0.0 >>> from hydpy import UnitTest >>> test = UnitTest(model, ... model.update_loggedunadjustedsunshineduration_v1, ... last_example=4, ... parseqs=(factors.unadjustedsunshineduration, ... logs.loggedunadjustedsunshineduration)) >>> test.nexts.unadjustedsunshineduration = 1.0, 3.0, 2.0, 4.0 >>> del test.inits.loggedunadjustedsunshineduration >>> test() | ex. | unadjustedsunshineduration | ... loggedunadjustedsunshineduration | -------------------------------------...----------------------------------- | 1 | 1.0 | 1.0 0.0 ... 0.0 | | 2 | 3.0 | 3.0 1.0 ... 0.0 | | 3 | 2.0 | 2.0 3.0 ... 1.0 | | 4 | 4.0 | 4.0 2.0 ... 3.0 |
- class hydpy.models.meteo.meteo_model.Calc_DailySunshineDuration_V2[source]¶
Bases:
Method
Calculate the daily sunshine duration reversely to
Calc_DailyGlobalRadiation_V1
.- Required submethod:
- Requires the control parameters:
- Requires the derived parameter:
- Requires the factor sequence:
- Requires the flux sequences:
- Calculates the factor sequence:
- Additional requirements:
- Basic equation:
\(DailySunshineDuration = Return\_SunshineDuration \left( DailyGlobalRadiation, ExtraterrestrialRadiation, DailyPossibleSunshineDuration \right)\)
Example:
Method
Calc_UnadjustedSunshineDuration_V1
relies onReturn_SunshineDuration_V1
and thus comes with the same limitation regarding periods with little sunshine. See its documentation for further information. Here, we only demonstrate the proper passing ofDailyGlobalRadiation
,ExtraterrestrialRadiation
, andDailyPossibleSunshineDuration
:>>> from hydpy import pub >>> pub.timegrids = "2000-01-30", "2000-02-03", "1d" >>> from hydpy.models.meteo import * >>> parameterstep() >>> derived.moy.update() >>> angstromconstant.jan = 0.1 >>> angstromfactor.jan = 0.5 >>> factors.dailypossiblesunshineduration = 12.0 >>> fluxes.dailyglobalradiation = 80.0 >>> fluxes.extraterrestrialradiation = 200.0 >>> model.idx_sim = 1 >>> model.calc_dailysunshineduration_v2() >>> factors.dailysunshineduration dailysunshineduration(7.2)
- class hydpy.models.meteo.meteo_model.Calc_SunshineDuration_V2[source]¶
Bases:
Method
Adjust the current sunshine duration to the daily sunshine duration like
Calc_GlobalRadiation_V2
adjusts the current global radiation to the daily global radiation.- Requires the derived parameter:
- Requires the factor sequences:
UnadjustedSunshineDuration
DailySunshineDuration
PossibleSunshineDuration
- Requires the log sequence:
- Calculates the factor sequence:
- Additional requirements:
- Basic equation:
\(SunshineDuration = UnadjustedSunshineDuration \cdot \frac{DailySunshineDuration}{\sum LoggedUnadjustedSunshineDuration}\)
Examples:
Calc_SunshineDuration_V2
implements a standardisation approach following the reasons and strategy explained in the documentation on methodCalc_GlobalRadiation_V2
. Hence, we first adopt its examples without repeated explanations:>>> from hydpy.models.meteo import * >>> simulationstep("1d") >>> parameterstep() >>> derived.nmblogentries.update() >>> model.idx_sim = 1 >>> factors.unadjustedsunshineduration = 4.0 >>> factors.dailysunshineduration = 4.0 >>> logs.loggedunadjustedsunshineduration = 4.0 >>> model.calc_sunshineduration_v2() >>> factors.sunshineduration sunshineduration(4.0) >>> factors.dailysunshineduration = 5.6 >>> model.calc_sunshineduration_v2() >>> factors.sunshineduration sunshineduration(5.6)
>>> simulationstep("1h") >>> derived.nmblogentries.update() >>> factors.dailysunshineduration = 4.0 >>> factors.unadjustedsunshineduration = 0.8 >>> logs.loggedunadjustedsunshineduration = ( ... 0.8, 0.8, 0.2, 0.1, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ... 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.4, 0.6, 0.7, 0.8) >>> model.calc_sunshineduration_v2() >>> factors.sunshineduration sunshineduration(0.695652)
The global radiation of a day cannot be zero due to diffusive radiations, but the sunshine duration can. Hence,
Calc_SunshineDuration_V2
requires a safeguard against zero-divisions not relevant forCalc_GlobalRadiation_V2
. We decided to generally set the adjusted sunshine duration to zero if the directly calculated daily sunshine duration or the current unadjusted sunshine duration is zero. (Note the sum of the logged unadjusted sunshine duration can only be zero if the present unadjusted sunshine duration is zero):>>> factors.unadjustedsunshineduration = 0.0 >>> logs.loggedunadjustedsunshineduration = 0.0 >>> model.calc_sunshineduration_v2() >>> factors.sunshineduration sunshineduration(0.0)
Parameter Features¶
Control parameters¶
- class hydpy.models.meteo.ControlParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParameters
Control parameters of model meteo.
- The following classes are selected:
Latitude()
The latitude [decimal degrees].Longitude()
The longitude [decimal degrees].AngstromConstant()
The Ångström “a” coefficient for calculating global radiation [-].AngstromFactor()
The Ångström “b” coefficient for calculating global radiation [-].AngstromAlternative()
An alternative Ångström coefficient for replacing coefficient “c” (AngstromConstant
) on days without any direct sunshine [-].
- class hydpy.models.meteo.meteo_control.Latitude(subvars: SubParameters)[source]¶
Bases:
Parameter
The latitude [decimal degrees].
- class hydpy.models.meteo.meteo_control.Longitude(subvars: SubParameters)[source]¶
Bases:
Parameter
The longitude [decimal degrees].
- Required by the methods:
- class hydpy.models.meteo.meteo_control.AngstromConstant(subvars: SubParameters)[source]¶
Bases:
MonthParameter
The Ångström “a” coefficient for calculating global radiation [-].
- Required by the methods:
Calc_ClearSkySolarRadiation_V1
Calc_DailyGlobalRadiation_V1
Calc_DailySunshineDuration_V2
Calc_GlobalRadiation_V1
Calc_SunshineDuration_V1
Calc_UnadjustedGlobalRadiation_V1
Calc_UnadjustedSunshineDuration_V1
Return_DailyGlobalRadiation_V1
Return_SunshineDuration_V1
- trim(lower=None, upper=None)[source]¶
Trim values following \(AngstromConstant \leq 1 - AngstromFactor\) or at least following \(AngstromConstant \leq 1\).
>>> from hydpy.models.meteo import * >>> parameterstep() >>> angstromconstant(1.5) >>> angstromconstant angstromconstant(1.0) >>> angstromfactor.value = 0.6 >>> angstromconstant(0.5) >>> angstromconstant angstromconstant(0.4)
- class hydpy.models.meteo.meteo_control.AngstromFactor(subvars: SubParameters)[source]¶
Bases:
MonthParameter
The Ångström “b” coefficient for calculating global radiation [-].
- Required by the methods:
Calc_ClearSkySolarRadiation_V1
Calc_DailyGlobalRadiation_V1
Calc_DailySunshineDuration_V2
Calc_GlobalRadiation_V1
Calc_SunshineDuration_V1
Calc_UnadjustedGlobalRadiation_V1
Calc_UnadjustedSunshineDuration_V1
Return_DailyGlobalRadiation_V1
Return_SunshineDuration_V1
- trim(lower=None, upper=None)[source]¶
Trim values in accordance with \(AngstromFactor \leq 1 - AngstromConstant\) or at least in accordance with \(AngstromFactor \leq 1\).
>>> from hydpy.models.meteo import * >>> parameterstep() >>> angstromfactor(1.5) >>> angstromfactor angstromfactor(1.0) >>> angstromconstant.value = 0.6 >>> angstromfactor(0.5) >>> angstromfactor angstromfactor(0.4)
- class hydpy.models.meteo.meteo_control.AngstromAlternative(subvars: SubParameters)[source]¶
Bases:
MonthParameter
An alternative Ångström coefficient for replacing coefficient “c” (
AngstromConstant
) on days without any direct sunshine [-].- Required by the methods:
Calc_DailyGlobalRadiation_V1
Calc_UnadjustedGlobalRadiation_V1
Return_DailyGlobalRadiation_V1
Derived parameters¶
- class hydpy.models.meteo.DerivedParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParameters
Derived parameters of model meteo.
- The following classes are selected:
DOY()
References the “global” day of the year index array [-].MOY()
References the “global” month of the year index array [-].Hours()
The length of the actual simulation step size in hours [h].Days()
The length of the actual simulation step size in days [d].SCT()
References the “global” standard clock time array [h].NmbLogEntries()
The number of log entries required for memorising one day’s data [-].UTCLongitude()
Longitude of the centre of the local time zone [°].LatitudeRad()
The latitude [rad].
- class hydpy.models.meteo.meteo_derived.DOY(subvars: SubParameters)[source]¶
Bases:
DOYParameter
References the “global” day of the year index array [-].
- Required by the methods:
Calc_EarthSunDistance_V1
Calc_SolarDeclination_V1
Calc_SolarDeclination_V2
Calc_SolarTimeAngle_V1
- class hydpy.models.meteo.meteo_derived.MOY(subvars: SubParameters)[source]¶
Bases:
MOYParameter
References the “global” month of the year index array [-].
- class hydpy.models.meteo.meteo_derived.Seconds(subvars: SubParameters)[source]¶
Bases:
SecondsParameter
The length of the actual simulation step size in seconds [s].
- class hydpy.models.meteo.meteo_derived.Hours(subvars: SubParameters)[source]¶
Bases:
HoursParameter
The length of the actual simulation step size in hours [h].
- Required by the methods:
Calc_PortionDailyRadiation_V1
Calc_PossibleSunshineDuration_V1
Calc_PossibleSunshineDuration_V2
- class hydpy.models.meteo.meteo_derived.Days(subvars: SubParameters)[source]¶
Bases:
DaysParameter
The length of the actual simulation step size in days [d].
- class hydpy.models.meteo.meteo_derived.SCT(subvars: SubParameters)[source]¶
Bases:
SCTParameter
References the “global” standard clock time array [h].
- Required by the methods:
Calc_PortionDailyRadiation_V1
Calc_PossibleSunshineDuration_V2
Calc_SolarTimeAngle_V1
- class hydpy.models.meteo.meteo_derived.NmbLogEntries(subvars: SubParameters)[source]¶
Bases:
Parameter
The number of log entries required for memorising one day’s data [-].
- Required by the methods:
Calc_DailyGlobalRadiation_V2
Calc_DailySunshineDuration_V1
Calc_GlobalRadiation_V2
Calc_SunshineDuration_V2
Calc_UnadjustedGlobalRadiation_V1
Calc_UnadjustedSunshineDuration_V1
Update_LoggedGlobalRadiation_V1
Update_LoggedSunshineDuration_V1
Update_LoggedUnadjustedGlobalRadiation_V1
Update_LoggedUnadjustedSunshineDuration_V1
- update()[source]¶
Calculate the number of entries and adjust the shape of all relevant log sequences.
The aimed memory duration is always one day. Hence, the number of the required log entries depends on the simulation step size:
>>> from hydpy.models.meteo import * >>> parameterstep() >>> from hydpy import pub >>> pub.timegrids = "2000-01-01", "2000-01-02", "1h" >>> derived.nmblogentries.update() >>> derived.nmblogentries nmblogentries(24) >>> logs loggedsunshineduration(nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan) ...
To prevent losing information, updating parameter
NmbLogEntries
resets the shape of the relevant log sequences only when necessary:>>> logs.loggedsunshineduration = 1.0 >>> derived.nmblogentries(24) >>> logs loggedsunshineduration(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0) ...
There is an explicit check for inappropriate simulation step sizes:
>>> pub.timegrids = "2000-01-01 00:00", "2000-01-01 10:00", "5h" >>> derived.nmblogentries.update() Traceback (most recent call last): ... ValueError: The value of parameter `nmblogentries` of element `?` cannot be determined for a the current simulation step size. The fraction of the memory period (1d) and the simulation step size (5h) leaves a remainder.
- class hydpy.models.meteo.meteo_derived.UTCLongitude(subvars: SubParameters)[source]¶
Bases:
UTCLongitudeParameter
Longitude of the centre of the local time zone [°].
- Required by the methods:
- class hydpy.models.meteo.meteo_derived.LatitudeRad(subvars: SubParameters)[source]¶
Bases:
Parameter
The latitude [rad].
- Required by the methods:
Calc_ExtraterrestrialRadiation_V1
Calc_ExtraterrestrialRadiation_V2
Calc_SunsetHourAngle_V1
Calc_TimeOfSunrise_TimeOfSunset_V1
- update()[source]¶
Update
LatitudeRad
based on parameterLatitude
.>>> from hydpy import round_ >>> from hydpy.models.meteo import * >>> parameterstep() >>> for value in (-90.0, -45.0, 0.0, 45.0, 90.0): ... latitude(value) ... derived.latituderad.update() ... round_(latitude.value, end=": ") ... round_(derived.latituderad.value) -90.0: -1.570796 -45.0: -0.785398 0.0: 0.0 45.0: 0.785398 90.0: 1.570796
Fixed parameters¶
- class hydpy.models.meteo.FixedParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
SubParameters
Fixed parameters of model meteo.
- The following classes are selected:
Pi()
π [-].SolarConstant()
Solar constant [W/m²].
- class hydpy.models.meteo.meteo_fixed.Pi(subvars: SubParameters)[source]¶
Bases:
FixedParameter
π [-].
- class hydpy.models.meteo.meteo_fixed.SolarConstant(subvars: SubParameters)[source]¶
Bases:
FixedParameter
Solar constant [W/m²].
- Required by the methods:
Calc_ExtraterrestrialRadiation_V1
Calc_ExtraterrestrialRadiation_V2
Sequence Features¶
Input sequences¶
- class hydpy.models.meteo.InputSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
InputSequences
Input sequences of model meteo.
- The following classes are selected:
SunshineDuration()
Sunshine duration [h].GlobalRadiation()
Global radiation [W/m²].
- class hydpy.models.meteo.meteo_inputs.SunshineDuration(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
InputSequence
Sunshine duration [h].
- Required by the methods:
Calc_GlobalRadiation_V1
Calc_UnadjustedGlobalRadiation_V1
Update_LoggedSunshineDuration_V1
- class hydpy.models.meteo.meteo_inputs.GlobalRadiation(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
InputSequence
Global radiation [W/m²].
- Required by the methods:
Calc_SunshineDuration_V1
Calc_UnadjustedSunshineDuration_V1
Update_LoggedGlobalRadiation_V1
Factor sequences¶
- class hydpy.models.meteo.FactorSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
FactorSequences
Factor sequences of model meteo.
- The following classes are selected:
EarthSunDistance()
The relative inverse distance between the earth and the sun [-].SolarDeclination()
Solar declination [-].SunsetHourAngle()
Sunset hour angle [rad].SolarTimeAngle()
Solar time angle [rad].TimeOfSunrise()
Time of sunrise [h].TimeOfSunset()
Time of sunset [h].PossibleSunshineDuration()
Astronomically possible sunshine duration [h].DailyPossibleSunshineDuration()
Astronomically possible daily sunshine duration [h/d].UnadjustedSunshineDuration()
Unadjusted sunshine duration [h].SunshineDuration()
Actual sunshine duration [h].DailySunshineDuration()
Actual daily sunshine duration [h/d].PortionDailyRadiation()
Portion of the daily radiation sum [%].
- class hydpy.models.meteo.meteo_factors.EarthSunDistance(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
The relative inverse distance between the earth and the sun [-].
- Calculated by the method:
- Required by the methods:
Calc_ExtraterrestrialRadiation_V1
Calc_ExtraterrestrialRadiation_V2
- class hydpy.models.meteo.meteo_factors.SolarDeclination(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
Solar declination [-].
- Calculated by the methods:
- Required by the methods:
Calc_ExtraterrestrialRadiation_V1
Calc_ExtraterrestrialRadiation_V2
Calc_SunsetHourAngle_V1
Calc_TimeOfSunrise_TimeOfSunset_V1
- class hydpy.models.meteo.meteo_factors.SunsetHourAngle(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
Sunset hour angle [rad].
- Calculated by the method:
- Required by the methods:
Calc_ExtraterrestrialRadiation_V1
Calc_PossibleSunshineDuration_V1
- class hydpy.models.meteo.meteo_factors.SolarTimeAngle(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
Solar time angle [rad].
- Calculated by the method:
- Required by the methods:
Calc_ExtraterrestrialRadiation_V1
Calc_PossibleSunshineDuration_V1
- class hydpy.models.meteo.meteo_factors.TimeOfSunrise(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
Time of sunrise [h].
- Calculated by the method:
- Required by the methods:
Calc_DailyPossibleSunshineDuration_V1
Calc_ExtraterrestrialRadiation_V2
Calc_PortionDailyRadiation_V1
Calc_PossibleSunshineDuration_V2
- class hydpy.models.meteo.meteo_factors.TimeOfSunset(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
Time of sunset [h].
- Calculated by the method:
- Required by the methods:
Calc_DailyPossibleSunshineDuration_V1
Calc_ExtraterrestrialRadiation_V2
Calc_PortionDailyRadiation_V1
Calc_PossibleSunshineDuration_V2
- class hydpy.models.meteo.meteo_factors.PossibleSunshineDuration(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
Astronomically possible sunshine duration [h].
- Calculated by the methods:
Calc_PossibleSunshineDuration_V1
Calc_PossibleSunshineDuration_V2
- Required by the methods:
Calc_GlobalRadiation_V1
Calc_SunshineDuration_V1
Calc_SunshineDuration_V2
Calc_UnadjustedGlobalRadiation_V1
Calc_UnadjustedSunshineDuration_V1
- class hydpy.models.meteo.meteo_factors.DailyPossibleSunshineDuration(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
Astronomically possible daily sunshine duration [h/d].
- Calculated by the method:
- Required by the methods:
Calc_DailyGlobalRadiation_V1
Calc_DailySunshineDuration_V2
Calc_UnadjustedGlobalRadiation_V1
- class hydpy.models.meteo.meteo_factors.UnadjustedSunshineDuration(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
Unadjusted sunshine duration [h].
- Calculated by the method:
- Required by the methods:
Calc_SunshineDuration_V2
Update_LoggedUnadjustedSunshineDuration_V1
- class hydpy.models.meteo.meteo_factors.SunshineDuration(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
Actual sunshine duration [h].
- Calculated by the methods:
- class hydpy.models.meteo.meteo_factors.DailySunshineDuration(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
Actual daily sunshine duration [h/d].
- Calculated by the method:
- Updated by the method:
- Required by the methods:
Calc_DailyGlobalRadiation_V1
Calc_SunshineDuration_V2
Calc_UnadjustedGlobalRadiation_V1
- class hydpy.models.meteo.meteo_factors.PortionDailyRadiation(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FactorSequence
Portion of the daily radiation sum [%].
- Calculated by the method:
- Required by the methods:
Calc_UnadjustedGlobalRadiation_V1
Calc_UnadjustedSunshineDuration_V1
Flux sequences¶
- class hydpy.models.meteo.FluxSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
FluxSequences
Flux sequences of model meteo.
- The following classes are selected:
ExtraterrestrialRadiation()
Extraterrestial radiation [W/m²].ClearSkySolarRadiation()
Clear sky solar radiation [W/m²].UnadjustedGlobalRadiation()
Unadjusted global radiation [W/m²].DailyGlobalRadiation()
Daily sum of global radiation [W/m²].GlobalRadiation()
Global radiation [W/m²].
- class hydpy.models.meteo.meteo_fluxes.ExtraterrestrialRadiation(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Extraterrestial radiation [W/m²].
- Calculated by the methods:
Calc_ExtraterrestrialRadiation_V1
Calc_ExtraterrestrialRadiation_V2
- Required by the methods:
Calc_ClearSkySolarRadiation_V1
Calc_DailyGlobalRadiation_V1
Calc_DailySunshineDuration_V2
Calc_GlobalRadiation_V1
Calc_SunshineDuration_V1
Calc_UnadjustedGlobalRadiation_V1
Calc_UnadjustedSunshineDuration_V1
Return_DailyGlobalRadiation_V1
- class hydpy.models.meteo.meteo_fluxes.ClearSkySolarRadiation(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Clear sky solar radiation [W/m²].
- Calculated by the method:
- class hydpy.models.meteo.meteo_fluxes.UnadjustedGlobalRadiation(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Unadjusted global radiation [W/m²].
- Calculated by the method:
- Required by the methods:
Calc_GlobalRadiation_V2
Update_LoggedUnadjustedGlobalRadiation_V1
- class hydpy.models.meteo.meteo_fluxes.DailyGlobalRadiation(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Daily sum of global radiation [W/m²].
- Updated by the methods:
- Required by the methods:
- class hydpy.models.meteo.meteo_fluxes.GlobalRadiation(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
FluxSequence
Global radiation [W/m²].
- Calculated by the methods:
Log sequences¶
- class hydpy.models.meteo.LogSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)
Bases:
LogSequences
Log sequences of model meteo.
- The following classes are selected:
LoggedSunshineDuration()
Logged sunshine duration [h].LoggedGlobalRadiation()
Logged global radiation [W/m²].LoggedUnadjustedSunshineDuration()
Logged unadjusted sunshine duration [h].LoggedUnadjustedGlobalRadiation()
Logged unadjusted global radiation [W/m²].
- class hydpy.models.meteo.meteo_logs.LoggedSunshineDuration(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
LogSequence
Logged sunshine duration [h].
- Updated by the method:
- Required by the method:
- class hydpy.models.meteo.meteo_logs.LoggedGlobalRadiation(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
LogSequence
Logged global radiation [W/m²].
- Updated by the method:
- Required by the method:
- class hydpy.models.meteo.meteo_logs.LoggedUnadjustedSunshineDuration(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
LogSequence
Logged unadjusted sunshine duration [h].
- Updated by the method:
- Required by the method:
- class hydpy.models.meteo.meteo_logs.LoggedUnadjustedGlobalRadiation(subvars: ModelSequences[ModelSequence, FastAccess])[source]¶
Bases:
LogSequence
Logged unadjusted global radiation [W/m²].
- Updated by the method:
- Required by the method:
- class hydpy.models.meteo.ControlParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParameters
Control parameters of model meteo.
- The following classes are selected:
Latitude()
The latitude [decimal degrees].Longitude()
The longitude [decimal degrees].AngstromConstant()
The Ångström “a” coefficient for calculating global radiation [-].AngstromFactor()
The Ångström “b” coefficient for calculating global radiation [-].AngstromAlternative()
An alternative Ångström coefficient for replacing coefficient “c” (AngstromConstant
) on days without any direct sunshine [-].
- class hydpy.models.meteo.DerivedParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParameters
Derived parameters of model meteo.
- The following classes are selected:
DOY()
References the “global” day of the year index array [-].MOY()
References the “global” month of the year index array [-].Hours()
The length of the actual simulation step size in hours [h].Days()
The length of the actual simulation step size in days [d].SCT()
References the “global” standard clock time array [h].NmbLogEntries()
The number of log entries required for memorising one day’s data [-].UTCLongitude()
Longitude of the centre of the local time zone [°].LatitudeRad()
The latitude [rad].
- class hydpy.models.meteo.FactorSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FactorSequences
Factor sequences of model meteo.
- The following classes are selected:
EarthSunDistance()
The relative inverse distance between the earth and the sun [-].SolarDeclination()
Solar declination [-].SunsetHourAngle()
Sunset hour angle [rad].SolarTimeAngle()
Solar time angle [rad].TimeOfSunrise()
Time of sunrise [h].TimeOfSunset()
Time of sunset [h].PossibleSunshineDuration()
Astronomically possible sunshine duration [h].DailyPossibleSunshineDuration()
Astronomically possible daily sunshine duration [h/d].UnadjustedSunshineDuration()
Unadjusted sunshine duration [h].SunshineDuration()
Actual sunshine duration [h].DailySunshineDuration()
Actual daily sunshine duration [h/d].PortionDailyRadiation()
Portion of the daily radiation sum [%].
- class hydpy.models.meteo.FixedParameters(master: Parameters, cls_fastaccess: Type[FastAccessParameter] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
SubParameters
Fixed parameters of model meteo.
- The following classes are selected:
Pi()
π [-].SolarConstant()
Solar constant [W/m²].
- class hydpy.models.meteo.FluxSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
FluxSequences
Flux sequences of model meteo.
- The following classes are selected:
ExtraterrestrialRadiation()
Extraterrestial radiation [W/m²].ClearSkySolarRadiation()
Clear sky solar radiation [W/m²].UnadjustedGlobalRadiation()
Unadjusted global radiation [W/m²].DailyGlobalRadiation()
Daily sum of global radiation [W/m²].GlobalRadiation()
Global radiation [W/m²].
- class hydpy.models.meteo.InputSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
InputSequences
Input sequences of model meteo.
- The following classes are selected:
SunshineDuration()
Sunshine duration [h].GlobalRadiation()
Global radiation [W/m²].
- class hydpy.models.meteo.LogSequences(master: Sequences, cls_fastaccess: Type[TypeFastAccess_co] | None = None, cymodel: CyModelProtocol | None = None)¶
Bases:
LogSequences
Log sequences of model meteo.
- The following classes are selected:
LoggedSunshineDuration()
Logged sunshine duration [h].LoggedGlobalRadiation()
Logged global radiation [W/m²].LoggedUnadjustedSunshineDuration()
Logged unadjusted sunshine duration [h].LoggedUnadjustedGlobalRadiation()
Logged unadjusted global radiation [W/m²].