Grassmann_interpolation module

class Grassmann_interpolation.GrassmannInterpolator(eta, xy)

Bases: object

Parameters:
  • eta – list of shape locations eta (normalized from 0 to 1)

  • xy – (n_shapes, n_landmarks, 2) array with 2D shape coordinates in physical space (nominal shapes)

static calc_grassmann_distance(xy_grassmann)

Calculate distance between ordered elements on Grassmann.

Parameters:

xy_grassmann – (n_shapes, n_landmarks, 2) array of elemments on Grassmann

Returns:

(n_shapes, ) array of distances on Grassmann (dist[0] always equal 0)

static calc_log_mapping(xy_grassmann)

Calculate log mapping (the tangent direction from Xi to Xi+1) for every given element Xi in ordered list of elements.

Parameters:

xy_grassmann – (n_shapes, n_landmarks, 2) array of elements on Grassmann

Returns:

(n_shapes-1, ) array of directions (log mapping)

eta_scaled(eta)

Renormalized eta, such that duplicated shapes are outside of [0, 1] interval.

Parameters:

eta – given value of eta (single value of array)

Returns:

Renormalized eta (single value of array)

eta_scaled_inv(eta)
interpolator_cdf(eta_scaled)
make_interpolator_cdf()
renormalize_eta(dist)

Renormalized eta, such that duplicated shapes (zero distance) in the beginning and in the end are outside of [0, 1] interval.

Parameters:

dist – (n_shapes, ) array of calculated distances between shapes (dist[0] always equal 0)

Returns:

eta_shift, eta_scale for renormalization

sample_eta(n_samples, n_hub=10, n_tip=None, n_end=25)

Sample eta, such that t is uniformly distributed and filling uniformly distributed eta between duplicated shapes.

Parameters:
  • n_samples – number of samples uniformly distributed over Grassmannian

  • n_hub – number of samples uniform over eta between duplicated shapes on the left

  • n_tip – number of samples uniform over eta between duplicated shapes on the right, not including tip end

  • n_end – number of samples uniform over eta for the tip end (2% of the blade length)

Returns:

array of eta samples

shapes_perturbation(new_shapes, ind)

Substitute nominal shapes with perturbed ones.

Parameters:
  • new_shapes – perturbed grassmann shapes

  • ind – indices of shapes to substitute