module documentation

Metric module.
Class Metric Provides different metrics, used for mapping some field vector properties to some color and alpha range.
Function color_map_cyclic Maps normalized value to color, cyclic.
Function color_map_divergent Maps normalized value to color, divergent.
Function metric_divergence Calculates the divergence of a sampling volume neighborhood.
Function metric_norm Calculates the selected norm of some vector.
@ConditionalDecorator(get_jit_enabled(), jit, nopython=True, parallel=False)
def color_map_cyclic(color_normalized):

Maps normalized value to color, cyclic.

Note: For JIT to work, this must be declared at the top level.

Parameters
color_normalized:floatNormalized color value
Returns
np.ndarrayR, G, B
@ConditionalDecorator(get_jit_enabled(), jit, nopython=True, parallel=False)
def color_map_divergent(color_normalized):

Maps normalized value to color, divergent.

Note: For JIT to work, this must be declared at the top level.

Parameters
color_normalized:floatNormalized color value
Returns
np.ndarrayR, G, B
@ConditionalDecorator(get_jit_enabled(), jit, nopython=True, parallel=False)
def metric_divergence(neighborhood_vectors, dL, polarity):

Calculates the divergence of a sampling volume neighborhood.

Note: For JIT to work, this must be declared at the top level.

Parameters
neighborhood_vectors:np.ndarraySampling volume neighborhood vectors (six 3D vectors)
dL:floatLength element
polarity:intPolarity filter (-1: Keep values <= 0; 0: Keep all values; +1: Keep values >= 0)
Returns
floatUndocumented
@ConditionalDecorator(get_jit_enabled(), jit, nopython=True, parallel=False)
def metric_norm(norm_type, vector):

Calculates the selected norm of some vector.

Note: For JIT to work, this must be declared at the top level.

Parameters
norm_type:intNorm type
vector:np.ndarray3D vector
Returns
floatScalar if successful, np.inf on error