- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
grass-addons/grass7/imagery/i.sentinel.mask/i.sentinel.mask.py
r72816 r72992 110 110 #% description: name of output vector shadow mask 111 111 #% required : no 112 #% guisection: Output 113 #%end 114 #%option 115 #% key: cloud_threshold 116 #% type: integer 117 #% description: threshold for cleaning small areas from cloud mask 118 #% required : yes 119 #% answer: 50000 120 #% guisection: Output 121 #%end 122 #%option 123 #% key: shadow_threshold 124 #% type: integer 125 #% description: threshold for cleaning small areas from shadow mask 126 #% required : yes 127 #% answer: 10000 112 128 #% guisection: Output 113 129 #%end … … 219 235 f_bands = {} 220 236 scale_fac = options['scale_fac'] 221 cloud_ clean_T = 50000222 shadow_ clean_T = 10000237 cloud_threshold = options['cloud_threshold'] 238 shadow_threshold = options['shadow_threshold'] 223 239 raster_max = {} 224 240 cloud_mask = options['cloud_mask'] … … 264 280 gscript.warning(_('Any rescale factor has been applied')) 265 281 for key, b in bands.items(): 266 if gscript.raster_info(b)['datatype'] != "DCELL" :267 gscript.fatal("Raster maps must be double")282 if gscript.raster_info(b)['datatype'] != "DCELL" and gscript.raster_info(b)['datatype'] != "FCELL": 283 gscript.fatal("Raster maps must be DCELL o FCELL") 268 284 else: 269 285 f_bands = bands … … 310 326 fourth_rule, 311 327 fifth_rule) 312 expr_c = '{} = if({}, 0, null( ))'.format(328 expr_c = '{} = if({}, 0, null())'.format( 313 329 tmp["cloud_def"], 314 330 cloud_rules) … … 325 341 output=cloud_mask, 326 342 tool='rmarea', 327 threshold=cloud_ clean_T)343 threshold=cloud_threshold) 328 344 gscript.message(_('--- Finish cloud detection procedure ---')) 329 345 ### end of Clouds detection #### … … 354 370 sixth_rule, 355 371 seventh_rule) 356 expr_s = '{} = if({}, 0, null( ))'.format(372 expr_s = '{} = if({}, 0, null())'.format( 357 373 tmp["shadow_temp"], 358 374 shadow_rules) … … 370 386 output=tmp["shadow_temp_mask"], 371 387 tool='rmarea', 372 threshold=shadow_ clean_T)388 threshold=shadow_threshold) 373 389 gscript.message(_('--- Finish Shadows detection procedure ---')) 374 390 ### end of shadows detection ###
Note:
See TracChangeset
for help on using the changeset viewer.
