pyradtran.io.ERA5AtmosphereGenerator.create_era5_atmosphere_file#
- static ERA5AtmosphereGenerator.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) onpressure_levelcoordinates.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.