pyradtran.clouds

pyradtran.clouds#

Cloud utilities for pyRadtran.

This module provides tools to create libRadtran-compatible cloud input files from various data sources. The typical workflow is:

  1. Build a list of CloudLayer objects — either from simple parameters (CloudGenerator.from_simple_parameters()) or from an ERA5 dataset (CloudGenerator.from_era5_dataset()).

  2. Write the layers to a .dat file with CloudFileWriter.

  3. Pass the file path to ds.pyradtran.run() via parameter_overrides={'wc_file 1D': 'my_cloud.dat'}.

Examples

Create a simple water cloud and write it to a file:

>>> from pyradtran.clouds import CloudGenerator, CloudFileWriter
>>> from pathlib import Path
>>> layers = CloudGenerator.from_simple_parameters(
...     z_base_km=1.0, z_top_km=2.0, lwc_g_m3=0.3, r_eff_um=10.0, n_layers=5
... )
>>> CloudFileWriter.write_water_cloud_file(layers, Path("work/wc.dat"))

See also

pyradtran.config.CloudParameters

Declarative cloud settings in YAML configs.

generate_cloud_file_from_era5(era5_dataset, ...)

One-step cloud-file generation from an ERA5 dataset.

CloudFileWriter()

Persist CloudLayer sequences as libRadtran .dat files.

CloudGenerator()

Factory for CloudLayer sequences.

CloudLayer(z_bottom_km, z_top_km[, ...])

A single cloud layer with vertical extent and microphysical properties.