demcoreg icon indicating copy to clipboard operation
demcoreg copied to clipboard

dem_align tiltcorr error

Open jacksonbodtker opened this issue 2 years ago • 1 comments

Hi, I am running into an issue when I attempt to use the tiltcorr function when aligning dems. Everything works great running the basic command without the addition of tiltcorr but when I add it I get an error message (copied below). Not sure what this is trying to tell me and was hoping someone here could point me in the right direction!

Thanks, Jackson


Calculating 'tiltcorr' 2D polynomial fit to residuals with order 1


Excluding values outside of percentile range: 0.00 to 100.00 Excluding values outside of range: -19.771729 to 19.140015 [-4.48856504e-11 4.17859625e-06 -3.66286135e-05 2.25317262e-11] Z shift offset array mean: 0.34901226247618106 Creating plot of polynomial fit to residuals Traceback (most recent call last): File "/home/jacksonbodtker/src/demcoreg/demcoreg/dem_align.py", line 603, in main() File "/home/jacksonbodtker/src/demcoreg/demcoreg/dem_align.py", line 400, in main ax = pltlib.iv(valgrid, ax=axa[1], cmap='RdBu', clim=dz_clim,
File "/home/jacksonbodtker/src/imview/imview/lib/pltlib.py", line 100, in iv res = geolib.get_res(ds, c_srs)[0] File "/home/jacksonbodtker/src/pygeotools/pygeotools/lib/geolib.py", line 1256, in get_res extent = ds_extent(ds, t_srs) File "/home/jacksonbodtker/src/pygeotools/pygeotools/lib/geolib.py", line 1384, in ds_extent ul = ct.TransformPoint(*ul) File "/home/jacksonbodtker/miniconda3/envs/demcoreg_env1/lib/python3.10/site-packages/osgeo/osr.py", line 1150, in TransformPoint return _osr.CoordinateTransformation_TransformPoint(self, *args) NotImplementedError: Wrong number or type of arguments for overloaded function 'CoordinateTransformation_TransformPoint'. Possible C/C++ prototypes are: OSRCoordinateTransformationShadow::TransformPoint(double [3]) OSRCoordinateTransformationShadow::TransformPoint(double [4]) OSRCoordinateTransformationShadow::TransformPoint(double [3],double,double,double) OSRCoordinateTransformationShadow::TransformPoint(double [4],double,double,double,double)

jacksonbodtker avatar Mar 04 '22 16:03 jacksonbodtker

There are some known bugs in the old tiltcorr functionality on main branch. This error looks like a GDAL 2 to GDAL 3 issue. This was fixed and we added improved n-order polynomial fitting capabilities to the elevation difference residuals in a different branch: https://github.com/dshean/demcoreg/tree/polyfit_fix We leveraged some of the "deramp" code in DemUtils for this, now renamed xdem: https://github.com/GlacioHack/xdem.
Need to revisit dependencies and clean up imports, or isolate relevant "deramp" code and add to coreglib.

dshean avatar Mar 09 '22 16:03 dshean