stilt.observations.receptors_from_soundings#

stilt.observations.receptors_from_soundings(soundings, kind, *, top)[source]#

Return a receptor for each sounding, and their averaging-kernel table.

Parameters:
  • soundings (DataFrame) – A reader’s table (SOUNDING_SCHEMA), screened as you like, such as df[df.good].

  • kind (Literal['column', 'slant']) – column releases particles along the vertical from the ground to top meters above it, at the sounding’s location (ColumnReceptor). slant releases them at the retrieval’s altitude_levels below surface_altitude + top, along the line of sight given by zenith and azimuth (slant_points()), above sea level.

  • top (float) – Height of the receptor’s top above the surface, in meters.

Return type:

tuple[list[stilt.receptor.Receptor], DataFrame | None]

Returns:

  • receptors (list of Receptor) – One per sounding, in table order, each with the sounding_id as an attribute (a column of receptors.csv).

  • kernels (pandas.DataFrame or None) – The averaging kernels by receptor (averaging_kernel_table()), for project.add_table("kernels", kernels). None when the soundings have no kernel (GGG .oof files).

Raises:

ValueError – If a slant receptor’s columns (altitude_levels, zenith, azimuth) are missing. For OCO-2, which gives pressures only, add altitude_levels from pressure_altitudes() first.

Examples

>>> df = read_tropomi_ch4(
...     path, lon_range=(-113.5, -110.5), lat_range=(39.5, 42)
... )
>>> receptors, kernels = receptors_from_soundings(
...     df[df.good], "slant", top=3000
... )
>>> project.add_receptors(receptors)
>>> project.add_table("kernels", kernels)