feinstaub-map icon indicating copy to clipboard operation
feinstaub-map copied to clipboard

Set realistic value range for color gradient

Open rashfael opened this issue 7 years ago • 16 comments

Currently the color range spans dynamically from 0(green) to the highest value(red). This leads to most of the cells showing green, even if they are over the threshold, when some sensor reports weird, high values.

How to fix it:

  • Define a hard color range with proper thresholds.
  • Don't use the data from the PPD42NS sensors for the color range, because they are not reliable.

I'd be happy to implement this, somebody just needs to tell me some thresholds (Grenzwerte) for the data from SDS011. I can then also add a useful legend.

rashfael avatar Nov 22 '16 13:11 rashfael

Hey rash!

On 22.11.2016 14:24, rash wrote:

Currently the color range spans dynamically from 0(green) to the highest value(red). This leads to most of the cells showing green, even if they are over the threshold, when some sensor reports weird, high values.

How to fix it: - Define a hard color range with proper thresholds. - Don't use the data from the PPD42NS sensors for the color range, because they are not reliable.

True, this is necessary. Rajko has some forks running here: https://www.madavi.de/ok-lab-stuttgart/

can you please update to get data from cached json? // var URL = 'https://api.luftdaten.info/v1/now/'; var URL = 'https://www.madavi.de/sensor/feinstaub-map-sds/data.json';

I'd be happy to implement this, somebody just needs to tell me some thresholds (Grenzwerte) for the data from SDS011. I can then also add a useful legend.

Legend values for SDS sensors, which are relevant: 50 µg/l is the official threshold (as the mean over day), from there on it should be "alarm color", max. measurement value is 1999.

BTW, red-green blindness is an issue, maybe take blue (= clean air) to red, if possible.

So, here is my suggestion: 0 blue #00000FF 50 blue+red RGB #FF00FF 2000 red

maybe brightness can be added, I tried for example 0-50 #00000FF #0000055 50-2000 #5500000 #FF00000

0-50 #FFFFFF #00000FF 50-2000 #FF00000 #0000000

then it is blue/red according to threshold, and brightness tells you "how much away from it".

50-2000 may be non-linealy scaled, as 1000 should be the max observed (e.g. at Silvester), everything else is a smoker directly blowing into it...

Marwe avatar Nov 22 '16 16:11 Marwe

One issue we found is, that the map does not work on any mobile browser. Is there any chance for this? Do you have an idea why it might not be working?

Marwe avatar Nov 22 '16 16:11 Marwe

What browsers did you test it on? The number panel does not work, because it does not listen on touch events, but the map should render (it does on my Android/Chrome).

rashfael avatar Nov 22 '16 17:11 rashfael

Hi rashfael,

would be nice, if you could change the data path to the cached version (sometimes timeout of 10 sec. is reached). The actual map shows all sensors. A map with a selection of sensor type (PPD42NS with parts per liter, SDS011 as default with µg per m3, DHT22) would be nice.

For the SDS011 possible threshold values could be: Green 0-40 Yellow 41-60 Orange 61-80 Red 81-1999

Threshold values for the PPD42NS are difficult. For this sensor the actual solution works.

For the DHT22 the hexagons could be gray and mouseover shows the values for temp and humidity.

Is it possible to "activate" touch events? Touch should be the same like mouseover, showing the values of all sensors in the hexagon.

ricki-z avatar Nov 22 '16 18:11 ricki-z

See #6 and #7 for issues unrelated to colors and thresholds.

rashfael avatar Nov 22 '16 20:11 rashfael

Hi Everyone

What speaks against using an existing Air Quality Index like the CAQI ?

Avsamoht avatar Feb 06 '17 16:02 Avsamoht

What is with values bigger than 180 in CAQI? I would like to show when a value is very bad (180-1999)

ubahnverleih avatar Feb 06 '17 16:02 ubahnverleih

the >180 value indicates "this is very bad and shouldn't happen"

no reason to say this is very very bad and shouldn't happen

Avsamoht avatar Feb 06 '17 16:02 Avsamoht

Yes, but it has happend and i what to see how bad this "shouldn't happen" is

ubahnverleih avatar Feb 06 '17 16:02 ubahnverleih

if you change the scala: 180-200 200-500 500-1999

the statement is: 190 isn't that bad it could be worse

Avsamoht avatar Feb 06 '17 17:02 Avsamoht

So you want to show the reality or just shock people how bad everything ist?

But maybe we can do something like:

  • 0-25
  • 25-50
  • 50-90
  • 90-180
  • 180-1999 (maybe in a color which is not in the CAQI scale)

ubahnverleih avatar Feb 06 '17 17:02 ubahnverleih

The CAQI scale is less strict than the one ricki-z suggested earlier:

Green 0-40 Yellow 41-60 Orange 61-80 Red 81-1999

@ubahnverleih the scale you posted is exactly the CAQI Scale for PM10: 0-25: Very Low (dark green) 25-50: Low (light green) 50-90: Medium (dark yellow) 90-180: High (orange) 180+: Very High (Dark Red, White Font)

And the reason for no range after 180 has nothing to do with shocking the people. This scale is derived from the WHO airquality guidelines. And if you believe in scientific studies this is how bad it is (extracted from the guidelines) : who_air_quality_guidelines_longterm who_air_quality_guidelines_shortterm

They invested some toughts in the developement of the CAQI: http://www.airqualitynow.eu/download/CITEAIR-Comparing_Urban_Air_Quality_across_Borders.pdf (and eu funds :P)

Avsamoht avatar Feb 06 '17 19:02 Avsamoht

i dont see a point in not showing values above 180. its the measurement and its interesting.

gaga9999 avatar Jun 07 '17 21:06 gaga9999

the real questions are: what is the purpose of the scale? who is the audience / has the audience a profound knowledge of air quality?

should it just be visualisation of the measured value, then a linear scale from zero to the maximum expected value (250, 300, you should have enough data to get a good value) is the way to go

but if the purpose of the scale to set the measured value in a context of health impacts. A scale based on an air quality index provides this (values 180+ = health impacts)

Avsamoht avatar Jun 08 '17 12:06 Avsamoht

my oppinion is: dont adjust according to the audience. otherwise everything gets to a level of complete non-understanding (i.e. wide mainstream media) . so it would boil down to a scale of : red, yellow, green.

thats imo not the purpose of the project. the purpose is to build a knowledge. this is a scientific approach with near-scientific measures. so why not just stick with the raw truth?

gaga9999 avatar Jun 25 '17 11:06 gaga9999