I am resampling Modis and Sentinel 2 rasters in QGIS. I am working with surface reflectance values and I am having trouble obtaining the results that I am looking for. I have isolated my rasters down to their red band surface reflectance values. I am trying to threshold these reflectance values to >0.45, while at the same time retaining the pixel value. Every method of thresholding I have attempted results in all pixels having a value of either 0.0 or 1.0. How do I retain my original reflectance values while still thresholding?
If you use:
"raster@1" > 0.45
The output will be 0 or 1. 0 for a false result in condition evaluation and 1 for true.
If you want to keep values for true evaluation, use:
("raster@1" > 0.45)*"raster@1"
If you have a pixel value of 0.56, the evaluation will be:
("raster@1" > 0.45)*"raster@1" 0.55 > 0.45)* 0.55 1 * 0.55 0.55