pyaqsapi package
Subpackages
Submodules
pyaqsapi.bysite module
- pyaqsapi.bycounty.annualsummary(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a DataFrame of annual data aggregated at the county level.
Annual summary contains a DataFrame matching the input parameter, stateFIPS and county_code provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): annual summary data for the
- requested stateFIPS and county combination.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Returns all FRM/FEM PM2.5 data for Wake County, NC between January 1, 2015 - February 28, 2016:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.annualsummary(parameter="88101", bdate=date(year=2016, month=1, day=1), edate=date(year=2016, month=2, day=28), stateFIPS="37", countycode="183", return_header=True)
- pyaqsapi.bycounty.dailysummary(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a DataFrame of data aggregated at the county level.
Daily summary contains a DataFrame matching the input parameter, stateFIPS and county_code provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): blank quality assurance data for
- the requested stateFIPS and county combination.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return an aqs S3 object of daily summary FRM/FEM PM2.5 data for Wake County, NC between January and February 2016:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.dailysummary(parameter="88101", bdate=date(year=2016, month=1, day=1), edate=date(year=2016, month=2, day=28), stateFIPS="37", countycode="183")
- pyaqsapi.bycounty.monitors(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table of monitors.
Return a table of monitors and related metadata at sites with the provided parameter, stateFIPS and county_code for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): monitors from
- the selected stateFIPS and county combination.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return an DataFrame containing all SO2 monitors in Hawaii County, HI that were operating on May 1, 2015:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.monitors(parameter="42401", bdate=date(year=2015, month=5, day=1), edate=date(year=2015, month=5, day=2), stateFIPS="15", countycode="001")
- pyaqsapi.bycounty.qa_annualperformanceeval(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return quality assurance performance evaluation data - aggregated by site for a parameter code aggregated by matching input parameter, stateFIPS and countycode provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance
- performance evaluation data for all monitoring sites for the
- matching countycode and stateFIPS requested for the time frame
- between bdate and edate.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing annual performance evaluation data (raw) for ozone in Baldwin County, AL for 2017 in RD format:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.annualperformanceeval(parameter="44201", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=12, day=31), stateFIPS="01", countycode="003")
- pyaqsapi.bycounty.qa_annualperformanceevaltransaction(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return AQS submissions transaction format (RD) of the annual performance evaluation data (raw). Includes data pairs for QA - aggregated by county for a parameter code aggregated by matching input parameter, countycode and stateFIPS provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance
- performance evaluation data. for all monitoring sites with matching
- countycode and stateFIPS requested for the time frame
- between bdate and edate.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing annual performance evaluation data (raw) for ozone in Baldwin County, AL for 2017 in RD format:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.qa_annualperformanceevaltransaction(parameter="44201", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=12, day=31), stateFIPS="01", countycode="003")
- pyaqsapi.bycounty.qa_blanks(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table of blank quality assurance data. Blanks are unexposed sample collection devices (e.g., filters) that are transported with the exposed sample devices to assess if contamination is occurring during the transport or handling of the samples. Data is aggregated at the county level.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): blank quality assurance data for
- the requested stateFIPS and county combination.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame with PM2.5 blank data for Colbert County, AL for January 2018:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.qa_blanks(parameter="88101", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), stateFIPS="01", countycode="033")
- pyaqsapi.bycounty.qa_collocated_assessments(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table of collocated assessment data aggregated by matching input parameter, stateFIPS and county_code provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance
- collocated assessment data for monitors within a county.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame with collocated assessment data for FRM PM2.5 in Madison County, AL for January 2013:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.qa_collocated_assessments(parameter="88101", bdate=date(year=2013, month=1, day=1), edate=date(year=2013, month=1, day=31), stateFIPS="01", countycode="089")
- pyaqsapi.bycounty.qa_flowrateaudit(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool = False) AQSAPI_V2 | DataFrame
Return Quality assurance flowrate audit data.
Return a table containing flow rate audit data aggregated by parameter code, stateFIPS and countycode for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): flow rate audit data for the
- requested stateFIPS and county combination.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of flow rate audit data for Jefferson County, AL for January 2018:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.qa_flowrateaudit(parameter="88101", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), stateFIPS="01", countycode="033")
- pyaqsapi.bycounty.qa_flowrateverification(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table containing flow rate Verification data for a parameter code aggregated matching input parameter, stateFIPS, and county_code, provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance flow rate
- verification data for monitors within a county.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Returns a DataFrame of flow rate verification data for Colbert County, AL for January 2018:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.qa_flowrateverification(parameter="88101", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), stateFIPS="01", countycode="033")
- pyaqsapi.bycounty.qa_one_point_qc(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table containing flow rate audit data aggregated by parameter code, stateFIPS and countycode for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): flow rate audit data for the
- requested stateFIPS and county combination.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of flow rate audit data for Jefferson County, AL for January 2018:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.qa_flowrateaudit(parameter="88101", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), stateFIPS="01", countycode="033")
- pyaqsapi.bycounty.qa_pep_audit(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table containing quality assurance Performance Evaluation Program (PEP) audit data aggregated by parameter code, stateFIPS and countycode for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance Performance
- Evaluation Program (PEP) audit data for the requested stateFIPS and county
- combination.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Notes
The AQS API only allows for a single year of pep audit data to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).
Examples
Return a DataFrame with PEP Audit data for FRM PM2.5 in Madison County, AL for 2017:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.qa_pep_audit(parameter="88101", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=12, day=31), stateFIPS="01", countycode="089")
- pyaqsapi.bycounty.quarterlysummary(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a DataFrame of quarterly data aggregated at the county level.
Quarterly summary contains a DataFrame matching the input parameter, stateFIPS and county_code provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quarterly summary statistics for
- the given parameter for a single countycode and stateFIPS combination.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Notes
The AQS API only allows for a single year of quarterly summary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).
Also Note that for quarterly data, only the year portion of the bdate and edate are used and all 4 quarters in the year are returned.
Examples
Return a DataFrame containing quarterly summaries for FRM/FEM PM2.5 data for Wake County, NC for each quarter of 2016:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.quarterlysummary(parameter="88101", bdate=date(year=2016, month=1, day=1), edate=date(year=2017, month=2, day=28), stateFIPS="37", countycode="183")
- pyaqsapi.bycounty.sampledata(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, duration: str | None = None, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return sample data where the data is aggregated at the county level.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- durationan optional python character string that represents the
parameter duration code that limits returned data to a specific sample duration. The default value of None results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour carbon monoxide or ozone rolling averages, 3/6 day PM averages or lead 3 month rolling averages. Use aqs_sampledurations() for a list of all available duration codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- durationan optional python character string that represents the
parameter duration code that limits returned data to a specific sample duration. The default value of None results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour carbon monoxide or ozone rolling averages, 3/6 day PM averages or lead 3 month rolling averages. Use aqs_sampledurations() for a list of all available duration codes.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance Performance
- Evaluation Program (PEP) audit data for the requested stateFIPS and county
- combination.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
duration (str | None)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return all FRM/FEM PM2.5 data for Wake County, NC between January 1, 2015 - February 28, 2016:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.sampledata(parameter="88101", bdate=date(year=2015, month=1, day=1), edate=date(year=2016, month=2, day=28), stateFIPS="37", countycode="183")
- pyaqsapi.bycounty.transactionsample(parameter: str, bdate: date, edate: date, stateFIPS: str, countycode: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return transactionsample data - aggregated by county in the AQS Submission Transaction Format (RD) sample (raw) data for a parameter code aggregated by matching input parameter, stateFIPS and countycode provided for bdate - edate time frame. Includes data both in submitted and standard units.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- countycodea python character object which represents the 3 digit
state FIPS code for the county being requested (with leading zero(s)). Use aqs_counties_by_state() for the list of available county codes for each state.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): transaction sample (raw) data
- in the AQS submission transaction format (RD) corresponding to the inputs
- provided.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
countycode (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return all FRM/FEM transaction data for Wake County, NC on February 23, 2016:
import pyaqsapi as aqs from datetime import date ... aqs.bycounty.transactionsample(parameter="88101", bdate=date(year=2016, month=2, day=28), edate=date(year=2016, month=2, day=28), stateFIPS="37", countycode="183")
- pyaqsapi.bystate.annualsummary(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a DataFrame of annual data aggregated at the state level.
Annual summary contains a DataFrame matching the input parameter and stateFIPS provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): annual summary data for the
- stateFIPS requested.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame with all benzene samples from North Carolina collected from May 15th, 1995 - May 15, 1999:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.annualsummary(parameter="45201", bdate=date(year=1995, month=5, day=15), edate=date(year=1999, month=5, day=15), stateFIPS="37")
- pyaqsapi.bystate.dailysummary(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a DataFrame of data aggregated at the state level.
Daily summary contains a DataFrame matching the input parameter and stateFIPS provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): daily summary statistics for the
- given parameter for a single stateFIPS.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of all benzene daily summaries from North Carolina collected on May 15th, 1995:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.dailysummary(parameter="45201", bdate=date(year=1995, month=5, day=15), edate=date(year=1995, month=5, day=15), stateFIPS="37")
- pyaqsapi.bystate.monitors(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) list[DataFrame] | AQSAPI_V2 | DataFrame
Return a table of monitors.
Return a table of monitors and related metadata at all sites with the provided parameter and stateFIPS for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): monitors from the
selected state.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
list[DataFrame] | AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of SO2 monitors in Hawaii that were operating on May 01, 2017.
import pyaqsapi as aqs from datetime import date
- aqs.bystate.monitors(parameter=”88101”,
bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=12, day=31), stateFIPS=”01”)
- pyaqsapi.bystate.qa_annualperformanceeval(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return quality assurance performance evaluation data - aggregated by site for a parameter code aggregated by matching input parameter, and stateFIPS provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance
- performance evaluation data for all monitoring sites for the
- matching parameter and stateFIPS requested for the time frame
- between bdate and edate.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing annual performance evaluation data for ozone in Alabama for 2017:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.qa_annualperformanceeval(parameter="44201", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=12, day=31), stateFIPS="01")
- pyaqsapi.bystate.qa_annualperformanceevaltransaction(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return AQS submissions transaction format (RD) of the annual performance evaluation data (raw). Includes data pairs for QA - aggregated by county for a parameter code aggregated by matching input parameter and stateFIPS provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance
- performance evaluation data. for all monitoring sites with matching
- parameter and stateFIPS requested for the time frame
- between bdate and edate.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing annual performance evaluation data for ozone in Alabama for 2017 in RD format.:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.qa_annualperformanceevaltransaction(parameter="44201", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=12, day=31), stateFIPS="01")
- pyaqsapi.bystate.qa_blanks(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table of blank quality assurance data. Blanks are unexposed sample collection devices (e.g., filters) that are transported with the exposed sample devices to assess if contamination is occurring during the transport or handling of the samples. Data is aggregated at the state level.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance blank sample
- data for all monitors within the input stateFIPS.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame which contains PM2.5 blank data for Alabama for January 2018:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.qa_blanks(parameter="45201", bdate=date(year=1995, month=5, day=15), edate=date(year=1999, month=5, day=15), stateFIPS="37")
- pyaqsapi.bystate.qa_collocated_assessments(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table of collocated assessment data aggregated by matching input parameter and stateFIPS provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance collocated
- assessment data for monitors within a state.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of collocated assessment data for FRM2.5 for January 2013:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.qa_collocated_assessments(parameter="88101", bdate=date(year=2013, month=1, day=1), edate=date(year=2013, month=1, day=31), stateFIPS="01")
- pyaqsapi.bystate.qa_flowrateaudit(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return Quality assurance flowrate audit data.
Return a table of monitors and related metadata at all sites with the provided parameter and stateFIPS for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): monitors from the
selected state.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of flow rate audit data for Alabama in January 2018:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.qa_flowrateaudit(parameter="88101", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), stateFIPS="01")
- pyaqsapi.bystate.qa_flowrateverification(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table containing flow rate Verification data for a parameter code aggregated matching input parameter, and stateFIPS, provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance flow rate
- verification data for monitors within a state.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of flow rate verification data for the state of Alabama for 2017-2019:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.qa_flowrateverification(parameter="88101", bdate=date(year=2017, month=1, day=1), edate=date(year=2019, month=12, day=31), stateFIPS="01")
- pyaqsapi.bystate.qa_one_point_qc(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a DataFrame or an AQS_Data Mart_APIv2 S3 object containing Quality assurance data - flow rate audit raw data aggregated by state FIPS for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): one point qc data within the
- input stateFIPS for bdate - edate time frame..
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of one point QC check data for ozone in Massachusetts in January 2018:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.qa_one_point_qc(parameter="44201", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), stateFIPS="25")
- pyaqsapi.bystate.qa_pep_audit(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table of Performance Evaluation Program (PEP) audit data aggregated by parameter code, and stateFIPS for the time frame between bdate and edate.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance PEP audit data
- within a state.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of PEP audit data for PM2.5 in Alabama 2017:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.qa_pep_audit(parameter="88101", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=12, day=31), stateFIPS="01")
- pyaqsapi.bystate.quarterlysummary(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a DataFrame of quarterly data aggregated at the state level.
Quarterly summary contains a DataFrame matching the input parameter, stateFIPS a provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quarterly summary statistics for
- the given parameter for a all monitors with matching parameter and
- stateFIPS combination within the bdate - edate timeframe.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Notes
The AQS API only allows for a single year of quarterly summary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).
Also Note that for quarterly data, only the year portion of the bdate and edate are used and all 4 quarters in the year are returned.
Examples
Return an aqs S3 object containing quarterly summaries for FRM/FEM PM2.5 data for North Carolina for each quarter of 2016-2017:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.quarterlysummary(parameter="88101", bdate=date(year=2016, month=1, day=1), edate=date(year=2017, month=12, day=31), stateFIPS="37")
- pyaqsapi.bystate.sampledata(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, duration: str | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return sample data where the data is aggregated at the state level.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- durationan optional python character string that represents the
parameter duration code that limits returned data to a specific sample duration. The default value of None results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour carbon monoxide or ozone rolling averages, 3/6 day PM averages or lead 3 month rolling averages. Use aqs_sampledurations() for a list of all available duration codes.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): containing sample data
- for all monitors matching stateFIPS for the given parameter.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
duration (str | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame with all benzene samples from North Carolina collected from May 15th, 1995 - May 15, 1999:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.sampledata(parameter="45201", bdate=date(year=1995, month=5, day=15), edate=date(year=1995, month=5, day=15), stateFIPS="37")
- pyaqsapi.bystate.transactionsample(parameter: str, bdate: date, edate: date, stateFIPS: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return transactionsample data - aggregated by state in the AQS Submission Transaction Format (RD) sample (raw) data for a parameter code aggregated by matching input parameter, and stateFIPS provided for bdate - edate time frame. Includes data both in submitted and standard units.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- stateFIPSa python character object which represents the 2 digit
state FIPS code (with leading zero) for the state being requested. Use aqs_states() for the list of available FIPS codes.
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): transaction sample (raw) data
- in the AQS submission transaction format (RD) corresponding to the inputs
- provided.
- Parameters:
parameter (str)
bdate (date)
edate (date)
stateFIPS (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing benzene transaction sample data for North Carolina on May 15, 1995:
import pyaqsapi as aqs from datetime import date ... aqs.bystate.transactionsample(parameter="45201", bdate=date(year=1995, month=5, day=15), edate=date(year=1995, month=5, day=15), stateFIPS="37")
- pyaqsapi.bybox.annualsummary(parameter: str, bdate: str, edate: str, minlat: str, maxlat: str, minlon: str, maxlon: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) DataFrame | AQSAPI_V2
Return a DataFrame of annual data aggregated by latitude/longitude bounding box (_by_box).
Annual summary contains a DataFrame matching the input parameter for the rectangular area area bounded by minlat, maxlat, minlon, maxlon provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.
- Parameters:
- parametera character string which represents the parameter code of the
air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- minlata python character object which represents the minimum latitude
of a geographic box. Decimal latitude with north begin positive. Only data north of this latitude will be returned.
- maxlata python character object which represents the maximum latitude
of a geographic box. Decimal latitude with north begin positive. Only data south of this latitude will be returned.
- minlona python character object which represents the minimum longitude
of a geographic box. Decimal longitude with east begin positive. Only data east of this longitude will be returned.
- maxlona python character object which represents the maximum longitude
of a geographic box. Decimal longitude with east begin positive. Only data west of this longitude will be returned. Note that -80 is less than -70.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_V2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object) sample data for all monitors
- within the input latitude/longitude bounding box for a single parameter.
- Parameters:
parameter (str)
bdate (str)
edate (str)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
DataFrame | AQSAPI_V2
Examples
Return a DataFrame containing ozone annual summaries in the vicinity of central Alabama for the first two days of May, 2015.
import pyaqsapi as aqs from datetime import date
- aqs.bybox.annualsummary(parameter=”44201”,
bdate=date(year=2015, month=5, day=1), edate=date(year=2015, month=5, day=2), minlat=”33.3”, maxlat=”33.6”, minlon=”-87.0”, maxlon=”-86.7”)
- pyaqsapi.bybox.dailysummary(parameter: str, bdate: date, edate: date, minlat: str, maxlat: str, minlon: str, maxlon: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool = False) DataFrame | AQSAPI_V2
Return a DataFrame of daily summary data aggregated by latitude/longitude bounding box (_by_box).
Daily summary contains a DataFrame matching the input parameter and stateFIPS provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.
- Parameters:
- parametera character string which represents the parameter code of the
air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- minlata python character object which represents the minimum latitude
of a geographic box. Decimal latitude with north begin positive. Only data north of this latitude will be returned.
- maxlata python character object which represents the maximum latitude
of a geographic box. Decimal latitude with north begin positive. Only data south of this latitude will be returned.
- minlona python character object which represents the minimum longitude
of a geographic box. Decimal longitude with east begin positive. Only data east of this longitude will be returned.
- maxlona python character object which represents the maximum longitude
of a geographic box. Decimal longitude with east begin positive. Only data west of this longitude will be returned. Note that -80 is less than -70.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_V2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): daily summary data for all
- monitors within the input latitude/longitude bounding box for a single
- parameter.
- Parameters:
parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
- Return type:
DataFrame | AQSAPI_V2
Examples
Return a DataFrame of ozone daily summaries in the vicinity of central Alabama for the first two days of May 2015:
import pyaqsapi as aqs from datetime import date ... aqs.bybox.dailysummary(parameter="44201", bdate=date(year=2015, month=5, day=1), edate=date(year=2015, month=5, day=2), minlat="33.3", maxlat="33.6", minlon="-87.0", maxlon="-86.7")
- pyaqsapi.bybox.monitors(parameter: str, bdate: date, edate: date, minlat: str, maxlat: str, minlon: str, maxlon: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False)
Return a table of monitors.
Return a table of monitors and related metadata sites with the provided parameter, aggregated by latitude/longitude bounding box (_by_box) for bdate - edate time frame.
- Parameters:
- parametera character string which represents the parameter code of the
air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- minlata python character object which represents the minimum latitude
of a geographic box. Decimal latitude with north begin positive. Only data north of this latitude will be returned.
- maxlata python character object which represents the maximum latitude
of a geographic box. Decimal latitude with north begin positive. Only data south of this latitude will be returned.
- minlona python character object which represents the minimum longitude
of a geographic box. Decimal longitude with east begin positive. Only data east of this longitude will be returned.
- maxlona python character object which represents the maximum longitude
of a geographic box. Decimal longitude with east begin positive. Only data west of this longitude will be returned. Note that -80 is less than -70.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_V2 object.
- Returns:
- pandas DataFrame or an AQSAPI_V2 object
- Returns a table of monitors from a latitude/longitude bounding
- box (_by_box).
- Parameters:
parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
Examples
Return a DataFrame of all ozone monitors in the vicinity of central Alabama that operated in 1995.
import pyaqsapi as aqs from datetime import date
- aqs.bybox.monitors(parameter=”44201”,
bdate=date(year=1995, month=1, day=1), edate=date(year=1995, month=12, day=31), minlat=”33.3”, maxlat=”33.6”, minlon=”-87.0”, maxlon=”-86.7”)
- pyaqsapi.bybox.quarterlysummary(parameter: str, bdate: date, edate: date, minlat: str, maxlat: str, minlon: str, maxlon: str, cbdate: date | None = None, cedate: date | None = None, duration: str | None = None, return_header: bool = False) DataFrame | AQSAPI_V2
Return a DataFrame of quarterly data aggregate by latitude/longitude bounding box (_by_box).
Quarterly summary contains a DataFrame matching the input parameter, stateFIPS and county_code provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.
- Parameters:
- parametera character string which represents the parameter code of the
air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- minlata python character object which represents the minimum latitude
of a geographic box. Decimal latitude with north begin positive. Only data north of this latitude will be returned.
- maxlata python character object which represents the maximum latitude
of a geographic box. Decimal latitude with north begin positive. Only data south of this latitude will be returned.
- minlona python character object which represents the minimum longitude
of a geographic box. Decimal longitude with east begin positive. Only data east of this longitude will be returned.
- maxlona python character object which represents the maximum longitude
of a geographic box. Decimal longitude with east begin positive. Only data west of this longitude will be returned. Note that -80 is less than -70.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_V2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): daily summary data for all
- monitors within the input latitude/longitude bounding box for a single
- parameter.
- Parameters:
parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (date | None)
cedate (date | None)
duration (str | None)
return_header (bool)
- Return type:
DataFrame | AQSAPI_V2
Notes
The AQS API only allows for a single year of quarterly summary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).
Also Note that for quarterly data, only the year portion of the bdate and edate are used and all 4 quarters in the year are returned.
Examples
Return a DataFrame containing ozone quarterly summaries in the vicinity of central Alabama for each quarter in between 2015 - 2017:
from datetime import date import pyaqsapi as aqs ... aqs.bybox.quarterlysummary(parameter="44201", bdate=date(year=2015, month=1, day=1), edate=date(year=2017, month=12, day=31), minlat="33.3", maxlat="33.6", minlon="-87.0", maxlon="-86.7")
- pyaqsapi.bybox.sampledata(parameter: str, bdate: date, edate: date, minlat: str, maxlat: str, minlon: str, maxlon: str, cbdate: date | None = None, cedate: date | None = None, duration: str | None = None, return_header: bool | None = False) DataFrame | AQSAPI_V2
Return sample data where the data is aggregated by latitude/longitude bounding box (_by_box).
If return_header is FALSE (default) this function returns a single DataFrame with the requested data. If return_header is TRUE returns a list of AQSAPI_V2 objects
- Parameters:
- parametera character string which represents the parameter code of the
air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- minlata python character object which represents the minimum latitude
of a geographic box. Decimal latitude with north begin positive. Only data north of this latitude will be returned.
- maxlata python character object which represents the maximum latitude
of a geographic box. Decimal latitude with north begin positive. Only data south of this latitude will be returned.
- minlona python character object which represents the minimum longitude
of a geographic box. Decimal longitude with east begin positive. Only data east of this longitude will be returned.
- maxlona python character object which represents the maximum longitude
of a geographic box. Decimal longitude with east begin positive. Only data west of this longitude will be returned. Note that -80 is less than -70.
- durationan optional python character string that represents the
parameter duration code that limits returned data to a specific sample duration. The default value of None results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour carbon monoxide or ozone rolling averages, 3/6 day PM averages or lead 3 month rolling averages. Use aqs_sampledurations() for a list of all available duration codes.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_V2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): sample data for all monitors
- within the input latitude/longitude bounding box for a single parameter.
- Parameters:
parameter (str)
bdate (date)
edate (date)
minlat (str)
maxlat (str)
minlon (str)
maxlon (str)
cbdate (date | None)
cedate (date | None)
duration (str | None)
return_header (bool | None)
- Return type:
DataFrame | AQSAPI_V2
Examples
Return a DataFrame containing all ozone samples in the vicinity of central Alabama between May 1, 2015 - May 2, 2017.
import pyaqsapi as aqs from datetime import date
- aqs.bybox.sampledata(parameter=”44201”,
bdate=date(year=2015, month=5, day=1), edate=date(year=2015, month=5, day=2), minlat=”33.3”, maxlat=”33.6”, minlon=”-87.0”, maxlon=”-86.7”)
- pyaqsapi.bypqao.qa_annualperformanceeval(parameter: str, bdate: date, edate: date, pqao_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return quality assurance performance evaluation data - aggregated by Primary Quality Assurance Organization (PQAO) for a parameter code aggregated by matching input parameter and pqao_code for the time frame between bdate and edate.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- pqao_codea python character object which represents the 4 digit AQS
Primary Quality Assurance Organization code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance
- performance evaluation data. for single monitoring site for the
- pqao_code requested for the time frame between bdate and edate.
- Parameters:
parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing annual performance evaluation data for ozone where the PQAO is the Alabama Department of Environmental Management (pqao_code 0013).:
from datetime import date import pyaqsapi as aqs ... aqs.bypqao.qa_annualperformanceeval(parameter="44201", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=12, day=31), pqao_code="0013")
- pyaqsapi.bypqao.qa_annualperformanceevaltransaction(parameter: str, bdate: date, edate: date, pqao_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return AQS submissions transaction format (RD) of the annual performance evaluation data (raw). Includes data pairs for QA - aggregated by Primary Quality Assurance Organization (PQAO) for a parameter code aggregated by matching input parameter and pqao_code provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- pqao_codea python character object which represents the 4 digit AQS
Primary Quality Assurance Organization code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance
- performance evaluation data. for single monitoring site for the
- sitenum, countycode and stateFIPS requested for the time frame
- between bdate and edate
- Parameters:
parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing annual performance evaluation data for ozone in where the PQAO is the Alabama Department of Environmental Management (pqao_code 0013) for 2017 in RD format.:
import pyaqsapi as aqs from datetime import date ... aqs.bypqao.qa_annualperformanceevaltransaction(parameter="44201", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=12, day=31), pqao_code="0013")
- pyaqsapi.bypqao.qa_blanks(parameter: str, bdate: date, edate: date, pqao_code: date, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table of blank quality assurance data. Blanks are unexposed sample collection devices (e.g., filters) that are transported with the exposed sample devices to assess if contamination is occurring during the transport or handling of the samples. Data is aggregated by Primary Quality Assurance Organization (PQAO).
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- pqao_codea python character object which represents the 4 digit AQS
Primary Quality Assurance Organization code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance blank data
- for monitors within a pqao.
- Parameters:
parameter (str)
bdate (date)
edate (date)
pqao_code (date)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return DataFrame of PM2.5 blank data in January 2018 where the PQAO is the Alabama Department of Environmental Management (agency 0013):
import pyaqsapi as aqs from datetime import date ... aqs.bypqao.aqs_qa_blanks(parameter="88101", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), pqao_code="0013")
- pyaqsapi.bypqao.qa_collocated_assessments(parameter: str, bdate: date, edate: date, pqao_code: date, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table of blank quality assurance data. Blanks are unexposed sample collection devices (e.g., filters) that are transported with the exposed sample devices to assess if contamination is occurring during the transport or handling of the samples. Data is aggregated by Primary Quality Assurance Organization (PQAO).
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- pqao_codea python character object which represents the 4 digit AQS
Primary Quality Assurance Organization code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance blank data
- for monitors within a pqao.
- Parameters:
parameter (str)
bdate (date)
edate (date)
pqao_code (date)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Returns a DataFrame of collocated assessment data for FRM PM2.5 in January 2013 where the PQAO is the Alabama Department of Environmental Management (agency 0013):
import pyaqsapi as aqs from datetime import date ... aqs.bypqao.qa_collocated_assessments(parameter="88101", bdate=date(year=2013, moth=1, day=1), edate=date(year=2013, month=1, day=31), pqao_code="0013")
- pyaqsapi.bypqao.qa_flowrateaudit(parameter: str, bdate: date, edate: date, pqao_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return Quality assurance flowrate audit data.
Return quality assurance flow rate audit data aggregated by parameter code and Primary Quality Assurance Organization (PQAO) code for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- pqao_codea python character object which represents the 4 digit AQS
Primary Quality Assurance Organization code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): flow rate audit data for the
- requested pqao_code.
- Parameters:
parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of flow rate audit data for January 2018 where the PQAO is the Jefferson County, AL Department Of Health (agency 0550).:
import pyaqsapi as aqs from datetime import date ... aqs.bypqao.qa_flowrateaudit(parameter="88101", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), pqao_code="0550")
- pyaqsapi.bypqao.qa_flowrateverification(parameter: str, bdate: date, edate: date, pqao_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table containing flow rate Verification data for a parameter code aggregated by matching input parameter, and Primary Quality Assurance Organization (PQAO) code provided for bdate - edate time.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- pqao_codea python character object which represents the 4 digit AQS
Primary Quality Assurance Organization code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance flow rate
- verification data for monitors within a pqao.
- Parameters:
parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of collocated assessment data for FRM PM2.5 in January 2013 where the PQAO is the Alabama Department of Environmental Management (agency 0013):
from datetime import date import pyaqsapi as aqs ... aqs.bypqao.aqs_qa_flowrateverification(parameter="88101", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), pqao_code="0013")
- pyaqsapi.bypqao.qa_one_point_qc(parameter: str, bdate: date, edate: date, pqao_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return Quality assurance data - collocated assessment raw data aggregated by Primary Quality Assurance Organization (PQAO) code.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- pqao_codea python character object which represents the 4 digit AQS
Primary Quality Assurance Organization code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): one point qc data within a pqao
- Parameters:
parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFramee of flow rate audit data for January 2018 where the PQAO is the Jefferson County, AL Department of Health (agency 0550):
import pyaqsapi as aqs from datetime import date ... aqs.bypqao.qa_one_point_qc(parameter="44201", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), pqao_code="0550")
- pyaqsapi.bypqao.qa_pep_audit(parameter: str, bdate: date, edate: date, pqao_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table of Performance Evaluation Program (PEP) audit data aggregated by Primary Quality Assurance Organization (PQAO) code for the time frame between bdate and edate.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- pqao_codea python character object which represents the 4 digit AQS
Primary Quality Assurance Organization code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance PEP audit data
- for a Primary Quality Assurance Organization.
- Parameters:
parameter (str)
bdate (date)
edate (date)
pqao_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of PEP audit data in June 2017 where the pqao is the Alabama Department of Environmental Management (agency 0013):
import pyaqsapi as aqs from datetime import date ... aqs.bypqao.qa_pep_audit(parameter="88101", bdate=date(year=2017, month=6, day=1), edate=date(year=2017, month=6, day=30), pqao_code="0013")
- pyaqsapi.byma.qa_annualpeferomanceeval(parameter: str, bdate: date, edate: date, MA_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool = False) AQSAPI_V2 | DataFrame
Return quality assurance performance evaluation data - aggregated by by Monitoring agency (MA) for a parameter code aggregated by matching input parameter and MA_code for the time frame between bdate and edate.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- MA_codea python character object which represents the 4 digit AQS
Monitoring Agency code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance performance
- evaluation data. for all monitoring sites for with the MA_code requested
- for the time frame between bdate and edate.
- Parameters:
parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing annual performance evaluation data for ozone where the monitoring agency is the Alabama Department of Environmental Management (MA_code 0013).:
import pyaqsapi as aqs from datetime import date ... aqs.byma.qa_annualpeferomanceeval(parameter="44201", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=12, day=31), MA_code="0013")
- pyaqsapi.byma.qa_annualperformanceevaltransaction(parameter: str, bdate: date, edate: date, MA_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool = False) AQSAPI_V2 | DataFrame
Return AQS submissions transaction format (RD) of the annual performance evaluation data (raw). Includes data pairs for QA - aggregated by Monitoring agency (MA) for a parameter code aggregated by matching input parameter and MA_code provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- MA_codea python character object which represents the 4 digit AQS
Monitoring Agency code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance performance
- evaluation data in the AQS submissions transaction format (RD)for all sites
- matching the MA_code requested for the time frame between bdate and edate.
- Parameters:
parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing annual performance evaluation data for ozone in where the MA is the Alabama Department of Environmental Management (MA_code 0013) for 2017 in RD format.:
import pyaqsapi as aqs from datetime import date ... aqs.byma.qa_annualperformanceevaltransactionA(parameter="44201", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=12, day=31), MA_code="0013")
- pyaqsapi.byma.qa_blanks(parameter: str, bdate: str, edate: str, MA_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool = False) AQSAPI_V2 | DataFrame
Return a table of blank quality assurance data. Blanks are unexposed sample collection devices (e.g., filters) that are transported with the exposed sample devices to assess if contamination is occurring during the transport or handling of the samples. Data is aggregated by monitoring agency code (MA_code).
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- MA_codea python character object which represents the 4 digit AQS
Monitoring Agency code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance blank sample
- data for all monitors within the input MA_code.
- Parameters:
parameter (str)
bdate (str)
edate (str)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing PM2.5 blank data in January 2018 where the Monitoring Agency is the Alabama Department of Environmental Management (agency 0013):
import pyaqsapi as aqs from datetime import date ... aqs.byma.qa_blanks(parameter="88101", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), MA_code="0013")
- pyaqsapi.byma.qa_collocated_assessments(parameter: str, bdate: date, edate: date, MA_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool = False) AQSAPI_V2 | DataFrame
Return a table of collocated assessment data aggregated by matching input parameter, and monitoring agency (MA) code provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- MA_codea python character object which represents the 4 digit AQS
Monitoring Agency code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance collocated
- assessment data for monitors within a monitoring agency.
- Parameters:
parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing collocated assessment data for FRM PM2.5 January 2013 where the Monitoring Agency is the Alabama Department of Environmental Management (agency 0013):
import pyaqsapi as aqs from datetime import date ... aqs.byma.qa_collocated_assessments(parameter="88101", bdate=date(year=2013, month=1, day=1), edate=date(year=2013, month=1, day=31), MA_code="0013")
- pyaqsapi.byma.qa_flowrateaudit(parameter: str, bdate: date, edate: date, MA_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return Quality assurance flowrate audit data.
Return a table containing flow rate audit data aggregated by parameter code and monitoring agency code (_by_MA) for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- MA_codea python character object which represents the 4 digit AQS
Monitoring Agency code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): flow rate audit data for the
- requested MA_code.
- Parameters:
parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of flow rate audit data for FRM PM2.5 January 2016 - January 2018 where the Monitoring Agency is the Jefferson County, AL Department of Health (agency 0550):
import pyaqsapi as aqs from datetime import date ... aqs.byma.qa_flowrateaudit(parameter="88101", bdate=date(year=2016, month=1, day=1), edate=date(year=2018, month=12, day=31), MA_code="0550")
- pyaqsapi.byma.qa_flowrateverification(parameter: str, bdate: date, edate: date, MA_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool = False) AQSAPI_V2 | DataFrame
Return a table containing flow rate Verification data for a parameter code aggregated by matching input parameter, and monitoring agency (MA) code provided for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- MA_codea python character object which represents the 4 digit AQS
Monitoring Agency code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): flow rate audit data for the
- requested MA_code.
- Parameters:
parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame containing collocated assessment data for FRM PM2.5 January 2013 where the Monitoring Agency is the Alabama Department of Environmental Management (agency 0013):
import pyaqsapi as aqs from datetime import date ... qqs.byma.qa_flowrateverification(parameter="88101", bdate=date(year=2013, month=1, day=1), edate=date(year=2013, month=1, day=31), MA_code="0013")
- pyaqsapi.byma.qa_one_point_qc(parameter: str, bdate: date, edate: date, MA_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool = False) AQSAPI_V2 | DataFrame
Return a table one point QC check data aggregated by monitoring agency code (_by_MA).
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- MA_codea python character object which represents the 4 digit AQS
Monitoring Agency code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): flow rate audit data for the
- requested MA_code.
- Parameters:
parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of ozone One Point QC data in January 2018 where the Monitoring Agency is the Massachusetts Department of Environmental Protection (agency 0660):
import pyaqsapi as aqs from datetime import date ... aqs.byma.qa_one_point_qc(parameter="44201", bdate=date(year=2018, month=1, day=1), edate=date(year=2018, month=1, day=31), MA_code="0660")
- pyaqsapi.byma.qa_pep_audit(parameter: str, bdate: date, edate: date, MA_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool = False) AQSAPI_V2 | DataFrame
Return a table of Performance Evaluation Program (PEP) audit data aggregated by monitoring agency code (_by_MA) for the time frame between bdate and edate.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- MA_codea python character object which represents the 4 digit AQS
Monitoring Agency code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance PEP audit data
- for a monitoring agency.
- Parameters:
parameter (str)
bdate (date)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of PEP audit data in June 2017 where the Monitoring Agency is the Alabama Department of Environmental Management (agency 0013):
import pyaqsapi as aqs from datetime import date ... aqs.byma.qa_pep_audit(parameter="88101", bdate=date(year=2017, month=6, day=1), edate=date(year=2017, month=6, day=30), MA_code="0013")
- pyaqsapi.byma.transactionsample(parameter: str, bdate: str, edate: date, MA_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool = False) AQSAPI_V2 | DataFrame
Return transactionsample data - aggregated by Monitoring agency (MA) in the AQS Submission Transaction Format (RD) sample (raw) data for a parameter code aggregated by matching input parameter, and monitoring agency (MA) code provided for bdate - edate time frame. Includes data both in submitted and standard units.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- MA_codea python character object which represents the 4 digit AQS
Monitoring Agency code (with leading zeroes).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): transaction sample (raw) data in
- the AQS submission transaction format (RD) corresponding to the inputs
- provided.
- Parameters:
parameter (str)
bdate (str)
edate (date)
MA_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of ozone transaction sample data for all monitors operated by South Coast Air Quality Management District collected on May 15, 2015:
import pyaqsapi as aqs from datetime import date ... aqs.byma.transactionsample(parameter="44201", bdate=date(year=2015, month=5, day=15), edate=date(year=2015, month=5, day=15), MA_code="0972")
- pyaqsapi.bycbsa.annualsummary(parameter: str, bdate: date, edate: date, cbsa_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a DataFrame of annual data aggregated at the Core Based Statistical Area (cbsa) level.
Annual summary contains a DataFrame matching the input parameter and cbsa_code provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- cbsa_code: a python character object which represents the 5 digit AQS Core
Based Statistical Area code (the same as the census code, with leading zeros)
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): a DataFrame or an
- AQS_Data Mart_APIv2 object that containing annual summary data for the
- cbsa_code requested.
- Parameters:
parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of annual summary NO2 data the for Charlotte-Concord-Gastonia, NC cbsa on January 01, 2017:
import pyaqsapi as aqs from datetime import date ... aqs.bycbsa.annualsummary(parameter="42602", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=1, day=1), cbsa_code="16740")
- pyaqsapi.bycbsa.dailysummary(parameter: str, bdate: date, edate: date, cbsa_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a DataFrame of data aggregated by Core Based Statistical Area (cbsa).
Daily summary contains a DataFrame matching the input parameter and cbsa_code provided for bdate - edate time frame. Variables returned include mean value, maxima, percentiles, and etc.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- cbsa_code: a python character object which represents the 5 digit AQS Core
Based Statistical Area code (the same as the census code, with leading zeros)
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): a DataFrame or an
- AQS_Data Mart_APIv2 object that containing daily summary data for
- the cbsa_code requested.
- Parameters:
parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Returns a DataFrame of NO2 daily summary data the for Charlotte-Concord-Gastonia, NC cbsa on January 01, 2017:
import pyaqsapi as aqs from datetime import date ... aqs.bycbsa.dailysummary(parameter="42602", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=1, day=1), cbsa_code="16740")
- pyaqsapi.bycbsa.monitors(parameter: str, bdate: date, edate: date, cbsa_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return a table of monitors.
Return a table of monitors at all sites with the provided parameter, aggregated by Core Based Statistical Area (CBSA) for bdate - edate time frame.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- cbsa_code: a python character object which represents the 5 digit AQS Core
Based Statistical Area code (the same as the census code, with leading zeros)
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quality assurance flow rate
- verification data for monitors at a site.
- Parameters:
parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame of NO2 monitors for the Charlotte-Concord-Gastonia, NC cbsa that were operating on January 01, 2017:
import pyaqsapi as aqs from datetime import date ... aqs.bycbsa.monitors(parameter="42602", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=1, day=1), cbsa_code="16740")
- pyaqsapi.bycbsa.quarterlysummary(parameter: str, bdate: date, edate: date, cbsa_code: str, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return quarterly summary data aggregated by Core Based Statistical Area (cbsa_code).
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- cbsa_code: a python character object which represents the 5 digit AQS Core
Based Statistical Area code (the same as the census code, with leading zeros).
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): quarterly summary statistics for
- the given parameter for a all monitors with matching parameter and
- cbsa_code combination within the bdate - edate timeframe.
- Parameters:
parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Notes
The AQS API only allows for a single year of quarterly summary to be retrieved at a time. This function conveniently extracts date information from the bdate and edate parameters then makes repeated calls to the AQSAPI retrieving a maximum of one calendar year of data at a time. Each calendar year of data requires a separate API call so multiple years of data will require multiple API calls. As the number of years of data being requested increases so does the length of time that it will take to retrieve results. There is also a 5 second wait time inserted between successive API calls to prevent overloading the API server. This operation has a linear run time of /(Big O notation: O/(n + 5 seconds/)/).
Also Note that for quarterly data, only the year portion of the bdate and edate are used and all 4 quarters in the year are returned.
Examples
Return a DataFrame of NO2 quarterly summary data the for Charlotte-Concord-Gastonia, NC cbsa for each quarter in 2017.:
import pyaqsapi as aqs from datetime import date ... aqs.bycbsa.quarterlysummary(parameter="42602", bdate=date(year=2017, month=1, day=1), edate=date(year=2017, month=1, day=1), cbsa_code="16740")
- pyaqsapi.bycbsa.sampledata(parameter: str, bdate: date, edate: date, cbsa_code: str, duration: str | None = None, cbdate: date | None = None, cedate: date | None = None, return_header: bool | None = False) AQSAPI_V2 | DataFrame
Return sample data where the data is aggregated at the Core Based Statistical Area (cbsa) level.
- Parameters:
- parametera character list or a single character string
which represents the parameter code of the air pollutant related to the data being requested.
- bdatea python date object which represents that begin date of the data
selection. Only data on or after this date will be returned.
- edatea python date object which represents that end date of the data
selection. Only data on or before this date will be returned.
- cbsa_code: a python character object which represents the 5 digit AQS Core
Based Statistical Area code (the same as the census code, with leading zeros)
- cbdatea python date object which represents a “beginning date of
last change” that indicates when the data was last updated. cbdate is used to filter data based on the change date. Only data that changed on or after this date will be returned. This is an optional variable which defaults to None.
- cedatea python date object which represents an “end date of last
change” that indicates when the data was last updated. cedate is used to filter data based on the change date. Only data that changed on or before this date will be returned. This is an optional variable which defaults to None.
- durationan optional python character string that represents the
parameter duration code that limits returned data to a specific sample duration. The default value of None results in no filtering based on duration code.Valid durations include actual sample durations and not calculated durations such as 8 hour carbon monoxide or ozone rolling averages, 3/6 day PM averages or lead 3 month rolling averages. Use aqs_sampledurations() for a list of all available duration codes.
- return_headerIf FALSE (default) only returns data requested. If TRUE
returns a AQSAPI_v2 object.
- Returns:
- (pandas DataFrame or an AQSAPI_V2 object): sample data for all monitors
- matching cbsa_code for the given parameter.
- Parameters:
parameter (str)
bdate (date)
edate (date)
cbsa_code (str)
duration (str | None)
cbdate (date | None)
cedate (date | None)
return_header (bool | None)
- Return type:
AQSAPI_V2 | DataFrame
Examples
Return a DataFrame which contains NO2 data for Charlotte-Concord-Gastonia, NC cbsa for January 1, 2015 - January 01, 2017:
import pyaqsapi as aqs from datetime import date ... aqs.bycbsa.sampledata(parameter="42602", bdate=date(year=2015, month=1, day=1), edate=date(year=2017, month=1, day=1), cbsa_code="16740")