pyradtran.era5.write_atmosphere_file

pyradtran.era5.write_atmosphere_file#

pyradtran.era5.write_atmosphere_file(profile: Dataset, output_filepath: str | Path, include_ozone: bool = True) Path[source]#

Write a profile as a libRadtran radiosonde atmosphere file.

Columns are pressure (hPa), temperature (K), specific humidity (MMR, kg/kg) and — when o3 is present and include_ozone is true — ozone MMR. The column layout is recorded in a machine-readable header line (# columns: H2O MMR O3 MMR) that the input builder reads back to construct the matching radiosonde option line.

Levels containing NaN pressure/temperature/humidity (e.g. ERA5 levels below the surface) are dropped; NaN ozone values become -1, which tells libRadtran to fall back to the atmosphere_file value at that level.

Parameters:
  • profile (xarray.Dataset) – Single column, canonical names (see normalize_era5()), with pressure_level in hPa and variables t and q.

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

  • include_ozone (bool, default True) – Write the ozone column when available.

Return type:

pathlib.Path