rename private function and its arguments
This commit is contained in:
parent
7499c3b375
commit
5dcea9bdac
@ -22,19 +22,19 @@ def rescaleData(data, scale, offset, dtype, clip):
|
|||||||
return data_out
|
return data_out
|
||||||
|
|
||||||
@numba.jit(nopython=True)
|
@numba.jit(nopython=True)
|
||||||
def rescale_and_lookup1d_function(xx, scale, offset, lut, yy):
|
def _rescale_and_lookup1d_function(data, scale, offset, lut, out):
|
||||||
vmin, vmax = 0, lut.shape[0] - 1
|
vmin, vmax = 0, lut.shape[0] - 1
|
||||||
for r in range(xx.shape[0]):
|
for r in range(data.shape[0]):
|
||||||
for c in range(xx.shape[1]):
|
for c in range(data.shape[1]):
|
||||||
val = (xx[r, c] - offset) * scale
|
val = (data[r, c] - offset) * scale
|
||||||
val = min(max(val, vmin), vmax)
|
val = min(max(val, vmin), vmax)
|
||||||
yy[r, c] = lut[int(val)]
|
out[r, c] = lut[int(val)]
|
||||||
|
|
||||||
def rescale_and_lookup1d(data, scale, offset, lut):
|
def rescale_and_lookup1d(data, scale, offset, lut):
|
||||||
# data should be floating point and 2d
|
# data should be floating point and 2d
|
||||||
# lut is 1d
|
# lut is 1d
|
||||||
data_out = np.empty_like(data, dtype=lut.dtype)
|
data_out = np.empty_like(data, dtype=lut.dtype)
|
||||||
rescale_and_lookup1d_function(data, float(scale), float(offset), lut, data_out)
|
_rescale_and_lookup1d_function(data, float(scale), float(offset), lut, data_out)
|
||||||
return data_out
|
return data_out
|
||||||
|
|
||||||
@numba.jit(nopython=True)
|
@numba.jit(nopython=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user