TypeError: reduction operation 'argmax' not allowed for this dtype
Calculating actual data corner coordinates for reference image...
/home/gfz-fe/miniconda3/envs/enpt_test/lib/python3.8/site-packages/geoarray/baseclasses.py:760: UserWarning:
Automatic nodata value detection returned the value 0.0 for GeoArray 'ortho_80m_clipped' but this seems to be unreliable (occurs in only 1 image corner). To avoid automatic detection, just pass the correct nodata value.
warnings.warn("\nAutomatic nodata value detection returned the value %s for GeoArray '%s' but this "
Automatically detected nodata value for GeoArray_CoReg 'ortho_80m_clipped': 0.0
Polygonize progress |==================================================| 100.0% Complete => 0:00:00
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-19-b623e1bdff3e> in <module>
----> 1 CR = COREG(im_reference, im_target)
~/miniconda3/envs/enpt_test/lib/python3.8/site-packages/arosics/CoReg.py in __init__(self, im_ref, im_tgt, path_out, fmt_out, out_crea_options, r_b4match, s_b4match, wp, ws, max_iter, max_shift, align_grids, match_gsd, out_gsd, target_xyGrid, resamp_alg_deshift, resamp_alg_calc, footprint_poly_ref, footprint_poly_tgt, data_corners_ref, data_corners_tgt, nodata, calc_corners, binary_ws, mask_baddata_ref, mask_baddata_tgt, CPUs, force_quadratic_win, progress, v, path_verbose_out, q, ignore_errors)
307
308 gdal.AllRegister()
--> 309 self._get_image_params()
310 self._set_outpathes(im_ref, im_tgt)
311 self.grid2use = 'ref' if self.shift.xgsd <= self.ref.xgsd else 'shift'
~/miniconda3/envs/enpt_test/lib/python3.8/site-packages/arosics/CoReg.py in _get_image_params(self)
439
440 def _get_image_params(self):
--> 441 self.ref = GeoArray_CoReg(self.params, 'ref')
442 self.shift = GeoArray_CoReg(self.params, 'shift')
443
~/miniconda3/envs/enpt_test/lib/python3.8/site-packages/arosics/CoReg.py in __init__(self, CoReg_params, imID)
119
120 # validate footprint poly
--> 121 if not self.footprint_poly.is_valid:
122 self.footprint_poly = self.footprint_poly.buffer(0)
123
~/miniconda3/envs/enpt_test/lib/python3.8/site-packages/geoarray/baseclasses.py in footprint_poly(self)
493 multipolygon = raster2polygon(self.mask_nodata.astype(np.uint8), self.gt, self.prj, exact=False,
494 progress=self.progress, q=self.q, maxfeatCount=10, timeout=3)
--> 495 self._footprint_poly = fill_holes_within_poly(multipolygon)
496 except (RuntimeError, TimeoutError):
497 if not self.q:
~/miniconda3/envs/enpt_test/lib/python3.8/site-packages/py_tools_ds/geo/vector/topology.py in fill_holes_within_poly(poly)
187 lambda GDF_row: Polygon(np.swapaxes(np.array(GDF_row.geometry.exterior.coords.xy), 0, 1)).area, axis=1)
188
--> 189 largest_poly_filled = gdf.loc[gdf['area_filled'].idxmax()]['geometry']
190
191 # return the outer boundary of the largest polygon
~/miniconda3/envs/enpt_test/lib/python3.8/site-packages/pandas/core/series.py in idxmax(self, axis, skipna, *args, **kwargs)
2166 """
2167 skipna = nv.validate_argmax_with_skipna(skipna, args, kwargs)
-> 2168 i = nanops.nanargmax(self._values, skipna=skipna)
2169 if i == -1:
2170 return np.nan
~/miniconda3/envs/enpt_test/lib/python3.8/site-packages/pandas/core/nanops.py in _f(*args, **kwargs)
64 if any(self.check(obj) for obj in obj_iter):
65 f_name = f.__name__.replace("nan", "")
---> 66 raise TypeError(
67 f"reduction operation '{f_name}' not allowed for this dtype"
68 )
TypeError: reduction operation 'argmax' not allowed for this dtype
Edited by Daniel Scheffler