quant-air-pollution-measurement-errors
Provides tools for visually evaluating low-cost air quality sensors
https://github.com/wacl-york/quant-air-pollution-measurement-errors
Science Score: 75.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
✓Institutional organization owner
Organization wacl-york has institutional domain (www.york.ac.uk) -
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.6%) to scientific vocabulary
Repository
Provides tools for visually evaluating low-cost air quality sensors
Basic Info
- Host: GitHub
- Owner: wacl-york
- Language: Python
- Default Branch: main
- Size: 456 KB
Statistics
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
- Releases: 1
Metadata Files
README.md
Air pollution measurement errors: Is your data fit for purpose?
This repository contains Python and R code for reproducing the diagnostic plots shown in Air pollution measurement errors: Is your data fit for purpose? (Diez et al, 2022) published in Atmospheric Measurement Techniques (https://doi.org/10.5194/amt-15-4091-2022).
Python package
To install the Python package, run pip install git+https://github.com/wacl-york/quant-measurement-errors-tools#subdirectory=quantpy.
The quantpy.plots module contains functions to reproduce all 4 of the main plots in the functions: time_series, scatter, bland_altman, reu_plot.
These can be used as follows:
```python import quantpy.plots as plots import pandas as pd import numpy as np import matplotlib.pyplot as plt
Creating a simple dataframe with random reference data
times = pd.date_range('2021-10-01', periods = 1000, freq ='60min') df = pd.DataFrame(np.random.lognormal(mean = 3, sigma = 0.4, size = 1000), columns = ['NO2'], index = times)
Simulate a LCS with noise and bias
df['LCS1'] = (df['NO2'] + np.random.normal(0,3,len(df.index)).tolist())*1.2
plots.bland_altman(df, 'NO2', 'LCS1')
plots.scatter(df, 'NO2', 'LCS1')
plots.reu_plot(df, "NO2", "LCS1", DQO = 25, ylim=[0, 200])
plots.time_series(df, 'NO2', 'LCS1') ```
See the accompanying documentation for further support (i.e. help(plots.bland_altman)).
Furthermore, the quantpy.reu module contains the function reu to calculate the REU.
R package
To install the R code, run devtools::install_github("wacl-york/quant-measurement-errors-tools/quantr") to install the quantr package.
This package contains functions to reproduce all 4 of the main plots in the functions: plot_time_series, plot_scatter, plot_bland_altman, plot_reu.
These can be used as follows:
```r library(quantr)
Create dummy data frame
nvals <- 100 df <- data.frame(timestamp=seq.POSIXt(from=as.POSIXct("2020-09-24 09:00:00"), to=as.POSIXct("2020-09-30 09:00:00"), length.out=nvals), ref=rnorm(nvals, 30, 5), lowcost=rnorm(nvals, 32, 8))
plotreu(df, lcscolumn="lowcost", referencecolumn="ref", ylimits=NULL)
plotscatter(df, lcscolumn="lowcost", reference_column="ref")
plotblandaltman(df, lcscolumn="lowcost", referencecolumn="ref")
plottimeseries(df, lcscolumn="lowcost", referencecolumn="ref") ```
See the accompanying help pages (e.g. ?plot_reu) for further details.
Real world data
The real world air quality measurements that were used to generate some of the figures in the paper are available in the data sub-folder.
See the README in that directory for details on the data structure.
Owner
- Name: Wolfson Atmospheric Chemistry Laboratories (WACL)
- Login: wacl-york
- Kind: organization
- Location: York, England, United Kingdom
- Website: https://www.york.ac.uk/chemistry/research/wacl/
- Repositories: 11
- Profile: https://github.com/wacl-york
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Lacy
given-names: Stuart E
orcid: https://orcid.org/0000-0002-8570-7528
- family-names: Diez
given-names: Sebastian
orcid: https://orcid.org/0000-0001-9659-0356
- family-names: Edwards
given-names: Pete M
title: "wacl-york/quant-air-pollution-measurement-errors: Paper submission"
version: 0.1.0
doi: 10.5281/zenodo.6518027
date-released: 2022-05-04
GitHub Events
Total
- Watch event: 2
Last Year
- Watch event: 2
Dependencies
- matplotlib *
- numpy *
- pandas *
- scipy *
- sklearn *
- dplyr * imports
- ggpointdensity * imports
- ggtext * imports
- tidyr * imports