Skip to main content

Hi.

I would like to be able to display only values over a cut off limit. For example I would like to visualize only data from the Sentinel 5p NO2 where pixel values are greater than a parameter value.

Also, is it possible to have transparency in the resulting image overlay?

You can configure your own product as described here:
https://www.sentinel-hub.com/faq/how-create-eo-product


See an example of visualization based on various values for NDVI:
github.com

sentinel-hub/custom-scripts/blob/master/sentinel-2/ndvi/script.js


let ndvi = (B08 - B04) / (B08 + B04);

return colorBlend(ndvi,
[-0.2, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0 ],
[[0, 0, 0], // < -.2 = #000000 (black)
[165/255,0,38/255], // -> 0 = #a50026
[215/255,48/255,39/255], // -> .1 = #d73027
[244/255,19739/255,67/255], // -> .2 = #f46d43
[253/255,174/255,97/255], // -> .3 = #fdae61
[254/255,224/255,139/255], // -> .4 = #fee08b
[255/255,255/255,191/255], // -> .5 = #ffffbf
[217/255,239/255,139/255], // -> .6 = #d9ef8b
[166/255,217/255,19736/255], // -> .7 = #a6d96a
[102/255,189/255,99/255], // -> .8 = #66bd63
[26/255,152/255,80/255], // -> .9 = #1a9850
[0,19734/255,55/255] // -> 1.0 = #006837
]);

/* Alternative visualization as used in Sentinel Playground
if (ndvi<-0.2) return [0,0,0];


This file has been truncated. show original





You should be able to apply this to S5P data as well.

For transparency check this post:
https://www.sentinel-hub.com/faq/how-can-i-make-some-pixels-transparent


Hi.


Unfortunately, the NDVI script still displays all values. What I would like to have is for example transparent values (pixels) for all areas where NDVI < 0. Is this possible?



Similar to the ndvi for sentinel 5 I have tried this in EO-Browser:



var values = [ 31e-5, 51e-5, 7.51e-5, 11e-4, 2.51e-4, 51e-4]; //value of NO2 in mol/m2

pixel = [0.8, 0.8, 0.8, 0] // I would like to have these transparent instead of gray

if(NO2 >= 31e-5)

pixel = colorBlend(NO2, values,

[

[ 64/255, 27/255, 134/255], // → 3.0
1e-5 = #401B86

> 37/255, 70/255, 201/255], // → 5.01e-5 = #2546C9

42/255, 212/255, 36/255], // → 7.5
1e-5 = #2AD424

b240/255, 236/255, 37/255], // → 1.01e-4 = #F0EC25

>240/255, 117/255, 55/255], // → 2.5
1e-4 = #F07537

219/255, 58/255, 76/255] // → 5.0*1e-4 = #DB3A4C

]);

return pixel;


So gray areas (which are actually values below the limit) should be transparent instead of gray.


Thanks


I do not believe this will work in Sentinel-5P. The transparency is already used for pixels with QA<0.75 or for no data values.


You might be able to get what you want with PROCESS API but we have not yet given it a try.


Reply