def _create_hpgl_shape(shape, strides=None): if strides is None: return _HPGL_SHAPE(data = _c_array(C.c_int, 3, shape), strides = _c_array(C.c_int, 3, (1, shape[0], shape[0]*shape[1]))) else: return _HPGL_SHAPE(data = _c_array(C.c_int, 3, shape), strides = _c_array(C.c_int, 3, strides))
def lvm_kriging(prop, grid, mean_data, radiuses, max_neighbours, cov_model): out_prop = _clone_prop(prop) okp = _HPGL_OK_PARAMS( covariance_type = cov_model.type, ranges = cov_model.ranges, angles = cov_model.angles, sill = cov_model.sill, nugget = cov_model.nugget, radiuses = radiuses, max_neighbours = max_neighbours) sh_data = (C.c_int * 3)(grid.x, grid.y, grid.z) sh = _HPGL_SHAPE(data=sh_data) _hpgl_so.hpgl_lvm_kriging( prop.data, prop.mask, C.byref(sh), mean_data, C.byref(sh), C.byref(okp), out_prop.data, out_prop.mask, C.byref(sh)) return out_prop
def simple_kriging(prop, grid, radiuses, max_neighbours, cov_model, mean=None): out_prop = _clone_prop(prop) skp = _HPGL_SK_PARAMS( covariance_type = cov_model.type, ranges = cov_model.ranges, angles = cov_model.angles, sill = cov_model.sill, nugget = cov_model.nugget, radiuses = radiuses, max_neighbours = max_neighbours, automatic_mean = (mean is None), mean = (mean if mean != None else 0)) sh_data = (C.c_int * 3)(grid.x, grid.y, grid.z) sh = _HPGL_SHAPE(data=sh_data) _hpgl_so.hpgl_simple_kriging( prop.data, prop.mask, C.byref(sh), C.byref(skp), out_prop[0], out_prop[1], C.byref(sh)) return out_prop