Commit 9c7ec72dbff46038e45fd5d422644ea50e2ae9cd

Authored by Germain Salgues
2 parents 4a83a21d df3712ec
Exists in master

Merge branch 'hotfix-1.3.1'

app/run_snow_detector.py
... ... @@ -6,7 +6,7 @@ import json
6 6 import logging
7 7 from s2snow import snow_detector
8 8  
9   -VERSION = "1.3"
  9 +VERSION = "1.3.1"
10 10  
11 11  
12 12 def show_help():
... ...
python/s2snow/snow_detector.py
... ... @@ -337,8 +337,10 @@ class snow_detector:
337 337 # Extract all masks
338 338 computeCMApp = compute_cloud_mask(
339 339 self.cloud_init,
340   - op.join(self.path_tmp, "all_cloud_mask.tif"),
341   - str(self.all_cloud_mask))
  340 + op.join(self.path_tmp, "all_cloud_mask.tif") + GDAL_OPT,
  341 + str(self.all_cloud_mask),
  342 + self.ram,
  343 + otb.ImagePixelType_uint8)
342 344 computeCMApp.ExecuteAndWriteOutput()
343 345 computeCMApp = None
344 346  
... ... @@ -347,16 +349,20 @@ class snow_detector:
347 349 # image
348 350 computeCMApp = compute_cloud_mask(
349 351 self.cloud_init,
350   - op.join(self.path_tmp, "shadow_in_mask.tif"),
351   - str(self.shadow_in_mask))
  352 + op.join(self.path_tmp, "shadow_in_mask.tif") + GDAL_OPT,
  353 + str(self.shadow_in_mask),
  354 + self.ram,
  355 + otb.ImagePixelType_uint8)
352 356 computeCMApp.ExecuteAndWriteOutput()
353 357 computeCMApp = None
354 358  
355 359 # Then extract shadow mask of shadows from clouds outside the image
356 360 computeCMApp = compute_cloud_mask(
357 361 self.cloud_init,
358   - op.join(self.path_tmp, "shadow_out_mask.tif"),
359   - str(self.shadow_out_mask))
  362 + op.join(self.path_tmp, "shadow_out_mask.tif") + GDAL_OPT,
  363 + str(self.shadow_out_mask),
  364 + self.ram,
  365 + otb.ImagePixelType_uint8)
360 366 computeCMApp.ExecuteAndWriteOutput()
361 367 computeCMApp = None
362 368  
... ... @@ -365,7 +371,7 @@ class snow_detector:
365 371 bandMathShadow = band_math(
366 372 [op.join(self.path_tmp, "shadow_in_mask.tif"),
367 373 op.join(self.path_tmp, "shadow_out_mask.tif")],
368   - op.join(self.path_tmp, "shadow_mask.tif"),
  374 + op.join(self.path_tmp, "shadow_mask.tif")+GDAL_OPT,
369 375 "(im1b1 == 1) || (im2b1 == 1)",
370 376 self.ram,
371 377 otb.ImagePixelType_uint8)
... ... @@ -375,9 +381,10 @@ class snow_detector:
375 381 # Extract high clouds
376 382 computeCMApp = compute_cloud_mask(
377 383 self.cloud_init,
378   - op.join(self.path_tmp, "high_cloud_mask.tif"),
  384 + op.join(self.path_tmp, "high_cloud_mask.tif") + GDAL_OPT,
379 385 str(self.high_cloud_mask),
380   - self.ram)
  386 + self.ram,
  387 + otb.ImagePixelType_uint8)
381 388 computeCMApp.ExecuteAndWriteOutput()
382 389 computeCMApp = None
383 390  
... ... @@ -392,7 +399,7 @@ class snow_detector:
392 399 op.join(self.path_tmp, "shadow_mask.tif"),
393 400 op.join(self.path_tmp, "red_nn.tif"),
394 401 op.join(self.path_tmp, "high_cloud_mask.tif")],
395   - self.cloud_refine_path+GDAL_OPT,
  402 + self.cloud_refine_path + GDAL_OPT,
396 403 condition_shadow,
397 404 self.ram,
398 405 otb.ImagePixelType_uint8)
... ...