python - scipy.interpolate.griddata: cut z-value and get area inside it -
regarding this: analogy scipy.interpolate.griddata? have additional question: output looks this:
it's pyramid noise (and without ground side). there possibility in scipy.interpolate.griddata enter/choose z-value points aren't equal z-values gets deleted? in example: e.g. enter high z-value -> points red-value (= z-value) should stay alive , show me non-filled, noised, red triangle. goal area inside noised triangle.
edit: tldr: learned, it's isoline looking , area inside it.
edit2: found out example http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.griddata.html "grid_z1.t" returns me array z-values. in loop eliminate values not equal z-value -> got isoline. problem is, it's not rellay isoline grid iso-values. it's quite ok, maybe there better solutions? there other methods grid_z.t fit needs?
this best done before transform data grid form:
>>> x = [0,4,17] >>> y = [-7,25,116] >>> z = [50,112,47] >> data = np.column_stack([x, y, z]) array([[ 0, -7, 50], [ 4, 25, 112], # <<---------------- keep [ 17, 116, 47]]) >>> data = data[data[:,2] == 112] # points z==112 array([[ 4, 25, 112]])
then can transform data plotting using griddata or example function given here:
x, y, z = grid(data[0], data[1], data[2])
Comments
Post a Comment