fiesta.disperse.Filament.get_points#

Filament.get_points(s, unit=None)[source]#

Function to sample any point on the filament spine.

A filament function is one that parameterizes the 1D filament curve in 3D space, defined as \(\mathbf{f}(s) = (x,y,z)\) where \(s \in [0,1]\) is the normalized distance of a point along the filament spine and \((x,y,z)\) is the position vector of that point in space.

Since DisPerSE only outputs a discrete set of sampling points, fitting \(\mathbf{f}(s)\) allows one to sample the filament continuously or as finely as required. In this implementation, the function is a cubic B-spline fit using scipy.interpolate.splprep, with zero-smoothing to ensure it passes through input points.

Variables:
  • s (list or ndarray of float’s) – Array of normalized distances along the filament \(s \in [0,1]\).

  • unit (Unit) – Unit to output the points in. If None (default), takes the value u.pix if scale='pixel', else u.cm if scale='physical'.

Returns:

points (Quantity) – Array of 3d position vectors corresponding to the points at the given normalized distances \(s\) along the filament.