class documentation
Provides different metrics, used for mapping some field vector properties to some color and alpha range.
Static Method | boost |
"Boosts" an array of color values. |
Method | __init__ |
Initializes an empty metric. |
Method | recalculate |
Recalculates color and alpha values for field. |
Method | set |
Sets the parameters. |
Class Variable |
|
Undocumented |
Class Variable |
|
Undocumented |
Instance Variable | alpha |
Undocumented |
Instance Variable | color |
Undocumented |
Property | colors |
Returns calculated colors. |
Property | limits |
Returns calculated limits. |
Static Method | _divergence |
Calculates the divergence values of a list of vectors. |
Static Method | _norm |
Calculates the norm values of a list of vectors. |
Static Method | _normalize |
Normalizes color and alpha norm values, populates final color values. |
Instance Variable | _colors |
Undocumented |
Instance Variable | _limits |
Undocumented |
Inherited from Validatable
:
Method | valid |
No summary |
Property | valid |
True if valid, False if invalid |
Instance Variable | _valid |
Undocumented |
@staticmethod
@ConditionalDecorator( get_jit_enabled(), jit, nopython=True, parallel=True)
def boost_colors(boost: @ConditionalDecorator(
float
, direction: float
, colors: np.ndarray
) -> np.ndarray
:
¶
"Boosts" an array of color values.
Parameters | |
boost:float | Boost value |
direction:float | Boost direction |
colors:np.ndarray | Colors (ordered list of 4-tuples) |
Returns | |
np.ndarray | Colors (ordered list of 4-tuples) |
Initializes an empty metric.
This class holds a pair of metric presets. Using these metric presets, colors (including alpha channel) and field limits are calculated.
def recalculate(self, sampling_volume:
SamplingVolume
, field: Field
, progress_callback: Callable
) -> bool
:
¶
Recalculates color and alpha values for field.
Parameters | |
samplingSamplingVolume | SamplingVolume |
field:Field | Field |
progressCallable | Progress callback |
Returns | |
bool | True (currently non-interruptable) |
Sets the parameters.
Parameters | |
colordict | Color metric preset (dictionary) |
alphadict | Alpha metric preset (dictionary) |
@staticmethod
@ConditionalDecorator( get_jit_enabled(), jit, nopython=True, parallel=True)
def _divergence_worker(sampling_volume_neighborhood_indices: @ConditionalDecorator(
list[ np.ndarray]
, vectors: np.ndarray
, dL: int
, polarity: int
) -> np.ndarray
:
¶
Calculates the divergence values of a list of vectors.
Parameters | |
samplinglist[ | Ordered list of sampling volume neighborhood indices |
vectors:np.ndarray | Ordered list of 3D vectors |
dint | Length element |
polarity:int | Polarity filter (-1: Keep values <= 0; 0: Keep all values; +1: Keep values >= 0) |
Returns | |
np.ndarray | Norm values |
@staticmethod
@ConditionalDecorator( get_jit_enabled(), jit, nopython=True, parallel=True)
def _norm_worker(norm_type: @ConditionalDecorator(
int
, vectors: np.ndarray
) -> np.ndarray
:
¶
Calculates the norm values of a list of vectors.
Parameters | |
normint | Norm type |
vectors:np.ndarray | Ordered list of 3D vectors |
Returns | |
np.ndarray | Norm values |
@staticmethod
@ConditionalDecorator( get_jit_enabled(), jit, nopython=True, parallel=True)
def _normalize_worker(color_map_id: @ConditionalDecorator(
str
, color_is_log: bool
, color_norm_values, color_norm_min: float
, color_norm_max: float
, alpha_is_log: bool
, alpha_norm_values: np.ndarray
, alpha_norm_min: float
, alpha_norm_max: float
, colors: np.ndarray
) -> np.ndarray
:
¶
Normalizes color and alpha norm values, populates final color values.
Parameters | |
colorstr | Color map ID |
colorbool | Selects logarithmic normalizer for color |
color | Color norm values |
colorfloat | Minimum color norm value |
colorfloat | Maximum color norm value |
alphabool | Selects logarithmic normalizer for alpha |
alphanp.ndarray | Alpha norm values |
alphafloat | Minimum alpha norm value |
alphafloat | Maximum alpha norm value |
colors:np.ndarray | Color value list to populate (list of 4D vectors) |
Returns | |
np.ndarray | Color values (list of 4D vectors) |