differt.geometry.LaunchedPaths#

class LaunchedPaths(vertices, objects, masks, interaction_types, confidence_threshold=0.5)[source]#

Bases: Module

Paths method generated with ray launching methods.

Holds information of lower-order paths too, and holds multi-order mask information. Not a subclass of TracedPaths.

Attributes

confidence_threshold

A threshold used to decide whether a given path is valid or not.

mask

Alias property to the highest-order mask for backwards compatibility.

masked_objects

The array of masked objects of the highest-order paths, with batched dimensions flattened into one.

masked_vertices

The array of masked vertices of the highest-order paths, with batched dimensions flattened into one.

order

The length (i.e., number of vertices) of each individual path, excluding start and end vertices.

path_length

The length (i.e., number of vertices) of each individual path.

shape

The batch shape of the paths.

vertices

The array of path vertices.

objects

The array of object indices.

masks

An array of masks.

interaction_types

An array to indicate the type of each interaction.

Methods

get_paths(order)

Return the TracedPaths class instance corresponding to the given path order.

masked()

Return a flattened TracedPaths instance keeping only valid highest-order paths.

plot(**kwargs)

Plot the paths on a 3D scene.

reshape(*batch)

Return a new paths instance with reshaped paths' batch dimensions to match a given shape.

squeeze([axis])

Return a new paths instance by squeezing one or more axes of paths' batch dimensions.

Detailed documentation

confidence_threshold: Float[ArrayLike, ''] = 0.5#

A threshold used to decide whether a given path is valid or not.

get_paths(order)[source]#

Return the TracedPaths class instance corresponding to the given path order.

Parameters:

order (int) – The order of the path to index.

Return type:

TracedPaths

Returns:

The corresponding trace paths class.

Raises:

ValueError – If the provided order is out-of-bounds.

interaction_types: Int[Array, '*batch path_length-2']#

An array to indicate the type of each interaction.

Values match InteractionType. A value of -1 indicates an inactive or padded interaction.

property mask: Bool[Array, '*batch'][source]#

Alias property to the highest-order mask for backwards compatibility.

masked()[source]#

Return a flattened TracedPaths instance keeping only valid highest-order paths.

Return type:

TracedPaths

Returns:

A flattened trace paths instance with only valid paths.

property masked_objects: Int[Array, 'num_valid_paths path_length'][source]#

The array of masked objects of the highest-order paths, with batched dimensions flattened into one.

property masked_vertices: Float[Array, 'num_valid_paths path_length 3'][source]#

The array of masked vertices of the highest-order paths, with batched dimensions flattened into one.

masks: Bool[Array, '*batch path_length-1']#

An array of masks.

Holds one mask for each path order.

objects: Int[Array, '*batch path_length']#

The array of object indices.

To every path vertex corresponds one object (e.g., a triangle). A placeholder value of -1 can be used in specific cases, like for transmitter and receiver positions.

property order: int[source]#

The length (i.e., number of vertices) of each individual path, excluding start and end vertices.

property path_length: int[source]#

The length (i.e., number of vertices) of each individual path.

plot(**kwargs)[source]#

Plot the paths on a 3D scene.

Parameters:

kwargs (Any) – Keyword arguments passed to plotting backend.

Return type:

Any

Returns:

The resulting plot output.

reshape(*batch)[source]#

Return a new paths instance with reshaped paths’ batch dimensions to match a given shape.

Parameters:

batch (int) – New batch shape.

Return type:

Self

Returns:

A new paths instance with specified batch dimensions.

property shape: tuple[int, ...][source]#

The batch shape of the paths.

squeeze(axis=None)[source]#

Return a new paths instance by squeezing one or more axes of paths’ batch dimensions.

Parameters:

axis (int | Sequence[int] | None) – See jax.numpy.squeeze for allowed values.

Return type:

Self

Returns:

A new paths instance with squeezed batch dimensions.

Raises:

ValueError – If one of the provided axes is out-of-bounds, or if trying to squeeze a 0-dimensional batch.

vertices: Float[Array, '*batch path_length 3']#

The array of path vertices.