stilt.observations.read_ggg_netcdf#

stilt.observations.read_ggg_netcdf(path, species, *, time_range=None)[source]#

Read a GGG2020 netCDF file, private or public, into a table of soundings.

GGG writes a *.private.nc for each run. A *.public.nc or *.public.qc.nc is the TCCON release of the same layout. A public file stores the averaging kernel per spectrum. A private file stores a table against slant xgas, which is interpolated for each spectrum as GGG’s public writer does, using the O2-window airmass (o2_7885_am_o2).

Parameters:
  • path (str | Path) – The netCDF file.

  • species (str) – Column variable to read: xco2, xch4, xco, xn2o, or xh2o.

  • time_range (tuple[Any, Any] | None) – (start, stop) times. Only spectra between them are read, which helps with a multi-year site file.

Returns:

One row per spectrum. value and uncertainty are the species and its one-sigma error, in the file’s units. good is flag == 0, or True everywhere in a qc file without a flag, which holds only good data. ak is the kernel on the site’s fixed ak_pressure grid (median pressures, hPa), and ak_extrapolated marks spectra beyond a private file’s kernel table. apriori is the prior profile in the species’ units. pressure_levels (hPa) and altitude_levels (m above sea level) are the prior’s grid, from the surface up, ready for pressure_altitudes() and slant_points(). surface_altitude is the instrument’s altitude and surface_pressure the pressure it measured. zenith and azimuth are the solar angles, the direction the instrument looks. sounding_id is the spectrum name when the file has it, else the site and time.

Return type:

DataFrame