pykonal.fields.ScalarField3D

class pykonal.fields.ScalarField3D

Bases: pykonal.fields.Field3D

Class for representing 3D scalar fields.

resample(self, points, null=numpy.nan)

Resample the field at an arbitrary set of points using trilinear interpolation.

Parameters
  • points (numpy.ndarray(shape=(N,3), dtype=numpy.float)) – Points at which to resample the field.

  • null (float) – Default (null) value to return for points lying outside the interpolation domain.

Returns

Resampled field values.

Return type

numpy.ndarray(shape=(N,), dtype=numpy.float)

trace_ray(self, end)

Trace the ray ending at end (given in the same coordinate system as self.coord_sys.)

This method traces the ray that ends at end in reverse direction by taking small steps along the path of steepest descent. The resulting ray is reversed before being returned, so it is in the normal forward-time orientation.

Parameters

end (numpy.ndarray(shape=(3,), dtype=numpy.float)) – Coordinates of the ray’s end point.

Returns

The ray path ending at end.

Return type

numpy.ndarray(shape=(N,3), dtype=numpy.float)

value(self, point, null=numpy.nan)

Interpolate the field at point using trilinear interpolation.

Parameters
  • point (numpy.ndarray(shape=(3,), dtype=numpy.float)) – Coordinates of the point at which to interpolate the field.

  • null (float) – Default (null) value to return if point lies outside the interpolation domain.

Returns

Value of the field at point.

Return type

float

gradient

[Read only, numpy.ndarray(shape=(N0,N1,N2,3), dtype=numpy.float)] Gradient of the field.

values

[Read/Write, numpy.ndarray(shape=(N0,N1,N2), dtype=numpy.float)] Value of the field at each grid node.