Skip to content

Commit

Permalink
Fixed case where no cloud is detected during metadata reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
sixy6e committed Jul 28, 2016
1 parent 63b9238 commit 899dd81
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gaip/fmask_cloud_masking.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,10 +1191,13 @@ def plcloud(filename, cldprob=22.5, num_Lst=None, images=None, shadow_prob=False

cloud_skew = 0.0 # TODO

logging.debug("FMASK Final Cloud Layer Percent: %f" %
((float(Cloud[cloud_mask].sum()) / float(mask.sum())) * 100.0))
aux_data['FMASK_cloud_layer_percent'] = (
float(Cloud[cloud_mask].sum()) / float(mask.sum())) * 100.0
try:
cloud_percent = (Cloud[cloud_mask].sum() / float(mask.sum())) * 100
except ZeroDivisionError:
cloud_percent = 0.0

logging.debug("FMASK Final Cloud Layer Percent: %f" % cloud_percent)
aux_data['FMASK_cloud_layer_percent'] = cloud_percent
aux_data['FMASK_processing_time'] = processing_time

# We'll modify the return argument for the Python implementation
Expand Down

0 comments on commit 899dd81

Please sign in to comment.