Normalize Array

This example will demonstrate how to perform a normalization or any custom mathematical operation on a single data array for an input data set.

This filter allow 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 two types of common normalizations: Feature Scaling and Standard Score.

This example demos PVGeo.filters.NormalizeArray

from pyvista import examples

from PVGeo.filters import NormalizeArray

Create some input data. this can be any vtkDataObject

mesh = examples.load_uniform()
title = "Spatial Point Data"
mesh.plot(scalars=title)
normalize array
# Apply the filter
f = NormalizeArray(normalization="feature_scale", new_name="foo")
output = f.apply(mesh, title)
output
HeaderData Arrays
ImageDataInformation
N Cells729
N Points1000
X Bounds0.000e+00, 9.000e+00
Y Bounds0.000e+00, 9.000e+00
Z Bounds0.000e+00, 9.000e+00
Dimensions10, 10, 10
Spacing1.000e+00, 1.000e+00, 1.000e+00
N Arrays3
NameFieldTypeN CompMinMax
Spatial Point DataPointsfloat6410.000e+007.290e+02
fooPointsfloat6410.000e+001.000e+00
Spatial Cell DataCellsfloat6410.000e+005.120e+02


output.plot(scalars="foo")
normalize array

Total running time of the script: (0 minutes 0.564 seconds)

Gallery generated by Sphinx-Gallery