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

Revised imports within console argument parser and __init__.py; refactored...

Revised imports within console argument parser and __init__.py; refactored 'deshifted' keyword of CoReg.COREG.show_matchWin() to 'after_correction'.
parent dc776a4d
Pipeline #448 passed with stages
in 1 minute and 21 seconds
......@@ -460,12 +460,12 @@ class COREG(object):
return m
def show_matchWin(self, figsize=(15,15), interactive=True, deshifted=False):
def show_matchWin(self, figsize=(15,15), interactive=True, after_correction=False):
"""Show the image content within the matching window.
:param figsize: <tuple> figure size
:param interactive: <bool> whether to return an interactive figure based on 'holoviews' library
:param deshifted: <bool> whether to put the image content AFTER shift correction into the figure
:param figsize: <tuple> figure size
:param interactive: <bool> whether to return an interactive figure based on 'holoviews' library
:param after_correction: <bool> whether to put the image content AFTER shift correction into the figure
:return:
"""
if interactive:
......@@ -522,12 +522,12 @@ class COREG(object):
warnings.filterwarnings('default')
#return hmap
return hmap_orig if not deshifted else hmap_corr
return hmap_orig if not after_correction else hmap_corr
else:
# TODO add titles
self.matchWin.show(figsize=figsize)
if deshifted:
if after_correction:
self._get_deshifted_otherWin().show(figsize=figsize)
else:
self.otherWin.show(figsize=figsize)
......
......@@ -627,7 +627,8 @@ class Tie_Point_Grid(object):
:param path_out: <str> the output path. If not given, it is automatically defined.
:param fmt: <str> output raster format string
:param mode: <str> 'uv': outputs X-/Y shifts
:param mode: <str> The mode how the output is written ('uv' or 'md'; default: 'md')
'uv': outputs X-/Y shifts
'md': outputs magnitude and direction
"""
......
......@@ -7,8 +7,18 @@ __email__ = 'daniel.scheffler@gfz-potsdam.de'
__version__ = '0.4.11'
__versionalias__ = '2017-07-11_01'
import warnings
from .CoReg import COREG
from .CoReg_local import COREG_LOCAL
from .DeShifter import DESHIFTER
from .Tie_Point_Grid import Tie_Point_Grid
from arosics.CoReg import COREG
from arosics.CoReg_local import COREG_LOCAL
from arosics.DeShifter import DESHIFTER
from arosics.Tie_Point_Grid import Tie_Point_Grid
# check optional dependencies
try:
import pyfftw
except ImportError:
warnings.warn('PYFFTW library is missing. However, coregistration works. But in some cases it can be much slower.')
del warnings, pyfftw
......@@ -5,31 +5,9 @@ __author__ = "Daniel Scheffler"
import time
import sys
import os
import warnings
# custom
try:
import pyfftw
except ImportError:
print('PYFFTW library is missing. However, coregistration works. But in some cases it can be much slower.')
try:
import gdal
import osr
import ogr
except ImportError:
from osgeo import gdal
from osgeo import osr
from osgeo import ogr
# internal modules
sys.path.append(os.path.abspath(os.path.dirname(__file__))) # append AROSICS root directory
sys.path.append(os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..')))
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../geoarray')))
import geoarray
from arosics import COREG, COREG_LOCAL, __version__
import py_tools_ds
......
......@@ -175,7 +175,7 @@ class CompleteWorkflow_INTER1_S2A_S2A(unittest.TestCase):
CR.show_cross_power_spectrum()
CR.show_cross_power_spectrum(interactive=True)
CR.show_matchWin(interactive=False)
CR.show_matchWin(interactive=False, deshifted=True)
CR.show_matchWin(interactive=False, after_correction=True)
# CR.show_matchWin(interactive=True) # only works if test is started with ipython
# CR.show_matchWin(interactive=False, deshifted=True)
CR.show_image_footprints()
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