Hi, I am new using Sentinel-Hub, I am trying to download all the bands separately on my computer, but when I make the request it generates me a single TIFF file with the 13 bands, I have used the examples of: [Sentinel Hub Process API — Sentinel Hub 3.10.1 documentation]
I have made modifications, but I don’t succeed, how can I fix it?
This is the code I am using for the request and download:
evalscript_all_bands = """
//VERSION=3
function setup() {
return {
input: [{
bands: ["B01","B02","B03","B04","B05","B06","B07","B08","B8A","B09","B10","B11","B12"],
units: "DN"
}],
output: {
bands: 13,
sampleType: "INT16"
}
};
}
function evaluatePixel(sample) {
return [sample.B01,
sample.B02,
sample.B03,
sample.B04,
sample.B05,
sample.B06,
sample.B07,
sample.B08,
sample.B8A,
sample.B09,
sample.B10,
sample.B11,
sample.B12];
}
"""
request_all_bands = SentinelHubRequest(
data_folder=data_folder,
evalscript=evalscript_all_bands,
input_data=[
SentinelHubRequest.input_data(
data_collection=DataCollection.SENTINEL2_L1C,
time_interval=("2020-06-01", "2020-06-10"),
mosaicking_order=MosaickingOrder.LEAST_CC,
)
],
responses=[SentinelHubRequest.output_response("default", MimeType.TIFF)],
bbox=betsiboka_bbox,
size=betsiboka_size,
config=config,
)
%%time
all_bands_img = request_all_bands.get_data(save_data=True)
print(
"The output directory has been created and a tiff file with all 13 bands was saved into the following structure:\n"
)
for folder, _, filenames in os.walk(request_all_bands.data_folder):
for filename in filenames:
print(os.path.join(folder, filename))