MCPcopy Create free account
hub / github.com/Astropulse/hexmap / normalize01

Function normalize01

map.py:256–261  ·  view source on GitHub ↗
(a: np.ndarray)

Source from the content-addressed store, hash-verified

254
255
256def normalize01(a: np.ndarray) -> np.ndarray:
257 mn = float(a.min())
258 mx = float(a.max())
259 if mx - mn < 1e-8:
260 return np.zeros_like(a, dtype=np.float32)
261 return ((a - mn) / (mx - mn)).astype(np.float32)
262
263
264def smooth_box(a: np.ndarray, passes: int) -> np.ndarray:

Callers 4

ridged01Function · 0.85
noise_fieldFunction · 0.85
build_fieldsFunction · 0.85
carve_riversFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected