Hi,
I want to download an index (e.g. NDVI) and I also need to download the cloudmasks from L2A which is called SCL.
I considered the problem, that L1C seems to have more images and thus outputs than L2A and adapted the WMS configurator so that the NDVI and the SCL layer use L2A as input.
Using a time range of 10 days (2017-08-01 until 2017-08-10), I get 2 results for the NDVI layer.
However, for the SCL layer I get 5 results, only 2 with content (same time than the 2 NDVI results) and 3 empty images.
Hence, I think that your service did not recognize the invalidity of the empty output files.
Here is the code:
from sentinelhub.data_request import WcsRequest
from sentinelhub.constants import MimeType
from sentinelhub.common import BBox, CRS
import numpy as np
# FUNCTIONS ------------------------------------------------------------------------------------------------------------
def WCS_Download(bbox_coord):
BBOX = BBox(bbox=bbox_coord, crs=CRS.WGS84)
for Layer in Layers:
wcs = WcsRequest(data_folder=outdir,
layer=Layer,
bbox=BBOX,
time=(start, end),
resx='{}m'.format(res), resy='{}m'.format(res),
image_format=MimeType.TIFF_d32f,
instance_id=INSTANCE_ID)
wcs_img = wcs.get_data(save_data=True)
# CONFIG ---------------------------------------------------------------------------------------------------------------
outdir = "PATH_TO_MY_OUTPUT_FOLDER"
Layers = ['NDVI', 'CLOUD']
INSTANCE_ID = '<instance_id>'
BBOX_coord = [16.53,47.83,16.84,48.31]
res = 20
start = '2017-08-01'
end = '2017-08-10'
# MAIN -----------------------------------------------------------------------------------------------------------------
WCS_Download(BBOX_coord)