uataq.sites.Site.read_data#

Site.read_data(instruments='all', group=None, lvl=None, time_range=None, num_processes=1, file_pattern=None)[source]#

Read data for the specified instruments and level.

Parameters:
  • instruments (Literal['all'] | str | list[str] | tuple[str, ...] | set[str]) – The instrument(s) to read data from. If ‘all’, read data from all instruments. Default is ‘all’.

  • 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, by time when the groups’ archives cover different periods: a range crossing a group_dates boundary is read from each group in turn and concatenated (see plan_reads()).

  • lvl (str | None) – The data level to read: 'raw', 'qaqc', 'calibrated' or 'final'. 'final' is the ready-to-share level, with the pipeline’s default flags applied; the lower levels are for finer control. Which to use depends on how clean the data need to be for what you are doing, and on how much control you want over the QAQC. Default is None which reads the highest level available (per group, when the read is split across groups).

  • time_range (TimeRange | str | tuple[str | datetime | datetime64 | None, str | datetime | datetime64 | None] | list[str | datetime | datetime64 | None] | slice | None) – The time range to read data, in UTC (see Time range). Default is None which reads all available data.

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

  • file_pattern (str | None) – Keep only the files whose path contains this text (a plain substring, not a glob or a regular expression). Default is None, which keeps every file. See File pattern.

Returns:

A dictionary containing the data for each instrument.

Return type:

dict[str, DataFrame]

Raises:

uataq.errors.ReaderError – If no data is found for the specified instruments. The message says, for each, why it gave none: the files it looked for, and the first and last period it has files for, or the levels it has when it has none at lvl.