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
radiosondeatmosphere file.Columns are pressure (hPa), temperature (K), specific humidity (MMR, kg/kg) and — when
o3is 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 matchingradiosondeoption 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 theatmosphere_filevalue at that level.- Parameters:
profile (xarray.Dataset) – Single column, canonical names (see
normalize_era5()), withpressure_levelin hPa and variablestandq.output_filepath (str or pathlib.Path) – Destination file.
include_ozone (bool, default
True) – Write the ozone column when available.
- Return type:
pathlib.Path