Commit 3d797200 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Implemented changes from the current branch of geoarray (feature/improve_metadata_handling).

parent 23cd8ab3
Pipeline #3085 failed with stages
in 2 minutes and 24 seconds
......@@ -430,34 +430,15 @@ 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 = \
return geoArr_cr
if self.grid2use == 'ref':
# resample target image to reference image
self.shift.arr = self.shift[:, :, self.shift.band4match] # resample the needed band only
self.shift = apply_subset_bandnames_metadata(self.shift)
self.shift.get_subset(zslice=slice(self.shift.band4match, self.shift.band4match + 1))
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
# 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.get_subset(zslice=slice(self.ref.band4match, self.ref.band4match + 1))
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
......@@ -608,7 +589,6 @@ class COREG(object):
def _get_opt_winpos_winsize(self):
# type: (tuple,tuple) -> None
Calculates optimal window position and size in reference image units according to DGM, cloud_mask and
......@@ -318,7 +318,7 @@ class COREG_LOCAL(object):
def CoRegPoints_table(self):
"""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
information containing all the results frm coregistration for all points in the tie point grid.
information containing all the results from coregistration for all points in the tie point grid.
return self.tiepoint_grid.CoRegPoints_table
Supports Markdown
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