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

Moved arosics_cli.py from bin to arosics folder to avoid entry point issues at...


Moved arosics_cli.py from bin to arosics folder to avoid entry point issues at conda-forge. Replaced some http links with https.
Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 488f9d27
......@@ -35,7 +35,7 @@
},
{
"scheme": "url",
"identifier": "http://www.mdpi.com/2072-4292/9/7/676",
"identifier": "https://www.mdpi.com/2072-4292/9/7/676",
"relation": "isCitedBy",
"resource_type": "publication-article"
}
......
......@@ -23,7 +23,7 @@ A BibTeX entry for LaTeX users should look like this
month = jul,
year = 2017,
note = {{This is the version as used in Scheffler et al.
(2017): http://www.mdpi.com/2072-4292/9/7/676.}},
(2017): https://www.mdpi.com/2072-4292/9/7/676.}},
publisher = {Zenodo},
version = {0.2.1},
doi = {10.5281/zenodo.3743085},
......
......@@ -9,7 +9,7 @@ An Automated and Robust Open-Source Image Co-Registration Software for Multi-Sen
* Free software: GNU General Public License v3 or later (GPLv3+)
* **Documentation:** https://danschef.git-pages.gfz-potsdam.de/arosics/doc/
* The (open-access) **paper** corresponding to this software repository can be found here:
`Scheffler et al. 2017 <http://www.mdpi.com/2072-4292/9/7/676>`__
`Scheffler et al. 2017 <https://www.mdpi.com/2072-4292/9/7/676>`__
(cite as: Scheffler D, Hollstein A, Diedrich H, Segl K, Hostert P. AROSICS: An Automated and Robust Open-Source
Image Co-Registration Software for Multi-Sensor Satellite Data. Remote Sensing. 2017; 9(7):676).
* Information on how to **cite the AROSICS Python package** can be found in the
......
......@@ -196,8 +196,8 @@ class COREG(object):
:param fmt_out:
raster file format for output file. ignored if path_out is None. can be any GDAL compatible raster file
format (e.g. 'ENVI', 'GTIFF'; default: ENVI). Refer to http://www.gdal.org/formats_list.html to get a full
list of supported formats.
format (e.g. 'ENVI', 'GTIFF'; default: ENVI). Refer to https://gdal.org/drivers/raster/index.html to get a
full list of supported formats.
:param out_crea_options:
GDAL creation options for the output image, e.g. ["QUALITY=80", "REVERSIBLE=YES", "WRITE_METADATA=YES"]
......@@ -260,7 +260,8 @@ class COREG(object):
map coordinates of data corners within image to be shifted. ignored if footprint_poly_tgt is given.
:param nodata:
no data values for reference image and image to be shifted
no-data values for reference image and image to be shifted. The default is (None, None) which indicates
that there is no specific no-data value for both of the input images.
:param calc_corners:
calculate true positions of the dataset corners in order to get a useful matching window position within
......@@ -1367,7 +1368,7 @@ class COREG(object):
# compute SSIM BEFORE shift correction #
########################################
# using gaussian weights could lead to value errors in case of small images when the automatically calulated
# using gaussian weights could lead to value errors in case of small images when the automatically calculated
# window size exceeds the image size
self.ssim_orig = ssim(normalize(np.ma.masked_equal(self.matchWin[:],
self.matchWin.nodata)),
......
......@@ -128,8 +128,8 @@ class COREG_LOCAL(object):
:param fmt_out:
raster file format for output file. ignored if path_out is None. Can be any GDAL compatible raster file
format (e.g. 'ENVI', 'GTIFF'; default: ENVI). Refer to http://www.gdal.org/formats_list.html to get a full
list of supported formats.
format (e.g. 'ENVI', 'GTIFF'; default: ENVI). Refer to https://gdal.org/drivers/raster/index.html to get a
full list of supported formats.
:param out_crea_options:
GDAL creation options for the output image, e.g. ["QUALITY=80", "REVERSIBLE=YES", "WRITE_METADATA=YES"]
......
......@@ -117,12 +117,12 @@ def get_arosics_argparser():
'(daniel.scheffler [at] gfz-potsdam [dot] de). The scientific background is described in the paper '
'Scheffler D, Hollstein A, Diedrich H, Segl K, Hostert P. AROSICS: An Automated and Robust '
'Open-Source Image Co-Registration Software for Multi-Sensor Satellite Data. Remote Sensing. 2017;'
' 9(7):676." (http://www.mdpi.com/2072-4292/9/7/676)',
' 9(7):676." (https://www.mdpi.com/2072-4292/9/7/676)',
epilog="DETAILED DESCRIPTION: AROSICS detects and corrects global as well as local misregistrations between "
"two input images in the subpixel scale, that are often present in satellite imagery. The input images "
"can have any GDAL compatible image format (http://www.gdal.org/formats_list.html). Both of them must "
"be approximately geocoded. In case of ENVI files, this means they must have a 'map info' and a "
"can have any GDAL compatible image format (https://gdal.org/drivers/raster/index.html). Both of them "
"must be approximately geocoded. In case of ENVI files, this means they must have a 'map info' and a "
"'coordinate system string' as attributes of their header file. The input images must have a geographic "
"overlap but clipping them to same geographical extent is NOT neccessary. Please do not perform any "
"spatial resampling of the input images before applying this algorithm. Any needed resampling of the "
......
......@@ -19,7 +19,7 @@ is automatically calculated.
For detailed algorithm description and use cases refer to the corresponding (open-access) paper that can be found here:
`Scheffler D, Hollstein A, Diedrich H, Segl K, Hostert P. AROSICS: An Automated and Robust Open-Source Image
Co-Registration Software for Multi-Sensor Satellite Data. Remote Sensing. 2017; 9(7):676
<http://www.mdpi.com/2072-4292/9/7/676>`__.
<https://www.mdpi.com/2072-4292/9/7/676>`__.
* GitLab Repository: https://git.gfz-potsdam.de/danschef/arosics/
......
......@@ -7,7 +7,7 @@ arosics
At the command line, arosics provides the **arosics** command:
.. argparse::
:filename: ./../bin/arosics_cli.py
:filename: ./../arosics/arosics_cli.py
:func: get_arosics_argparser
:prog: arosics
......
......@@ -31,7 +31,7 @@ project_root = os.path.dirname(cwd)
# version is used.
sys.path.insert(0, project_root)
import arosics
import arosics # noqa E402
# -- General configuration ---------------------------------------------
......
......@@ -144,7 +144,7 @@ numpy array and its corresponding geoinformation.
To write the coregistered image to disk, the :class:`arosics.COREG` class needs to be instanced with a filepath given to
keyword 'path_out'. The output raster format can be any format supported by GDAL.
Find a list of supported formats here: http://www.gdal.org/formats_list.html
Find a list of supported formats here: https://gdal.org/drivers/raster/index.html
apply detected shifts to multiple images
......
......@@ -5,7 +5,7 @@ Compatible image formats
~~~~~~~~~~~~~~~~~~~~~~~~
The input images can have any GDAL compatible image format. You can find a list here:
http://www.gdal.org/formats_list.html
https://gdal.org/drivers/raster/index.html
Geocoding
......
......@@ -90,7 +90,7 @@ setup(
description="An Automated and Robust Open-Source Image Co-Registration Software for Multi-Sensor Satellite Data",
entry_points={
'console_scripts': [
'arosics=bin.arosics_cli:main',
'arosics=arosics.arosics_cli:main',
],
},
extras_require={
......@@ -107,7 +107,7 @@ setup(
long_description=readme + '\n\n' + history,
name='arosics',
packages=find_packages(exclude=['tests*']),
scripts=["bin/arosics_cli.py"], # TODO Deprecated in 1.4.1. Remove in future.
scripts=["arosics/arosics_cli.py"], # TODO Deprecated in 1.4.1. Remove in future.
setup_requires=req_setup,
test_suite='tests',
tests_require=req + req_test,
......
......@@ -308,6 +308,78 @@ class CompleteWorkflow_INTER1_S2A_S2A(unittest.TestCase):
CR.show_image_footprints()
class Test_Bug_SSIM_unequal_dims(unittest.TestCase):
def test_coreg(self):
# ref = '/home/gfz-fe/scheffler/temp/coreg_bug_ssim_unequal_dims/rgb.tif'
ref = '/home/gfz-fe/scheffler/temp/coreg_bug_ssim_unequal_dims/rgb_BSQ.bsq'
tgt = '/home/gfz-fe/scheffler/temp/coreg_bug_ssim_unequal_dims/red.tif'
cr = COREG(ref, tgt, wp=(392820.125995486, 5178269.142020599), ws=(2056, 2056), progress=False, nodata=(0, 0))
cr.calculate_spatial_shifts()
def test_coreg_local(self):
from arosics import COREG_LOCAL
# ref = '/home/gfz-fe/scheffler/temp/coreg_bug_ssim_unequal_dims/rgb.tif'
ref = '/home/gfz-fe/scheffler/temp/coreg_bug_ssim_unequal_dims/rgb_BSQ.bsq'
tgt = '/home/gfz-fe/scheffler/temp/coreg_bug_ssim_unequal_dims/red.tif'
kwargs = dict(
grid_res=512,
window_size=(2056, 2056),
path_out='/home/gfz-fe/scheffler/temp/coreg_bug_ssim_unequal_dims/output.tif',
projectDir=None,
q=False,
v=True,
fmt_out='GTIFF',
min_reliability=60,
max_shift=128,
max_iter=3,
match_gsd=False,
out_crea_options=[
'PHOTOMETRIC=MINISBLACK',
'COMPRESS=LZW',
'ALPHA=NO'],
CPUs=1)
# kwargs['nodata'] = (-10000, -10000)
kwargs['nodata'] = (0, -10000)
CRL = COREG_LOCAL(ref, tgt, **kwargs)
CRL.correct_shifts()
def test_from_dump(self):
import dill
with open('/home/gfz-fe/scheffler/temp/coreg_bug_ssim_unequal_dims/dump.dill', 'rb') as inF:
cr = dill.load(inF)
cr.ref.nodata = 0
cr.ignErr = False
cr.calculate_spatial_shifts()
cr._validate_ssim_improvement()
class Test_Bug_SSIM_outOfRange(unittest.TestCase):
def test_coreg(self):
ref = '/home/gfz-fe/scheffler/temp/coreg_raul_alonso/reference.tif'
tgt = '/home/gfz-fe/scheffler/temp/coreg_raul_alonso/target.tif'
crl = COREG(ref, tgt,
# window_size=(512,512),
max_shift=10,
nodata=(0, 0))
crl.calculate_spatial_shifts()
crl = None
def test_coreg_local(self):
from arosics import COREG_LOCAL
ref = '/home/gfz-fe/scheffler/temp/coreg_raul_alonso/reference.tif'
tgt = '/home/gfz-fe/scheffler/temp/coreg_raul_alonso/target.tif'
crl = COREG_LOCAL(ref, tgt, 50,
# window_size=(512,512),
max_shift=10,
min_reliability=40,
calc_corners=False,
nodata=(0, 0))
crl.calculate_spatial_shifts()
if __name__ == '__main__':
import nose2
nose2.main()
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