We are a collective working to make a free and open source alert & reporting system for Air Quality called "SpikeAlerts".
This code is for the Minneapolis Instance of a SpikeAlerts system.
Users who want to receive alert messages can fill out our survey and have their phone number and location of interest stored in a secure REDCap database hosted by the University of Minnesota.
The program queries the PurpleAir API every 10 minutes (soon we'll have more sensors) and checks for readings above a threshold (35.5 micrograms/meter^3 for sensitive groups, 55.5 for all) according to the current 24-hr EPA Standards for PM2.5. The thresholds are variables that can easily be changed/adjusted. When the system detects a spike, it sends a text to all subscribers within 1 kilometer of the monitor if they don't already have an active alert. The text links to the sensor on the PurpleAir Webmap.
When all alerts end for a user, an end of spike alert message is sent to the subscriber, detailing the length and severity of the event, and a unique reporting option through REDCap. Alerts are archived for future reference (this does not include the user's location/phone number).
Please see the readme in the /Database directory
.env.example
and .env.sensors.example
have some directions on how to create your own environment files. Presently, the extensions are not ready
This can be done in a number of ways (eg. miniconda). The Python requirements are in requirements.txt
. If you use miniconda, below is an example of an environment.yml
file that will set up an environment called SpikeAlerts. You can create this environment with conda env create -f environment.yml
environment.yml:
name: SpikeAlerts
channels:
- conda-forge
- defaults
dependencies:
- python =3.10
- pip
- geopandas
- psycopg2-binary
- python-dotenv
Here's how you can run the app from a terminal:
cd home/Documents/GitHub/SpikeAlerts # Change directory to this Repository
conda activate SpikeAlerts # Activate the Python Environment
python App/spikealerts.py # Run the App
You should be able to see the "Sensors", "Active Alerts", "Archived Alerts", "Places of Interest" tables updating.
We welcome collaboration! Please check out CONTRIBUTING.md
.
Rob Hendrickson
Priya Dalal-Whelan
Dan Raskin
Mateo Frumholtz
Doug Carmody
Jenni Lansing
Lucy Shapiro
Connor Stratton, Urszula Parfieniuk, Michael Wilson, Nazir Khan, Alice Froehlich, Megan Greenberg, Mary Marek-Spartz, Kerry Wang, Daniel Furata, Eamonn Fetherston, Jake Ford
Thank you for organizing, discussion, feedback, research, and everything in between!
We also acknowledge the preliminary work of the Quality Air, Quality Cities team.