piol.vectorfield module

Inheritance diagram

Inheritance diagram of piol.vectorfield

API reference

class piol.vectorfield.RGrid3DVectorField(data)[source]

Bases: piol.vectorfield.VectorField

Vector field with data on a regular 3D grid

Initialize vector field from numpy array.

Expecting columns x,y,z,Fx,Fy,Fz in SI units.

debug_print()[source]

Print information for debugging purposes

field(x)[source]

Return field at coordinates x

Uses linear interpolation at x. If point x is outside the defined domain the behaviour is defined by the extrapolation setting.

plot_field(c, v1, v2, N1, N2)[source]

Plot the field magnitude on a plane with colormap

The plane is defined by point c in 3D space and two vectors v1 and v2. The points used to produce the colormap are c+i*v1+j*v2, where i=[0,N1] and j=[0,N2]

set_extrapolation(extrpl)[source]

Set extrapolation settings for field

The interpolation function behaviour outside the defined mesh can be set for each boundary separately. This is done by setting the desired parameters in the extrpl array, which contains the settings for xmin,xmax,ymin,ymax,zmin and zmax boundaries in the mentioned order. The extrapolation can be set to ERROR, ZERO, NORMAL or TANGENTIAL.

Default is ERROR for all boundaries.

If field evaluation is called for beyond a boundary with extrapolation mode set to ERROR a FieldError exception is raised.

set_scale(factor)[source]

Set field scaling factor.

class piol.vectorfield.VectorField[source]

Bases: object

Vector field model class

Returns zero field at all coordinates.

Initialize vector field

field(x)[source]

Return field at coordinates x,y,z