Math Operations¶
Array Math¶
-
class
PVGeo.filters.math.
ArrayMath
(**kwargs)[source]¶ Bases:
PVGeo.base.FilterPreserveTypeBase
This filter allows the user to select two input data arrays on which to perfrom math operations. The input arrays are used in their order of selection for the operations.
- Parameters
Available Math Operations:
add: This adds the two data arrays together
subtract: This subtracts input array 2 from input array 1
multiply: Multiplies the two data arrays together
divide: Divide input array 1 by input array 2 (arr1/arr2)
correlate: Use np.correlate(arr1, arr2, mode=’same’)
-
RequestData
(request, inInfo, outInfo)[source]¶ Used by pipeline to perfrom operation and generate output
-
static
_correlate
(arr1, arr2)[source]¶ Use
np.correlate()
onmode='same'
on two selected arrays from one input.
-
_math_up
(pdi, pdo)[source]¶ Make sure to pass array names and integer associated fields. Use helpers to get these properties.
-
apply
(input_data_object, array_name_0, array_name_1)[source]¶ Run the algorith on an input data object, specifying array names
-
static
get_operation
(idx)[source]¶ Gets a math operation based on an index in the keys
- Returns
the math operation method
- Return type
callable
-
static
get_operations
()[source]¶ Returns the math operation methods as callable objects in a dictionary
Arrays To RGBA¶
-
class
PVGeo.filters.math.
ArraysToRGBA
(**kwargs)[source]¶ Bases:
PVGeo.base.FilterPreserveTypeBase
Use arrays from input data object to set an RGBA array. Sets colors and transparencies.
Normalize Array¶
-
class
PVGeo.filters.math.
NormalizeArray
(**kwargs)[source]¶ Bases:
PVGeo.base.FilterPreserveTypeBase
This filter allows the user to select an array from the input data set to be normalized. The filter will append another array to that data set for the output. The user can specify how they want to rename the array, can choose a multiplier, and can choose from several types of common normalizations (more functionality added as requested).
- Parameters
Normalization Types:
feature_scale: Feature Scale
standard_score: tandard Score
log10: Natural Log
natural_log: Log Base 10
just_multiply: Only Multiply by Multiplier
-
apply
(input_data_object, array_name)[source]¶ Run the algorithm on an input data object, specifying the array
-
static
get_array_range
(pdi, field, name)[source]¶ Returns a tuple of the range for a
vtkDataArray
on avtkDataObject
.
-
static
get_normalization
(idx)[source]¶ Gets a normalization based on an index in the keys
- Returns
the normalization method
- Return type
callable
-
static
get_normalizations
()[source]¶ All Available normalizations
- Returns
dictionary of callable methods for normalizing an array
- Return type
-
set_multiplier
(val)[source]¶ This is a static shifter/scale factor across the array after normalization.
Percent Threshold¶
-
class
PVGeo.filters.math.
PercentThreshold
(percent=50, invert=False, **kwargs)[source]¶ Bases:
PVGeo.base.FilterBase
Allows user to select a percent of the data range to threshold. This will find the data range of the selected input array and remove the bottom percent. This can be reversed using the invert property.
-
apply
(input_data_object, array_name)[source]¶ Run the algorithm on an input data object, specifying the array
-