uataq.Network#

class uataq.Network(sites, pollutant, group=None)[source]#

Container for combining and analyzing data across multiple sites for a single pollutant.

This class aggregates measurements from multiple sites (stationary and/or mobile) for a single pollutant, handling spatial coordinates appropriately for each site type.

Variables:
  • sites (list[str]) – The IDs of the sites the network kept, in the order given: a site that is misspelled or does not measure the pollutant is not in the list. A site named twice is listed once.

  • pollutant (str) – The pollutant to retrieve data for (uppercase).

  • site_objects (list[sites.Site]) – The Site or MobileSite object of each site in sites.

  • group (str | Mapping[str, str] | None) – The research group to read data from, or None to select each instrument’s group automatically.

__init__(sites, pollutant, group=None)[source]#

Initialize a Network object.

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 "WBB", is a network of that one site, the same as ["WBB"].

  • pollutant (str) – The pollutant to measure. Will be converted to uppercase. Examples: ‘CO2’, ‘O3’, ‘NO2’, ‘PM2.5’, ‘BC’

  • 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()).

Raises:

ValueError – If sites is empty or if none of the sites given measures the specified pollutant. The message names the sites given (their number when there are more than ten) and lists the sites in the configuration that do measure it.

Methods

get_availability([time_range, freq, lvls, ...])

Find when each site has data for the pollutant, and at what level.

get_obs([time_range, num_processes])

Get observations for the network across all sites.

plot_availability([availability, ax])

Plot when each site has data for the pollutant, colored by level.