Open zgxn opened 4 years ago
Thanks @zgxn - could you outline an approximate workflow to replicate this?
Hi @daniellivingston,
examples/data/dem.asc
set xllcorner
and yllcorner
to nonzero values. For example:
xllcorner 35000.0
yllcorner 430000.0
examples
-folder:
import tinerator as tin
import numpy as np
my_dem = tin.load.from_file('data/dem.asc') my_dem.build_uniform_triplane(100.0) depths = [0.1, 0.3, 0.6, 10.0] ids = range(1, len(depths)+1) my_dem.build_layered_mesh(depths, matids = ids)
attr = np.zeros_like(my_dem, dtype = int) + 100 my_dem.add_attribute(attr, layers=[1], dtype=int)
## Error
This should results in something like:
Traceback (most recent call last):
File "test.py", line 13, in
Exception ignored in: <function DEM.del at 0x7f8cb96d9f70>
Traceback (most recent call last):
File "/Users/IOzgen/opt/anaconda3/envs/geo/lib/python3.8/site-packages/tinerator/dem_class.py", line 68, in del
TypeError: 'NoneType' object is not callable
## Coda
Setting the `xllcorner` and `yllcorner` to zero fixes the issue:
import tinerator as tin import numpy as np
my_dem = tin.load.from_file('data/dem.asc') my_dem.xll_corner = 0.0 my_dem.yll_corner = 0.0 my_dem.build_uniform_triplane(100.0) depths = [0.1, 0.3, 0.6, 10.0] ids = range(1, len(depths)+1) my_dem.build_layered_mesh(depths, matids = ids)
attr = np.zeros_like(my_dem, dtype = int) + 100 my_dem.add_attribute(attr, layers=[1], dtype=int)
Thanks @zgxn , will try to resolve today
(Using
tinerator v0.3.3
) -- Ifdem.xll_corner
anddem.yll_corner
are unequal zero, there seems to be an issue with correct offsets. Attempting to interpolate gives:Exception: ERROR: INTERPOLATE found zero sink points inside source grid.