uataq.get_network_obs#

uataq.get_network_obs(sites, pollutant, time_range=None, group=None, num_processes=1)[source]#

Get observations for a network of sites for a single pollutant.

Convenience wrapper around Network.get_obs() that combines measurements from multiple sites (stationary and/or mobile) into a single GeoDataFrame.

Parameters:
  • sites (str | list[str] | tuple[str, ...]) – List of site identifiers to include in the network, or 'all' for every configured site (those not measuring the pollutant drop out). A single site ID as a string, such as "TRX01", is a network of that one site, the same as ["TRX01"].

  • pollutant (str) – The pollutant to retrieve observations for (e.g., ‘CO2’, ‘O3’, ‘NO2’).

  • time_range (TimeRange | str | tuple[str | datetime | datetime64 | None, str | datetime | datetime64 | None] | list[str | datetime | datetime64 | None] | slice | None) – The time range to retrieve data for, in UTC (see Time range). Can be a TimeRange object, string, list, or None (all data). Default is None.

  • group (str | Mapping[str, str] | None) – The research group to read data from. A name applies to every instrument; a mapping of instrument name to group name sets it per instrument. Default None selects each instrument’s group automatically (see uataq.instruments.Instrument.resolve_group()).

  • num_processes (int | Literal['max']) – Number of processes to use for parallel data reading. Default is 1.

Returns:

A GeoDataFrame with the following structure:

  • Index: Time_UTC (datetime)

  • Columns: SID, instrument, [pollutant columns], Latitude_deg, Longitude_deg, zagl, geometry; mobile sites also have their speed, course and GPS_Group (see Mobile sites)

  • CRS: EPSG:4326

Return type:

geopandas.GeoDataFrame

Raises:

ReaderError – If none of the sites has data for the pollutant in the range.

Warns:

EmptyResultWarning – If the sites have files for the range but the table has no rows.

Examples

>>> # Get CO2 from multiple sites for January 2024
>>> obs = uataq.get_network_obs(
...     sites=["WBB", "SUG", "RPK"], pollutant="CO2", time_range="2024-01"
... )
>>> # Get O3 from mobile sites for a time range
>>> obs = uataq.get_network_obs(
...     sites=["TRX01", "TRX02"],
...     pollutant="O3",
...     time_range=["2024-01-01", "2024-01-31"],
... )