pyradtran.io.ERA5AtmosphereGenerator#

class pyradtran.io.ERA5AtmosphereGenerator[source]#

Bases: object

Create libRadtran-compatible atmosphere files from ERA5 data.

The output is a three-column radiosonde-style ASCII file (pressure, temperature, water vapour) sorted from TOA to surface, directly consumable by the radiosonde keyword in uvspec.

See also

RadiosondeAtmosphereGenerator

Atmosphere from real soundings.

__init__()#

__init__()

create_era5_atmosphere_file(era5_ds, ...)

Create a radiosonde-style atmosphere file from an ERA5 dataset.

static create_era5_atmosphere_file(era5_ds: Dataset, latitude: float, longitude: float, time: str | datetime | datetime64, output_filepath: str | Path) Path[source]#

Create a radiosonde-style atmosphere file from an ERA5 dataset.

Parameters:
  • era5_ds (xarray.Dataset) – Must contain variables 'z' (geopotential), 't' (temperature), 'q' (specific humidity) on pressure_level coordinates.

  • latitude (float) – Target location for nearest-neighbour selection.

  • longitude (float) – Target location for nearest-neighbour selection.

  • time (str, datetime, or numpy.datetime64) – Target time step.

  • output_filepath (str or pathlib.Path) – Destination file.

Returns:

output_filepath (echoed back for convenience).

Return type:

pathlib.Path

Raises:
  • ValueError – If required variables or coordinates are missing.

  • InputGenerationError – If file writing fails.