epymorph.adrio.humidity
AbsoluteHumidity
Bases: ADRIO[float64, float64]
Calculates absolute humidity (in kilograms per cubic meter) calculated from from air temperature and dew point temperature.
This ADRIO requires two data attributes:
- "temperature": the air temperature in degrees Celsius
- "dewpoint": the dew-point temperature in degress Celsius
requirements
class-attribute
instance-attribute
The attribute definitions describing the data requirements for this function.
For advanced use-cases, you may specify requirements as a property if you need it to be dynamically computed.
result_format
property
result_format: ResultFormat
Information about the expected format of the ADRIO's resulting data.
validate_context
validate_context(context: Context) -> None
Validates the context before ADRIO evaluation.
Parameters:
-
context
(Context
) –The context to validate.
Raises:
-
ADRIOContextError
–If this ADRIO cannot be evaluated in the given context.
inspect
inspect() -> InspectResult[float64, float64]
Produce an inspection of the ADRIO's data for the current context.
When implementing an ADRIO, override this method to provide data fetching and processing logic. Use self methods and properties to access the simulation context or defer processing to another function.
NOTE: if you are implementing this method, make sure to call validate_context
first and _validate_result
last.
Returns:
-
InspectResult[ResultT, ValueT]
–The data inspection results for the ADRIO's current context.
RelativeHumidity
Bases: ADRIO[float64, float64]
Calculates relative humidity as a percentage from air temperature and dew point temperature.
This ADRIO requires two data attributes:
- "temperature": the air temperature in degrees Celsius
- "dewpoint": the dew-point temperature in degress Celsius
requirements
class-attribute
instance-attribute
The attribute definitions describing the data requirements for this function.
For advanced use-cases, you may specify requirements as a property if you need it to be dynamically computed.
result_format
property
result_format: ResultFormat
Information about the expected format of the ADRIO's resulting data.
validate_context
validate_context(context: Context) -> None
Validates the context before ADRIO evaluation.
Parameters:
-
context
(Context
) –The context to validate.
Raises:
-
ADRIOContextError
–If this ADRIO cannot be evaluated in the given context.
inspect
inspect() -> InspectResult[float64, float64]
Produce an inspection of the ADRIO's data for the current context.
When implementing an ADRIO, override this method to provide data fetching and processing logic. Use self methods and properties to access the simulation context or defer processing to another function.
NOTE: if you are implementing this method, make sure to call validate_context
first and _validate_result
last.
Returns:
-
InspectResult[ResultT, ValueT]
–The data inspection results for the ADRIO's current context.
calculate_relative_humidity
calculate_relative_humidity(
temperature: NDArray[float64],
dewpoint: NDArray[float64],
) -> NDArray[float64]
Calculates relative humidity in percent (0 to 100). The calculation is designed to be vectorized over the input arrays, so they must be compatible shapes.
Note: results may exceed 100% if temperature and dew point close in value. There are atmospheric conditions where this can be the case, but in typical usage might be more accurately thought of as data inconsistencies. Thus models that use humidity may wish to cap values in the model.
Parameters:
-
temperature
(NDArray[float64]
) –Air temperature in degrees Celsius.
-
dewpoint
(NDArray[float64]
) –Dew point temperature in degrees Celsius.
Returns:
calculate_absolute_humidity
calculate_absolute_humidity(
temperature: NDArray[float64],
dewpoint: NDArray[float64],
) -> NDArray[float64]
Calculates absolute humidity in kilograms per cubic meter. The calculation is designed to be vectorized over the input arrays, so they must be compatible shapes.
Parameters:
-
temperature
(NDArray[float64]
) –Air temperature in degrees Celsius.
-
dewpoint
(NDArray[float64]
) –Dew point temperature in degrees Celsius.
Returns: