Commit d53cf30e authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Changed some print output.

components.Tie_Point_Grid.Tie_Point_Grid:
- renamed 'geometric quality grid' to 'tie points grid' within print outputs

updated __version__
parent a201053a
...@@ -49,7 +49,7 @@ class Tie_Point_Grid(object): ...@@ -49,7 +49,7 @@ class Tie_Point_Grid(object):
NOTE: Points are selected randomly from the given point grid (specified by NOTE: Points are selected randomly from the given point grid (specified by
'grid_res'). If the point does not provide enough points, all available points 'grid_res'). If the point does not provide enough points, all available points
are chosen. are chosen.
:param outFillVal(int): if given the generated geometric quality grid is filled with this value in case :param outFillVal(int): if given the generated tie points grid is filled with this value in case
no match could be found during co-registration (default: -9999) no match could be found during co-registration (default: -9999)
:param resamp_alg_calc(str) the resampling algorithm to be used for all warping processes during calculation :param resamp_alg_calc(str) the resampling algorithm to be used for all warping processes during calculation
of spatial shifts of spatial shifts
...@@ -67,7 +67,7 @@ class Tie_Point_Grid(object): ...@@ -67,7 +67,7 @@ class Tie_Point_Grid(object):
- Level 3: RANSAC outlier detection - Level 3: RANSAC outlier detection
:param dir_out(str): output directory to be used for all outputs if nothing else is given :param dir_out(str): output directory to be used for all outputs if nothing else is given
to the individual methods to the individual methods
:param CPUs(int): number of CPUs to use during calculation of geometric quality grid :param CPUs(int): number of CPUs to use during calculation of tie points grid
(default: None, which means 'all CPUs available') (default: None, which means 'all CPUs available')
:param progress(bool): show progress bars (default: True) :param progress(bool): show progress bars (default: True)
:param v(bool): verbose mode (default: False) :param v(bool): verbose mode (default: False)
...@@ -101,7 +101,7 @@ class Tie_Point_Grid(object): ...@@ -101,7 +101,7 @@ class Tie_Point_Grid(object):
def CoRegPoints_table(self): def CoRegPoints_table(self):
"""Returns a GeoDataFrame with the columns 'geometry','POINT_ID','X_IM','Y_IM','X_UTM','Y_UTM','X_WIN_SIZE', """Returns a GeoDataFrame with the columns 'geometry','POINT_ID','X_IM','Y_IM','X_UTM','Y_UTM','X_WIN_SIZE',
'Y_WIN_SIZE','X_SHIFT_PX','Y_SHIFT_PX', 'X_SHIFT_M', 'Y_SHIFT_M', 'ABS_SHIFT' and 'ANGLE' containing all 'Y_WIN_SIZE','X_SHIFT_PX','Y_SHIFT_PX', 'X_SHIFT_M', 'Y_SHIFT_M', 'ABS_SHIFT' and 'ANGLE' containing all
information containing all the results frm coregistration for all points in the geometric quality grid. information containing all the results frm coregistration for all points in the tie points grid.
""" """
if self._CoRegPoints_table is not None: if self._CoRegPoints_table is not None:
return self._CoRegPoints_table return self._CoRegPoints_table
...@@ -139,7 +139,7 @@ class Tie_Point_Grid(object): ...@@ -139,7 +139,7 @@ class Tie_Point_Grid(object):
:return: :return:
""" """
if not self.q: if not self.q:
print('Initializing geometric quality grid...') print('Initializing tie points grid...')
Xarr,Yarr = np.meshgrid(np.arange(0,self.shift.shape[1],grid_res), Xarr,Yarr = np.meshgrid(np.arange(0,self.shift.shape[1],grid_res),
np.arange(0,self.shift.shape[0],grid_res)) np.arange(0,self.shift.shape[0],grid_res))
...@@ -294,7 +294,7 @@ class Tie_Point_Grid(object): ...@@ -294,7 +294,7 @@ class Tie_Point_Grid(object):
if self.CPUs is None or self.CPUs>1: if self.CPUs is None or self.CPUs>1:
if not self.q: if not self.q:
cpus = self.CPUs if self.CPUs is not None else multiprocessing.cpu_count() cpus = self.CPUs if self.CPUs is not None else multiprocessing.cpu_count()
print("Calculating geometric quality grid (%s points) using %s CPU cores..." %(len(GDF), cpus)) print("Calculating tie points grid (%s points) using %s CPU cores..." %(len(GDF), cpus))
with multiprocessing.Pool(self.CPUs) as pool: with multiprocessing.Pool(self.CPUs) as pool:
if self.q or not self.progress: if self.q or not self.progress:
...@@ -313,7 +313,7 @@ class Tie_Point_Grid(object): ...@@ -313,7 +313,7 @@ class Tie_Point_Grid(object):
else: else:
if not self.q: if not self.q:
print("Calculating geometric quality grid (%s points) 1 CPU core..." %len(GDF)) print("Calculating tie points grid (%s points) 1 CPU core..." %len(GDF))
results = np.empty((len(geomPoints),14), np.object) results = np.empty((len(geomPoints),14), np.object)
bar = ProgressBar(prefix='\tprogress:') bar = ProgressBar(prefix='\tprogress:')
for i,coreg_kwargs in enumerate(list_coreg_kwargs): for i,coreg_kwargs in enumerate(list_coreg_kwargs):
...@@ -357,7 +357,7 @@ class Tie_Point_Grid(object): ...@@ -357,7 +357,7 @@ class Tie_Point_Grid(object):
def to_GCPList(self): def to_GCPList(self):
# get copy of quality grid without no data # get copy of tie points grid without no data
try: try:
GDF = self.CoRegPoints_table.loc[self.CoRegPoints_table.ABS_SHIFT != self.outFillVal, :].copy() GDF = self.CoRegPoints_table.loc[self.CoRegPoints_table.ABS_SHIFT != self.outFillVal, :].copy()
except AttributeError: except AttributeError:
...@@ -424,7 +424,7 @@ class Tie_Point_Grid(object): ...@@ -424,7 +424,7 @@ class Tie_Point_Grid(object):
def to_PointShapefile(self, path_out=None, skip_nodata=True, skip_nodata_col ='ABS_SHIFT'): def to_PointShapefile(self, path_out=None, skip_nodata=True, skip_nodata_col ='ABS_SHIFT'):
# type: (str, bool, str) -> None # type: (str, bool, str) -> None
"""Writes the calculated geometric quality grid to a point shapefile containing """Writes the calculated tie points grid to a point shapefile containing
Tie_Point_Grid.CoRegPoints_table as attribute table. This shapefile can easily be displayed using GIS software. Tie_Point_Grid.CoRegPoints_table as attribute table. This shapefile can easily be displayed using GIS software.
:param path_out: <str> the output path. If not given, it is automatically defined. :param path_out: <str> the output path. If not given, it is automatically defined.
...@@ -444,8 +444,8 @@ class Tie_Point_Grid(object): ...@@ -444,8 +444,8 @@ class Tie_Point_Grid(object):
def _to_PointShapefile(self, skip_nodata=True, skip_nodata_col ='ABS_SHIFT'): def _to_PointShapefile(self, skip_nodata=True, skip_nodata_col ='ABS_SHIFT'):
warnings.warn(DeprecationWarning("'_quality_grid_to_PointShapefile' is deprecated." # TODO delete if other method validated warnings.warn(DeprecationWarning("'_tiepoints_grid_to_PointShapefile' is deprecated." # TODO delete if other method validated
" 'quality_grid_to_PointShapefile' is much faster.")) " 'tiepoints_grid_to_PointShapefile' is much faster."))
GDF = self.CoRegPoints_table GDF = self.CoRegPoints_table
GDF2pass = GDF if not skip_nodata else GDF[GDF[skip_nodata_col]!=self.outFillVal] GDF2pass = GDF if not skip_nodata else GDF[GDF[skip_nodata_col]!=self.outFillVal]
shapely_points = GDF2pass['geometry'].values.tolist() shapely_points = GDF2pass['geometry'].values.tolist()
......
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