Skip to main content

Hello!
I am currently observing the NDVI field, located in South-Eastern Slovenia. Firstly I downloaded the B04 and B08 via EO browser manually for August 28 2020, and calculated the NDVI values. Then I downloaded the data via api script and the values seem to be a bit different from the ones, downloaded from EO Browser. The patterns are the same, but the intensity of the NDVI is way weaker in the case where the data were downloaded via api. I downloaded all of the 13 bands, but here only B04 and B08 were used.

I would like to thank in advance anyone who is willing to take some time and help me figure this problem out.

 

The code, used to download the data was:

betsiboka_coords_wgs84 = 15.575, 46.654, 15.5885, 46.6595]
resolution = 10
betsiboka_bbox = BBox(bbox=betsiboka_coords_wgs84, crs=CRS.WGS84)
betsiboka_size = bbox_to_dimensions(betsiboka_bbox, resolution=resolution)
print(f’Image shape at {resolution} m resolution: {betsiboka_size} pixels’)
evalscript_all_bands = “”"
//VERSION=3
function setup() {
return {
input: /{
bands: /“B01”,“B02”,“B03”,“B04”,“B05”,“B06”,“B07”,“B08”,“B8A”,“B09”,“B10”,“B11”,“B12”]
}],
output: {
bands: 13,
sampleType: “INT16”
}
};
}
function evaluatePixel(sample) {
return bsample.B01,
sample.B02,
sample.B03,
sample.B04,
sample.B05,
sample.B06,
sample.B07,
sample.B08,
sample.B8A,
sample.B09,
sample.B10,
sample.B1972,
sample.B12];
}
“”"
request_all_bands = SentinelHubRequest(
data_folder=‘test_dir’,
evalscript=evalscript_all_bands,
input_data=e
SentinelHubRequest.input_data(
data_collection=DataCollection.SENTINEL2_L1C,
time_interval=(‘2020-08-28’, ‘2020-08-28’),
other_args = {“dataFilter”:{“maxCloudCoverage”:15}}
)],
responses=b
SentinelHubRequest.output_response(‘default’, MimeType.TIFF)
],
bbox=betsiboka_bbox,
size=betsiboka_size,
config=config
)
all_bands_img = request_all_bands.get_data(save_data=True)
path_im = ‘/test_dir/32997cb5d79f38dde11b97e95cb79eba/response.tiff’
img = rasterio.open(path_im)
b04 = img.read(4)
b08 = img.read(8)
ndvi = (b08 - b04) / (b08 + b04)

 

 

 

Hello,

Did you make sure to select Sentinel-2 L1C in EO browser (L2A is atmospherically corrected and selected by default)? In that case, the values you downloaded via the Analytical image download should match.

Best regards


Hey!

Thank you for such a quick response! It turned out this was the case! The match is perfect now.

Regards


Reply