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
Attribute name |
Description |
Example: |
---|---|---|
|
The SDFS name for the parameter |
|
|
A formatted expression for the parameter used |
|
|
For |
|
|
For |
|
|
A term for sorting the parameter into one of |
|
|
The units of measure, expressed symbolically |
|
|
A textual description of the units of measure. |
|
|
The AQS unit code, useful for AQS queries 1. |
|
|
Boolean, describes whether the parameter is a |
|
|
The AQS Parameter code, useful for AQS |
|
|
The reference measurement averaging intervals |
|
|
Performance metrics, target values and ranges |
See “Performance Metrics |
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.