core.orientedpoints module

class IMTreatment.core.orientedpoints.OrientedPoints(xy=array([], shape=(0, 2), dtype=float64), orientations=[], v=[], unit_x='', unit_y='', unit_v='', name='')[source]

Bases: IMTreatment.core.points.Points

Class representing a set of points with associated orientations. You can use ‘make_unit’ to provide unities.

Parameters:
  • xy (nx2 arrays.) – Representing the coordinates of each point of the set (n points).
  • orientations (nxdx2 array) – Representing the orientations of each point in the set (d orientations for each n points). Can be ‘None’ if a point have no orientation.
  • v (n array, optional) – Representing values attached at each points.
  • unit_x (Unit object, optional) – X unit_y.
  • unit_y (Unit object, optional) – Y unit_y.
  • unit_v (Unit object, optional) – values unit_y.
  • name (string, optional) – Name of the points set
add(pt, orientations, v=None)[source]

Add a new point.

Parameters:
  • pt (2x1 array of numbers) – Point to add.
  • orientations (dx2 array) – orientations associated to the points (d orientations)
  • v (number, optional) – Value of the point (needed if other points have values).
crop(intervx=None, intervy=None, intervv=None, inplace=True)[source]

Crop the points cloud.

Parameters:
  • intervx (2x1 tuple) – Interval on x axis
  • intervy (2x1 tuple) – Interval on y axis
  • intervv (2x1 tuple) – Interval on v values
Returns:

tmp_pts – croped version of the point cloud.

Return type:

Points object

decompose()[source]

Return a tuple of OrientedPoints object, with only one point per object.

get_streamlines(vf, delta=0.25, interp='linear', reverse_direction=False)[source]

Return the streamlines coming from the points, based on the given field.

Parameters:
  • vf (VectorField or velocityField object) – Field on which compute the streamlines
  • delta (number, optional) – Spatial discretization of the stream lines, relative to a the spatial discretization of the field.
  • interp (string, optional) – Used interpolation for streamline computation. Can be ‘linear’(default) or ‘cubic’
  • reverse_direction (boolean, optional) – If True, the streamline goes upstream.
Returns:

streams – Each Points object represent a streamline

Return type:

tuple of Points objects

get_streamlines_from_orientations(vf, delta=0.25, interp='linear', reverse_direction=False)[source]

Return the streamlines coming from the points orientations, based on the given field.

Parameters:
  • vf (VectorField or velocityField object) – Field on which compute the streamlines
  • delta (number, optional) – Spatial discretization of the stream lines, relative to a the spatial discretization of the field.
  • interp (string, optional) – Used interpolation for streamline computation. Can be ‘linear’(default) or ‘cubic’
  • reverse_direction (boolean or tuple of boolean, optional) – If ‘False’ (default), the streamline goes downstream. If ‘True’, the streamline goes upstream. a tuple of booleans can be specified to apply different behaviors to the different orientations
Returns:

streams – Each Points object represent a streamline

Return type:

tuple of Points objects

import_from_Points(pts, orientations)[source]

Import data from a Points object

orientations
remove(ind)[source]

Remove the point number ‘ind’ of the points cloud. In place.

Parameters:ind (integer or array of integer) –