I am investigating soil moisture provided on the sentinel hub (custom-scripts/sentinel-1/soil_moisture_estimation at master · sentinel-hub/custom-scripts · GitHub)
I am getting RGB values, I am not looking for RGB values
Can anyone help me to get images with no RGB values?
Thanks in advance
Looking at the content of the script we can see that it is built in 2 parts within the
evaluatePixel function. The first part calculates the Soil Moisture
Mv (up to line 69) and the second part assigns RGB colours to the Soil Moisture values.
To obtain the actual values and not a visual representation of them, you need to adjust the script in 3 places:
setup function, return 1 band. We don’t need to return 3 bands for R, G, and B anymore.
To return the float values of your index, add the
sampleType to the
setup function and set it to
FLOAT32. For information about how to do this, you can refer to the dedicated documentation page.
Remove the part of the
evaluatePixel function that converts
Mv to RGB values (lines 70 - 128) and
The steps above will allow you to return the actual Soil Moisture values.
I tried evalscript by changing the code according to the above suggestions. I am getting float values
But, in function evaluate pixel i am getting value for only one sample and sample length is one
Can you help me to get data for all the samples?
Thank you in advance
I am not sure what you mean about getting multiple samples.
Indeed, “The algorithm relates the change in backscatter intensity to the change in moisture” by computing the minimum, maximum and sum of
VV values over the time range. Then it uses the latest acquisition in your time-range, as well as the min and sensitivity to compute soil moisture:
Mv = ((samples.VV) - min)/(sensitivity);
If you pull out
Mv for earlier acquisitions in the script you will be computing your values with different time-ranges, and I am not sure that would be a robust method.
If you want to do this nevertheless, you can modify
Mv = ((samples.VV) - min)/(sensitivity); for it to read different acquisitions, for example
samples.VV and return the response to a different variable. Then you would return these variables as bands.
Thank you Maxim,
I apologize for not making it clear
I tried modifying
Mv = ((samples.VV) - min)/(sensitivity); samples.VV`but i am getting nan values for samples.VV.
But for samples.VV we are getting nan values
Can you state the time-range you are using, or better the request you are trying to run? I’m asking because for me it works with
I got the result samples.VV by following the sentinel hub document
Thank you for guiding me