uataq.get_obs#
- uataq.get_obs(SID, pollutants='all', format='wide', group=None, time_range=None, num_processes=1, **kwargs)[source]#
Get observations from a site.
- Parameters:
SID (
str) – The site ID.pollutants (
Literal['all'] |str|list[str] |tuple[str,...] |set[str]) – The pollutant(s) to get observations for.format (
Literal['wide'] |Literal['long']) – The format of the data. Default is ‘wide’.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 (seeuataq.instruments.Instrument.resolve_group()).time_range (
TimeRange|str|tuple[str|datetime|datetime64|None,str|datetime|datetime64|None] |list[str|datetime|datetime64|None] |slice|None) – The time range to get observations, in UTC (see Time range). Default is None which gets all available data.num_processes (
int|Literal['max']) – The number of processes to use. Default is 1.kwargs – Additional keyword arguments to pass to the site’s get_obs method. The only one a site takes is
include_gps(Falsereturns a mobile site’s rows without a position; see Include GPS).
- Returns:
The observations, from the
finallevel (seeuataq.read_data()to read another level), with aninstrumentcolumn naming the instrument each row came from. At a mobile site it is ageopandas.GeoDataFramethat also has the position of each row (see Mobile sites).- Return type:
- Raises:
ReaderError – If no instrument at the site has data for the pollutants in the range. The message says why for each one (see When there is nothing to read).
ValueError – If a pollutant is not measured at the site. The message says which pollutants the site does measure.
TypeError – If you pass
lvlorlevel:get_obsalways reads thefinallevel. Useuataq.read_data()to read another.
- Warns:
EmptyResultWarning – If the site has files for the range but no data in them, so the table has no rows; at a mobile site also when there are rows but none found a GPS fix.
DroppedPollutantWarning – If you name several pollutants and one of them has no data in the range, so the table leaves it out.