fluidimage.postproc.vector_field#

Post-processing of vector fields (fluidimage.postproc.vector_field)#

class fluidimage.postproc.vector_field.VectorFieldOnGrid(x, y, z, vx, vy, vz=nan, namevx='vx', namevy='vy', namevz='vz', unitvx='?', unitvy='?', unitvz='?', namex='x', namey='y', namez='z', unitx='?', unity='?', unitz='?', name='Fluidimage_field', history=['fluidimage'], params: ParamContainer | None = None)[source]#

Bases: object

PIV field on a regular grid.

Parameters:
xnp.array (1d)
ynp.array (1d)
znumber or np.array (1d)
vxnp.array (2d)
vynp.array (2d)
vznp.array (2d), optional
namevxstr, ‘vx’
namevystr, ‘vy’
namevzstr, ‘vz’
unitvxstr, ‘?’
unitvystr, ‘?’
unitvzstr, ‘?’
namexstr, ‘x’
nameystr, ‘y’
namezstr, ‘z’
unitxstr, ‘?’
unitystr, ‘?’
unitzstr, ‘?’
property shape#

Shape of the field ((nz, ny, nx) or (ny, nx))

save(path, params=None)[source]#

Save the object in a hdf5 file

classmethod from_file(path, load_params=False)[source]#

Create a PIV2d object from a file

It can be a file representing a LightPIVResults or a PIV2d object.

display(scale=1, background=None, ax=None, step=None, skip=None)[source]#

Display the vector field

Parameters:
scalenumber, default=1
backgroundunused
axMatplotlib axes
stepint, optional
skiptuple of 2 slices, optional
median_filter(size, niter=1, valid=True)[source]#

Return a new field filtered with a median filter

gaussian_filter(sigma, niter=1, truncate=3, valid=True)[source]#

Return a new field filtered with a gaussian filter

extract(start0, stop0, start1, stop1, phys=False)[source]#

Return a new field extrated from self

truncate(cut=1, phys=False)[source]#

Return a new truncated field

extract_square(cut=0, force_even=True)[source]#

Return a square field

compute_norm()[source]#

Compute the norm of the vector field

compute_spatial_fft(axes=(0, 1))[source]#

Compute the spatial Fourier transform

compute_rotz(edge_order=2)[source]#

Compute the vertical curl

compute_divh(edge_order=2)[source]#

Compute the horizontal divergence

regularize_grid()[source]#

Try to regularize the grid (inplace)

class fluidimage.postproc.vector_field.ArrayOfVectorFieldsOnGrid(fields=None)[source]#

Bases: object

set_timestep(timestep, unit_time='sec')[source]#

Set the timestep (and a time vector)

compute_time_average()[source]#

Compute the time average

append(v)[source]#

Append an element

extend(l)[source]#

Extend from an iterable

median_filter(size, niter=1, valid=True)[source]#

Return a new array filtered with a median filter

gaussian_filter(sigma, niter=1, truncate=3, valid=True)[source]#

Return a new array filtered with a gaussian filter

extract(start0, stop0, start1, stop1, phys=False)[source]#

Extract new fields from the fields

truncate(cut=1, phys=False)[source]#

Truncate the fields

extract_square(cut=0)[source]#

Extract square fields

compute_temporal_fft()[source]#

Compute the temporal Fourier transform

apply_function_to_spatiotemp_data(func)[source]#

Apply the function func on 3D data vx(t, y, x) and vy(t, y, x).

regularize_grid()[source]#

Try to regularize the grid (inplace)

Classes

ArrayOfVectorFieldsOnGrid([fields])

VectorFieldOnGrid(x, y, z, vx, vy[, vz, ...])

PIV field on a regular grid.