Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert pm25 AQI back to real pm25 level #46

Closed
amaury1093 opened this issue Nov 8, 2018 · 5 comments · Fixed by #52
Closed

Convert pm25 AQI back to real pm25 level #46

amaury1093 opened this issue Nov 8, 2018 · 5 comments · Fixed by #52
Labels
bug Something isn't working

Comments

@amaury1093
Copy link
Member

We use WAQI, and fetch the pm25 level from their database. However, they use a standard to transform raw pm25 level into an AQI.

We need to do the reverse calculation to get the raw pm25 level.

@amaury1093 amaury1093 added the bug Something isn't working label Nov 8, 2018
@amaury1093 amaury1093 added this to Ideas in Sh**t! I Smoke via automation Nov 8, 2018
@amaury1093 amaury1093 mentioned this issue Nov 8, 2018
@jonathanrjpereira
Copy link

So does the app currently use the AQI level or raw PM2.5 level?
i.e Raw PM2.5 is measured in ug/m3.

@amaury1093
Copy link
Member Author

aqi.

@jonathanrjpereira
Copy link

jonathanrjpereira commented Nov 8, 2018

aqi.

I thought so.

According to the WAQI website, the current AQI for my city, Mumbai is 151.
Hence by the current app implementation, the cigarette equivalence will be 151/22=6.86 Cigs.
But this value is incorrect since it is calculated using the AQI level instead of the Raw PM2.5 level.

According to Berkley Earth, 1 cigarette is equivalent to an air pollution of 22 μg/m3 for one day.

The WAQI website uses the US Consulate Real-time Air data(for Indian cities). According to their website, they use the US Environmental Protection Agency (EPA) Air Quality Index. This document published by the EPA gives us an idea of how they convert the Raw PM2.5 level into an AQI level.

From the document, we can observe that the conversion from PM2.5 (in micrograms per cubic meter) to AQI is done in a stepwise linear manner.

Here is how the US Environmental Protection Agency calculates it:
For PM2.5 between 0 and 12, the AQI is linear between 0 and 50
For PM2.5 between 12.1 and 35.4, the AQI is linear between 51 and 100
For PM2.5 between 35.5 and 55.4, the AQI is linear between 101 and 150
For PM2.5 between 55.5 and 150.4, the AQI is linear between 151 and 200
For PM2.5 between 150.5 and 250.4, the AQI is linear between 201 and 300
For PM2.5 between 250.5 and 350.4, the AQI is linear between 301 and 400
For PM2.5 between 350.5 and 500.4, the AQI is linear between 401 and 500

For PM2.5 greater than 500, AQI is not officially defined, but since such levels have been occurring throughout China in recent years, one of two conventions is used. Either the AQI is defined as equal to PM2.5 (in micrograms per cubic meter) or the AQI is simply set at 500.
Note that for PM2.5 of 12, the AQI is 50.

This graph is a great example of the relationship between AQI & Raw PM2.5 level.

IMO we should use the standard defined by the EPA within the above-mentioned document to convert the AQI back into the Raw PM2.5 level & then further convert that value into the equivalent cigarettes.

@amaury1093
Copy link
Member Author

Exactly! Thanks for the detailed report.

Is there any chance you would want to work on this?

@jonathanrjpereira
Copy link

jonathanrjpereira commented Nov 8, 2018

I would love too, but unfortunately, I'm not well versed in JS or mobile app development.

I was planning to build a Physical indicator that indicates the AQI in terms of Cigarettes using a Raspberry Pi(in Python) & some LEDs & I was doing some research on this topic when I stumbled upon your app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Sh**t! I Smoke
  
Ideas
Development

Successfully merging a pull request may close this issue.

2 participants