The Parameter Object

This section provides a brief overview of the Parameter object. For more detailed documentation, please see API documentation for sensortoolkit.parameter.

Overview

The parameter object is used to keep track of attributes pertaining to the parameter or pollutant for which sensor data are being evaluated. The table below describes in detail the attributes contained within a parameter instance, and the Parameter class comes with numerous pre-configured parameters (including all criteria pollutants).

Tip

A full list of pre-configured parameters, including all criteria pollutants and meteorological parameters such as temperature, relative humidity, etc. can be accessed via:

sensortoolkit.Parameter.__param_dict__.keys()

For example, a Parameter instance called pollutant can be created for the pollutant PM2.5 by specifying the SDFS parameter name PM25:

pollutant = sensortoolkit.Parameter('PM25')

Attributes

sensortoolkit.Parameter() attributes

Attribute name

Description

Example: PM25

name

The SDFS name for the parameter

'PM25'

format_name

A formatted expression for the parameter used
for displaying the name of the parameter on
plots.

'PM$_{2.5}$'

format_baseline

For format_name, contains the baseline
component of the parameter name.

'PM'

format_subscript

For format_name, contains the subscripted
component of the parameter name

'2.5'

classifier

A term for sorting the parameter into one of
three environmental parameter classifications,
either ‘PM’ for particulate matter pollutants,
‘Gases’ for gaseous pollutants, or ‘Met’ for
meteorological environmental parameters.

'PM'

units

The units of measure, expressed symbolically
in Unicode characters.

'µg/m³'

units_description

A textual description of the units of measure.

'Micrograms per Cubic Meter'

units_aqs_code

The AQS unit code, useful for AQS queries 1.

105

criteria_pollutant

Boolean, describes whether the parameter is a
criteria pollutant (True) or non-criteria
(False).

True

aqs_parameter_code

The AQS Parameter code, useful for AQS
queries 2.

88101

averaging

The reference measurement averaging intervals
commonly utilized for analyzing parameter data.
Common averaging intervals are included
in a list 3.

['1-hour', '24-hour']

PerformanceTargets

Performance metrics, target values and ranges
associated with the parameter. Preset values
are configured for PM25 and O3 using
U.S. EPA’s recommended performance metrics
and targets.

See “Performance Metrics
and Target Values Section”.

Footnotes

1

A list of AQS unit codes is located at https://aqs.epa.gov/aqsweb/documents/codetables/units.html

2

A list of AQS parameter codes is located at https://aqs.epa.gov/aqsweb/documents/codetables/parameters.html

3

Reference data for particulate matter are commonly analyzed at either 1-hour or 24-hour intervals, but other pollutants that are strongly correlated with diurnal variability such as ozone are typically analyzed exclusively at high time resolution such as 1-hour intervals)

Performance Metrics and Target Values

Each parameter object comes with a subclass PerformanceTargets that contains metric descriptions, target ranges, and target values for conducting performance evaluations for sensor data corresponding to the parameter of interest.

For PM2.5 and O3, U.S. EPA’s recommended performance metrics and target values are included in the pre-configured scheme for these parameters. A full description of all metric names and target values/ranges can be accessed for a parameter instance via:

all_metrics = pollutant.PerformanceTargets.get_all_metrics()

Continuing with the example for PM2.5, the all_metrics variable should contain the following information:

{'Bias':
          {'Slope':
            {'description': 'Ordinary least squares regression slope',
             'bounds': (0.65, 1.35),
             'goal': 1.0,
             'metric_units': None},
          'Intercept':
            {'description': 'Ordinary least squares regression intercept',
             'bounds': (-5.0, 5.0),
             'goal': 0.0,
             'metric_units': '$\\mu g/m^3$'}
           },
 'Linearity':
          {'R^2':
            {'description': 'Coefficient of determination',
             'bounds': (0.7, 1.0),
             'goal': 1.0,
             'metric_units': None}
             },
 'Error':
          {'RMSE':
            {'description': 'Root mean square error',
             'bounds': (0.0, 7.0),
             'goal': 0.0,
             'metric_units': '$\\mu g/m^3$'},
          'NRMSE':
            {'description': 'Normalized root mean square error',
             'bounds': (0.0, 30.0),
             'goal': 0.0,
             'metric_units': '%'}
             },
 'Precision':
          {'SD':
            {'description': 'Standard deviation',
             'bounds': (0.0, 5.0),
             'goal': 0.0,
             'metric_units': '$\\mu g/m^3$'},
          'CV':
            {'description': 'Coefficient of variation',
             'bounds': (0.0, 30.0),
             'goal': 0.0,
             'metric_units': '%'}
             }
 }

Individual metric target values and ranges can be accessed via the get_metric() method. The example below is for accessing the description of the Slope performance metric:

metric = pollutant.PerformanceTargets.get_metric(metric_name='Slope')

Continuing with the example for PM2.5, the metric variable should contain the following information:

{'description': 'Ordinary least squares regression slope',
 'bounds': (0.65, 1.35),
 'goal': 1.0,
 'metric_units': None}

Setting Performance Targets and Metrics

For SDFS parameters that do not have preset performance targets or metrics, users can configure custom metric categories via the pollutant.PerformanceTargets.set_metric_category() method and target values via the pollutant.PerformanceTargets.set_metric() method. A detailed description and examples for both of these methods is included in the API documentation for sensortoolkit.parameter.PerformanceTargets.