module documentation
Metric module.
Class |
|
Provides different metrics, used for mapping some field vector properties to some color and alpha range. |
Function | color |
Maps normalized value to color, cyclic. |
Function | color |
Maps normalized value to color, divergent. |
Function | metric |
Calculates the divergence of a sampling volume neighborhood. |
Function | metric |
Calculates the selected norm of some vector. |
@ConditionalDecorator( get_jit_enabled(), jit, nopython=True, parallel=False)
def color_map_cyclic(color_normalized: float
) -> np.ndarray
:
¶
Maps normalized value to color, cyclic.
Note: For JIT to work, this must be declared at the top level.
Parameters | |
colorfloat | Normalized color value |
Returns | |
np.ndarray | R, G, B |
@ConditionalDecorator( get_jit_enabled(), jit, nopython=True, parallel=False)
def color_map_divergent(color_normalized: float
) -> np.ndarray
:
¶
Maps normalized value to color, divergent.
Note: For JIT to work, this must be declared at the top level.
Parameters | |
colorfloat | Normalized color value |
Returns | |
np.ndarray | R, G, B |
@ConditionalDecorator( get_jit_enabled(), jit, nopython=True, parallel=False)
def metric_divergence(neighborhood_vectors: np.ndarray
, dL: float
, polarity: int
) -> float
:
¶
Calculates the divergence of a sampling volume neighborhood.
Note: For JIT to work, this must be declared at the top level.
Parameters | |
neighborhoodnp.ndarray | Sampling volume neighborhood vectors (six 3D vectors) |
dfloat | Length element |
polarity:int | Polarity filter (-1: Keep values <= 0; 0: Keep all values; +1: Keep values >= 0) |
Returns | |
float | Undocumented |
@ConditionalDecorator( get_jit_enabled(), jit, nopython=True, parallel=False)
def metric_norm(norm_type: int
, vector: np.ndarray
) -> float
:
¶
Calculates the selected norm of some vector.
Note: For JIT to work, this must be declared at the top level.
Parameters | |
normint | Norm type |
vector:np.ndarray | 3D vector |
Returns | |
float | Scalar if successful, np.inf on error |