Commit 937d8d11 authored by Daniel Scheffler's avatar Daniel Scheffler

Added a warning in case the input image consists of multiple patches and...

Added a warning in case the input image consists of multiple patches and AROSICS processes only the largest one. Added a warning in case the reliability filtering filters more than 70% of the tie points.
Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 9cfe17fa
Pipeline #15132 passed with stages
in 2 minutes and 30 seconds
......@@ -16,7 +16,7 @@ test_arosics:
- conda install -c conda-forge cartopy # FIXME remove as soon as docker container is rebuilt
# update py_tools_ds and geoarray
# - pip install "py_tools_ds>=0.15.10"
- pip install "py_tools_ds>=0.15.10"
- pip install "geoarray>=0.9.0"
# run tests
......
......@@ -117,6 +117,14 @@ class GeoArray_CoReg(GeoArray):
self.calc_mask_nodata(fromBand=self.band4match) # this avoids that all bands have to be read
with warnings.catch_warnings(record=True) as w:
_ = self.footprint_poly # execute getter
if len(w) > 0 and 'disjunct polygone(s) outside' in str(w[-1].message):
warnings.warn('The footprint of the %s contains multiple separate image parts. '
'AROSICS will only process the largest image part.' % self.imName)
# FIXME use a convex hull as footprint poly
# validate footprint poly
if not self.footprint_poly.is_valid:
self.footprint_poly = self.footprint_poly.buffer(0)
......@@ -133,7 +141,7 @@ class GeoArray_CoReg(GeoArray):
class COREG(object):
"""The COREG class detects and corrects global X/Y shifts between a target and refernce image.
"""The COREG class detects and corrects global X/Y shifts between a target and reference image.
Geometric shifts are calculated at a specific (adjustable) image position. Correction performs a global shifting
in X- or Y direction.
......
......@@ -848,9 +848,19 @@ class Tie_Point_Refiner(object):
self.GDF['L1_OUTLIER'] = marked_recs
self.new_cols.append('L1_OUTLIER')
n_flagged = len(marked_recs[marked_recs])
perc40 = np.percentile(self.GDF.RELIABILITY, 40)
if n_flagged / len(self.GDF) > .7:
warnings.warn(r"More than 70%% of the found tie points have a reliability lower than %s%% and are "
r"therefore marked as false-positives. Consider relaxing the minimum reliability "
r"(parameter 'min_reliability') to avoid that. For example min_reliability=%d would only "
r"flag 40%% of the tie points in case of your input data."
% (self.min_reliability, perc40))
if not self.q:
print('%s tie points flagged by level 1 filtering (reliability).'
% (len(marked_recs[marked_recs])))
% n_flagged)
# SSIM filtering
if level > 1:
......
......@@ -22,5 +22,5 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = '1.0.6'
__versionalias__ = '2020-10-27_01'
__version__ = '1.1.0'
__versionalias__ = '2020-10-30_01'
Markdown is supported
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