supy.util.read_epw

Contents

Tip

  1. Need help? Please let us know in the SUEWS Community.

  2. Please report issues with the manual on GitHub Issues (or use Report Issue for This Page for page-specific feedback).

  3. Please cite SUEWS with proper information from our Zenodo page.

6.3.2.2. supy.util.read_epw#

supy.util.read_epw(path_epw: Path, target_height: float = 10.0, z0m: float = 0.1) DataFrame[source]#

Read in EPW (EnergyPlus Weather) file as a DataFrame.

Parameters:
  • path_epw (Path) – Path to EPW file.

  • target_height (float, optional) – Target height for wind speed extrapolation [m]. EPW files contain wind speed at 10 m agl. If target_height differs from 10 m, the wind speed will be adjusted using a logarithmic wind profile. Default is 10.0 (no correction applied).

  • z0m (float, optional) – Roughness length for momentum [m], used in wind profile correction. Typical values: 0.01 (open water), 0.1 (grassland), 0.5-2.0 (urban). Default is 0.1.

Returns:

df_tmy – DataFrame containing weather data with columns named according to EPW standard variable names.

Return type:

pd.DataFrame

Notes

Measurement Height Assumptions

EPW files follow standard meteorological station conventions:

  • Wind Speed: 10 m above ground level (agl)

  • Temperature and Humidity: 2 m agl (screen height)

When using EPW data with SUEWS, ensure the forcing height parameter z in your site configuration matches these heights. For EPW data, set z = 10 to match the wind speed measurement height.

Wind Speed Height Correction

If target_height != 10.0, the wind speed is adjusted using the logarithmic wind profile (assuming neutral atmospheric conditions):

\[U(z_2) = U(z_1) \frac{\ln((z_2 + z_0) / z_0)}{\ln((z_1 + z_0) / z_0)}\]

where \(z_1 = 10\) m (EPW height), \(z_2\) is the target height, and \(z_0\) is the roughness length.

Warning

The log-law profile assumes neutral atmospheric stability. Under strongly stable or unstable conditions, actual wind profiles may differ significantly from this approximation.

See also

gen_epw

Generate EPW file from SUEWS simulation output.

supy.util.gen_forcing_era5

Generate forcing from ERA5 (extrapolated to user-specified height).

Examples

>>> import supy as sp
>>> from pathlib import Path
>>>
>>> # Read EPW file without height correction (default)
>>> df_epw = sp.util.read_epw(Path("weather.epw"))
>>>
>>> # Read EPW file and extrapolate wind speed to 50 m
>>> df_epw = sp.util.read_epw(
...     Path("weather.epw"),
...     target_height=50.0,
...     z0m=0.5,  # urban roughness length
... )