Values shown on map don't match the sensor time series when EPA conversion is applied

Found the bug, in the class definition for the US EPA conversion (in the Modern map code, file pa.map.2.0.11-SNAPSHOT.modern.js):

      getGraphValueFromData(t, e, i, r) {
        return 'inside' == e.location_type ? this.calculate_cf(t[this.getDataHeaderIndex('pm2.5_cf_1_' + i)], t[this.getDataHeaderIndex('humidity_a')]) : this.calculate_cf(t[this.getDataHeaderIndex('pm2.5_atm_' + i)], t[this.getDataHeaderIndex('humidity_a')])
      }

That second half of the conditional, used for outside sensors, should call calculate_atm() and not calculate_cf(). Thus the graph is using the adjustment for CF_1 on CF_ATM data. By comparison, extractValue() is using the correct conversion function, and that function is used for the popup.

As noted in another thread, be careful comparing PA map data to the EPA’s Fire & Smoke Map (FSM). FSM is using a value run through their NowCast algorithm (a weighted average over the last 11 hours in 10-minute chunks) vs. the PurpleAir map which is either an instantaneous real-time value or a rolling average over a set time period. NowCast is resistant to short-term spikes.

3 Likes