Commit 5c2b7c11 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Bugfixes

components.CoReg_local.COREG_LOCAL:
- view_CoRegPoints(): bugfix for not catching empty geodataframe

components.Geom_Quality_Grid:
- Geom_Quality_Grid:
    - _exclude_bad_XYpos: bugfix for ignoring quiet mode
- TiePoint_Refiner:
    - _RANSAC_outlier_detection(): empty output is now properly catched

- updated __version__
parent 4991fef7
......@@ -9,7 +9,7 @@ from .components import utilities
from .components import geometry
__author__ = 'Daniel Scheffler'
__version__= '2017-01-20_03'
__version__= '2017-01-23_01'
__all__=['COREG',
'COREG_LOCAL',
......
......@@ -361,15 +361,21 @@ class COREG_LOCAL(object):
# plot all points on top
vmin, vmax = np.percentile(GDF[attribute2plot], 0), np.percentile(GDF[attribute2plot], 95)
points = plt.scatter(GDF['plt_X'],GDF['plt_Y'], c=GDF[attribute2plot],
cmap=palette, marker='o' if len(GDF)<10000 else '.', s=50, alpha=1.0,
vmin=vmin, vmax=vmax)
# add colorbar
divider = make_axes_locatable(plt.gca())
cax = divider.append_axes("right", size="2%", pad=0.1) # create axis on the right; size =2% of ax; padding = 0.1 inch
plt.colorbar(points, cax=cax)
if not GDF.empty:
vmin, vmax = np.percentile(GDF[attribute2plot], 0), np.percentile(GDF[attribute2plot], 95)
points = plt.scatter(GDF['plt_X'],GDF['plt_Y'], c=GDF[attribute2plot],
cmap=palette, marker='o' if len(GDF)<10000 else '.', s=50, alpha=1.0,
vmin=vmin, vmax=vmax)
# add colorbar
divider = make_axes_locatable(plt.gca())
cax = divider.append_axes("right", size="2%",
pad=0.1) # create axis on the right; size =2% of ax; padding = 0.1 inch
plt.colorbar(points, cax=cax)
else:
if not self.q:
warnings.warn('Cannot plot any tie point because none is left after tie point validation.')
if savefigPath:
fig.savefig(savefigPath, dpi=savefigDPI)
......
......@@ -177,7 +177,7 @@ class Geom_Quality_Grid(object):
# exclude all point where bad data mask is True (e.g. points on clouds etc.)
orig_len_GDF = len(GDF)
orig_len_GDF = len(GDF) # length of GDF after dropping all points outside the overlap polygon
mapXY = np.array(GDF.loc[:,['X_UTM','Y_UTM']])
GDF['REF_BADDATA'] = self.COREG_obj.ref .mask_baddata.read_pointData(mapXY) \
if self.COREG_obj.ref .mask_baddata is not None else False
......@@ -185,8 +185,9 @@ class Geom_Quality_Grid(object):
if self.COREG_obj.shift.mask_baddata is not None else False
GDF = GDF[(GDF['REF_BADDATA']==False) & (GDF['TGT_BADDATA']==False)]
if self.COREG_obj.ref.mask_baddata is not None or self.COREG_obj.shift.mask_baddata is not None:
print('According to the provided bad data mask(s) %s points of initially %s have been excluded.'
%(orig_len_GDF-len(GDF), orig_len_GDF))
if not self.q:
print('According to the provided bad data mask(s) %s points of initially %s have been excluded.'
%(orig_len_GDF-len(GDF), orig_len_GDF))
return GDF
......@@ -235,7 +236,6 @@ class Geom_Quality_Grid(object):
GDF.loc[:,['X_IM' ,'Y_IM' ]] = self.XY_points
GDF.loc[:,['X_UTM','Y_UTM']] = self.XY_mapPoints
# exclude offsite points and points on bad data mask
GDF = self._exclude_bad_XYpos(GDF)
......@@ -300,6 +300,7 @@ class Geom_Quality_Grid(object):
if results.ready():
results = results.get() # <= this is the line where multiprocessing can freeze if an exception appears within COREG ans is not raised
break
else:
if not self.q:
print("Calculating geometric quality grid (%s points) 1 CPU core..." %len(GDF))
......@@ -702,9 +703,9 @@ class TiePoint_Refiner(object):
count_iter+=1
outliers = inliers == False if inliers.size else np.array([])
outliers = inliers == False if inliers is not None and inliers.size else np.array([])
if GDF.empty:
if GDF.empty or outliers is None:
gs = GeoSeries([False]*len(self.GDF))
elif len(GDF) < len(self.GDF):
GDF['outliers'] = outliers
......
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