I have been working on showing data from PurpleAir Layer onto a map in the form of a HeatMap .
Public Lab is an open community which collaboratively develops accessible, open source, Do-It-Yourself technologies for investigating local environmental health and justice issues.
As an open source community, we believe in open licensing of content so that other members of the community can leverage your work legally -- with attribution, of course. By joining the Public Lab site, you agree to release the content you post here under a Creative Commons Attribution Sharealike license, and the hardware designs you post under the CERN Open Hardware License 1.1 (full text). This has the added benefit that others must share their improvements in turn with you.
I just reviewed this conversation and would like to add to it and would like comments from @sagarpreet and @guolivar if possible. About the USEPA AQI: if you look again at the table and formula @sagarpreet posted above you will notice the column for pm2.5 refers to a 24 hr average. If the point is to inform about the current air quality someone might breath in, a 24 hour average based upon the past 24 hours is not useful.Particulate in the past is not what will enter your breathing now. The pm2.5 standard is based upon a 24 hour average and to keep within the context of the standards, against which all the "health" research has been based, the EPA AQI uses an average of the past 12 hours with an estimation (prediction) of the next 12 hours to assess the air NOW. If you are not able to do that prediction part, you will be misappropriating the risk (health) aspect of the formula and possibly misinforming those you want to communicate with. If you are not able to do the prediction part I maintain you should provide information stating you are using a modified and unassessed version of the USEPA AQI. My suspicion is that PurpleAir does not do this prediction part and, as many people do, takes the most current reading or average over a short period of time, and plugs it into the formula in place of the correct 24 hour past and future average.
Whether you use the AQI or particulate density this addresses the color you use and its risk assessment (or actually misappropriation of risk assessment!)
Reply to this comment...
Thanks for reply :)
Yes the unit is in ug/m3 .
Reply to this comment...
Can someone also help me with this ?
I have 2 options for making heatmap :
1.) Either use global maxima and global minima value (of PM2.5 in ug/m3) to make heat map .
2.) Or to use only the values which are in the current viewport of the map .
This might get rambly because there is no right answer but I'll try to explain why and what then.
The first thing you need to understand is that all AQ indices are designed for COMMUNICATION purposes so the question is not "should I report concentrations or indices?" but rather "what am I trying to communicate?"
There are many indices and all of them serve different purposes.
Some are "regulation" related so they refer to the corresponding regulation limits. These are pollutant dependent so you can have a high index for PM2.5 and a low index for Ozone at the same time which will mean that concentrations of PM2.5 are near or above the standard (whatever that is) while Ozone concentrations are well below the standard.
Now, there is an argument that the standards have very little meaning for the general public as their meaning is unclear and they are defined on many different time bases. So, that's where the "health effect based" indices come in. They try to communicate "risk to people" rather than "state of the air" so a high index value would mean that there is a high risk of a health impact (whatever that may be) with these conditions... that's what the AQI tries to do
In general, if you want people to do somehting, show them something they can understand so AQI's are much more useful for that BUT you need to be VERY careful with the averaging times you're using and you need to be very transparent on where you got the calculations from because if you tell people that their air is OK but it isn't, you're in trouble.
So ... decide what you want to communicate and run with it documenting your sources.