You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BiasCorr should arguably fail if it encounters a DEM with only nans. Right now, a numpy warning occurs which is not very useful in identifying the problem.
Minimal example:
In [1]: importxdemIn [2]: importnumpyasnpIn [3]: biascorr=xdem.coreg.BiasCorr()
In [4]: dem1=np.ones((50, 50))
In [5]: dem2=np.ones((50, 50)) +np.nanIn [6]: biascorr.fit(dem1, dem2, transform=None)
/home/erik/.local/share/conda/xdem/lib/python3.8/site-packages/numpy/lib/function_base.py:380: RuntimeWarning: Meanofemptyslice.
avg=a.mean(axis)
/home/erik/.local/share/conda/xdem/lib/python3.8/site-packages/numpy/core/_methods.py:188: RuntimeWarning: invalidvalueencounteredindouble_scalarsret=ret.dtype.type(ret/rcount)
A sanity check should be added to make sure that the function fails instead of giving quite useless warnings!
The text was updated successfully, but these errors were encountered:
BiasCorr
should arguably fail if it encounters a DEM with only nans. Right now, a numpy warning occurs which is not very useful in identifying the problem.Minimal example:
A sanity check should be added to make sure that the function fails instead of giving quite useless warnings!
The text was updated successfully, but these errors were encountered: