Commit 8f53b218 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Bugfix for RuntimeError during pyfftw check;

components.CoReg_local.COREG_LOCAL:
- check_if_fftw_works(): all errors occurring after COREG_obj.fftw_works has been set are now catched

 components.DeShifter.DESHIFTER:
- correct_shifts():
    - revised buggy if-condition
    - bugfix for wring way of indexing GeoArray in case band2process is None

- updated __version__
parent 10ca789e
......@@ -9,7 +9,7 @@ from .components import utilities
from .components import geometry
__author__ = 'Daniel Scheffler'
__version__= '2016-11-30_01'
__version__= '2016-12-13_01'
__all__=['COREG',
'COREG_LOCAL',
......
......@@ -212,11 +212,17 @@ class COREG_LOCAL(object):
"""Assigns the attribute 'fftw_works' to self.COREG_obj by executing shift calculation once with muted output.
"""
# calculate global shift once in order to check is fftw works
self.COREG_obj.q = True
self.COREG_obj.v = False
self.COREG_obj.calculate_spatial_shifts()
self.COREG_obj.q = self.q
self.COREG_obj.v = self.v
try:
self.COREG_obj.q = True
self.COREG_obj.v = False
self.COREG_obj.calculate_spatial_shifts()
self.COREG_obj.q = self.q
self.COREG_obj.v = self.v
except RuntimeError:
if self.COREG_obj.fftw_works is not None:
pass
else:
raise
@property
......
......@@ -213,13 +213,7 @@ class DESHIFTER(object):
t_start = time.time()
equal_prj = prj_equal(self.ref_prj,self.shift_prj)
if equal_prj and is_coord_grid_equal(self.shift_gt, *self.out_grid) and not self.align_grids and \
not self.GCPList and not self.init_kwargs.get('target_xyGrid',None):
# FIXME buggy condition:
# reconstructable with correct_spatial_shifts from GMS
#DS = DESHIFTER(geoArr, self.coreg_info,
# target_xyGrid=[usecase.spatial_ref_gridx, usecase.spatial_ref_gridy],
# cliptoextent=True, clipextent=mapBounds, align_grids=False) => align grids False
if equal_prj and is_coord_grid_equal(self.shift_gt, *self.out_grid) and not self.GCPList:
"""NO RESAMPLING NEEDED"""
self.is_shifted = True
self.is_resampled = False
......@@ -236,7 +230,8 @@ class DESHIFTER(object):
self.updated_map_info = geotransform2mapinfo(self.updated_gt, self.updated_projection)
else:
# array keeps the same; updated gt and prj are taken from coreg_info
self.arr_shifted = self.im2shift[:,:,self.band2process]
self.arr_shifted = self.im2shift[:,:,self.band2process] \
if self.band2process is not None else self.im2shift[:]
self.GeoArray_shifted = GeoArray(self.arr_shifted, tuple(self.shift_gt), self.updated_projection)
if self.path_out:
......
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