sensortoolkit.reference._ref_api_query.ingest_aqs
- ingest_aqs(data, param, api_param, param_classifier, time_of_query, lookup_table)[source]
Convert AQS query data to SDFS formatted datasets.
- Parameters
data (pandas DataFrame) – Query data received from the AQS API.
param (str) – The name of the SDFS parameter for which data were queried.
api_param (str) – The name assigned by the API service associated with the SDFS parameter for which data will be queried.
param_classifier (str) – A term for sorting the parameter into one of three environmental parameter classifications, either ‘PM’ for particulate matter pollutants, ‘Gases’ for gaseous pollutants, or ‘Met’ for meteorological environmental parameters.
time_of_query (str) – The time of the API query, expressed as a string with datetime format ‘%Y-%m-%d %H:%M:%S’.
lookup_table (pandas DataFrame) – A lookup table of FRM/FEM methods associated with the queried parameter, including the method code for determining the name of the reference instrument if none given. For criteria pollutants, the following lookup table is used (‘<https://aqs.epa.gov/aqsweb/documents/codetables/methods_criteria.html>’_). For meteorological parameters, the following lookup table is used (https://aqs.epa.gov/aqsweb/documents/codetables/methods_met.html)
- Returns
two-element tuple containing:
data (pandas DataFrame): SDFS formatted dataset.
idx (pandas DateTimeIndex): The datetime index (UTC) for the data received from the API query.
- Return type
(tuple)