How is AQHI calculated?

I’ve been pouring over the minified js code from the map but I can’t figure it out. How does PupleAir calculate the AQHI? There’s no Ozone data from most sensors, so I’m curious what equation/mapping is being used. Would like to provide the same values in my app.

1 Like
export function aqhi(pm) {
    var val = Math.ceil((1000 / 10.4) * (Math.pow(Math.E, 0.000487 * pm) - 1));
    if (val < 1)
        val = 1; // The result is then rounded to the nearest positive integer; 
				 // a calculation less than 0.5 is rounded up to 1.
    return val;

Thanks Adrian! Where pm is the raw PA pm2.5, or is one of the CF applied?

1 Like

Yes, “pm” in the equation is the raw PM2.5 (µg/m3). For indoor sensors, it’s CF1 data, and for outdoor sensors, it’s ATM data.

If, by “CF,” you mean conversion formula, like the US EPA formula, for example, then the answer is that you’ll use whatever your finalized PM value is based on the settings. So, if the user has “US EPA” turned on in the Paku settings, you would pass in the finalized PM value after applying the US EPA formula; otherwise, you would just pass in the raw PurpleAir value.

Awesome, thanks for clarifying Andrew! I’ll do exactly that.

1 Like

Just wanted to point out that this code is always rounding up (ceil) - is that correct?

1 Like

That’s correct; it’s always rounded to the nearest higher integer.

“…the 1-hour 1-pollutant amendment, which is calculated as the ceiling value of the 1-hour PM2.5 concentration divided by 10…”

Trieua et al. (2020)

Hello Kyle,

Adding to the confusion for us in Canada is that the AQHI reported by ECCC is not consistent across Canada. You are likely aware that. Summer 2023 obviously had lots of people looking at the PA map in Canada and the reported AQHI was not lining up with what ECCC reports. Link to a discussion from last summer. Canadian AQHI seems very random - Data - PurpleAir Community