Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Scheffler
arosics
Commits
5946f3e0
Commit
5946f3e0
authored
Apr 05, 2018
by
Daniel Scheffler
Browse files
Merge branch 'master' into bugfix/fix_missing_requirements
parents
13ec9051
c7fda6b8
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
arosics/CoReg.py
View file @
5946f3e0
...
...
@@ -4,6 +4,7 @@ import os
import
time
import
warnings
from
copy
import
copy
from
typing
import
Iterable
# custom
try
:
...
...
@@ -215,8 +216,8 @@ class COREG(object):
if
data_corners_tgt
and
not
isinstance
(
data_corners_tgt
[
0
],
list
):
# group if not [[x,y],[x,y]..]
data_corners_tgt
=
[
data_corners_tgt
[
i
:
i
+
2
]
for
i
in
range
(
0
,
len
(
data_corners_tgt
),
2
)]
if
nodata
:
assert
isinstance
(
nodata
,
tup
le
)
and
len
(
nodata
)
==
2
,
\
"'nodata' must be a
tup
le with two values. Got %s with length %s."
%
(
type
(
nodata
),
len
(
nodata
))
assert
isinstance
(
nodata
,
Iterab
le
)
and
len
(
nodata
)
==
2
,
\
"'nodata' must be a
n iterab
le with two values. Got %s with length %s."
%
(
type
(
nodata
),
len
(
nodata
))
for
rspAlg
in
[
resamp_alg_deshift
,
resamp_alg_calc
]:
assert
rspAlg
in
_dict_rspAlg_rsp_Int
.
keys
(),
"'%s' is not a supported resampling algorithm."
%
rspAlg
if
resamp_alg_calc
in
[
'average'
,
5
]
and
(
v
or
not
q
):
...
...
@@ -429,15 +430,34 @@ class COREG(object):
if
not
self
.
q
:
print
(
"Equalizing pixel grids and projections of reference and target image..."
)
# noinspection PyProtectedMember
def
apply_subset_bandnames_metadata
(
geoArr_cr
):
# TODO: replace that function with geoArr.get_subset(zslice=slice(band4match, band4match+1))
# TODO: as soon as all metadata are passed through get_subset()
zslice
=
slice
(
geoArr_cr
.
band4match
,
geoArr_cr
.
band4match
+
1
)
if
geoArr_cr
.
_bandnames
:
geoArr_cr
.
bandnames
=
list
(
np
.
array
(
list
(
geoArr_cr
.
_bandnames
))[
zslice
])
if
geoArr_cr
.
_metadata
is
not
None
:
geoArr_cr
.
metadata
=
\
geoArr_cr
.
_metadata
[
list
(
np
.
array
(
range
(
len
(
geoArr_cr
.
_metadata
.
columns
)))[
zslice
])].
copy
()
return
geoArr_cr
if
self
.
grid2use
==
'ref'
:
# resample target image to refernce image
# resample target image to refer
e
nce image
self
.
shift
.
arr
=
self
.
shift
[:,
:,
self
.
shift
.
band4match
]
# resample the needed band only
self
.
shift
=
apply_subset_bandnames_metadata
(
self
.
shift
)
self
.
shift
.
reproject_to_new_grid
(
prototype
=
self
.
ref
,
CPUs
=
self
.
CPUs
)
self
.
shift
.
band4match
=
0
# after resampling there is only one band in the GeoArray
else
:
# resample reference image to target image
# FIXME in case of different projections this will change the projection of the reference image!
self
.
ref
.
arr
=
self
.
ref
[:,
:,
self
.
ref
.
band4match
]
# resample the needed band only
self
.
ref
=
apply_subset_bandnames_metadata
(
self
.
ref
)
self
.
ref
.
reproject_to_new_grid
(
prototype
=
self
.
shift
,
CPUs
=
self
.
CPUs
)
self
.
ref
.
band4match
=
0
# after resampling there is only one band in the GeoArray
...
...
arosics/__init__.py
View file @
5946f3e0
...
...
@@ -12,8 +12,8 @@ from arosics.Tie_Point_Grid import Tie_Point_Grid
__author__
=
"""Daniel Scheffler"""
__email__
=
'daniel.scheffler@gfz-potsdam.de'
__version__
=
'0.8.
1
'
__versionalias__
=
'201
7-11-21
_0
2
'
__version__
=
'0.8.
4
'
__versionalias__
=
'201
8-03-08
_0
1
'
__all__
=
[
'COREG'
,
'COREG_LOCAL'
,
'DESHIFTER'
,
...
...
bin/arosics_cli.py
View file @
5946f3e0
This diff is collapsed.
Click to expand it.
setup.py
View file @
5946f3e0
...
...
@@ -28,7 +28,7 @@ test_requirements = requirements + ['coverage', 'nose', 'nose-htmloutput', 'redn
setup
(
name
=
'arosics'
,
version
=
'0.8.
1
'
,
version
=
'0.8.
4
'
,
description
=
"An Automated and Robust Open-Source Image Co-Registration Software for Multi-Sensor Satellite Data"
,
long_description
=
readme
+
'
\n\n
'
+
history
,
author
=
"Daniel Scheffler"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment