Hi @gmilcinski,
Thank you for your reply.
As I mentioned in my initial post, when running the following command:
measurements = extract_surface_water_area_per_frame(42, nominal_outline, the_dam_bbox, date, resx, resy)
I got this error:
ValueError Traceback (most recent call last)
in ()
4 the_dam_bbox = get_bbox(nominal_outline)
5 resx, resy = get_optimal_resolution(the_dam_bbox)
----> 6 measurements = extract_surface_water_area_per_frame(42, nominal_outline, the_dam_bbox, date, resx, resy)
7
8 measurement_with_dem = surface_water_area_with_dem_veto(measurements, nominal_outline, the_dam_bbox, resx, resy, 15)
/content/water-observatory-backend/src/s2_water_extraction.py in extract_surface_water_area_per_frame(dam_id, dam_poly, dam_bbox, date, resx, resy)
130 try:
131 all_cloud_masks = CloudMaskRequest(ogc_request=wcs_bands_request, threshold=0.4)
--> 132 cloud_mask = all_cloud_masks.get_cloud_masks()
133 except (DownloadFailedException, ImageDecodingError):
134 set_measurement_status(measurement, WaterDetectionStatus.SH_REQUEST_ERROR)
/usr/local/lib/python3.6/dist-packages/s2cloudless/S2PixelCloudDetector.py in get_cloud_masks(self, threshold, non_valid_value)
286 :rtype: numpy.ndarray
287 """
--> 288 self.get_probability_masks()
289
290 cloud_masks = self.cloud_detector.get_mask_from_prob(self.probability_masks, threshold)
/usr/local/lib/python3.6/dist-packages/s2cloudless/S2PixelCloudDetector.py in get_probability_masks(self, non_valid_value)
270 if self.probability_masks is None:
271 self.get_data()
--> 272 self.probability_masks = self.cloud_detector.get_cloud_probability_maps(self.bands)
273
274 self.probability_masks[~self.valid_data] = non_valid_value
/usr/local/lib/python3.6/dist-packages/s2cloudless/S2PixelCloudDetector.py in get_cloud_probability_maps(self, X, **kwargs)
105 if band_num != exp_bands:
106 raise ValueError("Parameter 'all_bands' is set to {}. Therefore expected band data with {} bands, "
--> 107 "got {} bands".format(self.all_bands, exp_bands, band_num))
108
109 if self.all_bands:
ValueError: Parameter 'all_bands' is set to False. Therefore expected band data with 10 bands, got 9 bands
I guess this is related to Evalscript at line 32 in the s2_water_extraction.py code:
S2_CLOUD_BANDS_SCRIPT = ‘return [B01,B02,B04,B05,B08,B8A,B09,B10,B11,B12]’
Ali