from epymorph.kit import *
from epymorph.adrio import us_tiger, prism, humidity
Humidity
Description
The Humidity ADRIO outputs the calculated humidity for a provided location at a given time.
This ADRIO can compute either relative or absolute humidity. Absolute humidity is the mass of water vapor per volume of moist air, represented in kilograms per cubic meter. Relative humidity is the percentage of the absolute humidity “relative” to the maximum humidity according to the temperature, which is what is most commonly shown in typical daily weather reports.
The ADRIO requires dew point and regular temperature parameters to calculate the desired form of humidity, which pairs well with the PRISM ADRIO as it can provide both of these values.
Humidity ADRIO
- Put any necessary imports for the Humidity ADRIO
- Specify the locations and date range for calculation.
= StateScope.in_states(["FL", "GA", "MD", "NC"], year=2020)
scope = TimeFrame.range("2015-09-01", "2015-09-10") time_frame
Relative Humidity (%)
- Call the RelativeHumidity ADRIO, which requires a centroid, temperature, and dewpoint parameter.
with sim_messaging(live=False):
= (
relH
humidity.RelativeHumidity()
.with_context(=scope,
scope=time_frame,
time_frame={
params"centroid": us_tiger.GeometricCentroid(),
"temperature": prism.Temperature("Mean"),
"dewpoint": prism.DewPoint(),
},
)
.evaluate() )
Loading (unspecified)::(unspecified)::centroid (epymorph.adrio.us_tiger.GeometricCentroid):
|####################| 100% (1.795s)
Loading (unspecified)::(unspecified)::temperature (epymorph.adrio.prism.Temperature):
|####################| 100% (7.805s)
Loading (unspecified)::(unspecified)::dewpoint (epymorph.adrio.prism.DewPoint):
|####################| 100% (6.653s)
Loading (unspecified)::(unspecified)::(unspecified) (epymorph.adrio.humidity.RelativeHumidity):
|####################| 100% (0.000s)
print(f"States: {scope.node_ids}\n")
print(f"Relative Humidity %:\n {relH}\n")
States: ['12' '13' '24' '37']
Relative Humidity %:
[[82.29247707 78.73673715 70.56217196 90.31227335]
[85.25185444 72.48473366 67.41792538 70.68458439]
[78.29976357 75.54821181 67.15069971 67.48447965]
[77.32186688 80.19254851 67.01082176 70.51711361]
[79.93455281 68.10161981 67.9206651 69.85678071]
[75.81833625 71.89186563 74.84465422 76.6365127 ]
[74.34317473 75.70718238 60.61078428 80.48693349]
[84.95526673 81.65340323 67.8126301 76.89748941]
[81.79063605 78.07472153 66.82747446 78.40718529]
[78.33560913 78.30970421 66.91818963 76.00375206]]
Absolute Humidity (kg/m3)
- Call the AbsoluteHumidity ADRIO, which requires a centroid, temperature, dewpoint, and relative humidity parameter.
with sim_messaging(live=False):
= (
absH
humidity.AbsoluteHumidity()
.with_context(=scope,
scope=time_frame,
time_frame={
params"centroid": us_tiger.GeometricCentroid(),
"temperature": prism.Temperature("Mean"),
"dewpoint": prism.DewPoint(),
"relativehumidity": humidity.RelativeHumidity(),
},
)
.evaluate() )
Loading (unspecified)::(unspecified)::centroid (epymorph.adrio.us_tiger.GeometricCentroid):
|####################| 100% (1.667s)
Loading (unspecified)::(unspecified)::temperature (epymorph.adrio.prism.Temperature):
|####################| 100% (0.133s)
Loading (unspecified)::(unspecified)::dewpoint (epymorph.adrio.prism.DewPoint):
|####################| 100% (0.138s)
Loading (unspecified)::(unspecified)::(unspecified) (epymorph.adrio.humidity.AbsoluteHumidity):
Loading (unspecified)::(unspecified)::(unspecified) (epymorph.adrio.humidity.RelativeHumidity):
|####################| 100% (0.000s)
|####################| 100% (0.000s)
print(f"States: {scope.node_ids}\n")
print(f"Absolute Humidity in kilograms/m^3:\n {absH}\n")
States: ['12' '13' '24' '37']
Absolute Humidity in kilograms/m^3:
[[0.02157049 0.01756676 0.01619405 0.01713875]
[0.02196012 0.01795541 0.01697285 0.01679116]
[0.02144872 0.0191554 0.0165168 0.01696885]
[0.02165772 0.01945792 0.0170474 0.01703492]
[0.02040071 0.01781235 0.01724438 0.01715848]
[0.02036741 0.01728276 0.0145759 0.01683907]
[0.02004383 0.01709421 0.01193905 0.01717102]
[0.02104921 0.01831033 0.01569843 0.01734535]
[0.02111527 0.01925519 0.01722752 0.01858397]
[0.02167872 0.01893431 0.01819047 0.01919721]]