Commit 287d814b authored by Gaetano Raffaele's avatar Gaetano Raffaele
Browse files

Merge branch 'develop' of https://gitlab.irstea.fr/raffaele.gaetano/moringav2 into develop

No related merge requests found
Showing with 11 additions and 1 deletion
+11 -1
......@@ -179,7 +179,12 @@ class S2TheiaTilePipeline:
er.SetParameterString('in', bnd)
er.SetParameterString('mode', 'fit')
er.SetParameterString('mode.fit.vect', roi)
er.Execute()
try:
er.Execute()
except Exception as e:
if not 'Extraction Region not consistent with output image' in str(e):
print(e)
return False
arr = er.GetImageAsNumpyArray('out')
if (np.sum(arr != cls.NDT) / (arr.shape[0]*arr.shape[1])) <= min_surf:
return False
......@@ -262,6 +267,9 @@ class S2TheiaTilePipeline:
def is_empty(self):
return len(self.image_list) == 0
def is_empty(self):
return len(self.image_list) == 0
def reset(self):
self.pipe = []
self.files = []
......@@ -800,6 +808,7 @@ class S2TheiaPipeline:
self.temp_fld = temp_fld
self.input_date_interval = input_date_interval
self.max_clouds_percentage = max_clouds_percentage
self.roi = roi
self.tile_list = set()
self.roi = roi
img_list = [os.path.abspath(x) for x in glob.glob(os.path.join(self.folder, self.S2TilePipeline.PTRN_dir))
......@@ -849,6 +858,7 @@ class S2TheiaPipeline:
for t in self.tiles:
t.preprocess()
if self.roi is not None:
print('Clipping')
t.clip(self.roi)
if align:
if type(align_to) == str and os.path.exists(align_to):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment