luminarycloud.vis

Classes

CameraDirection

Directional camera options

CameraProjection

The type of projection used in the camera.

Clip

Clip the dataset using a plane.

ColorMap

The color map allows user control over how field values are mapped to

ColorMapPreset

Predefined color map presets.

ColorMapPreset

Predefined color map presets.

DataRange

The data range represents a range of values. Ranges are only valid if the

DirectionalCamera

Class defining a directional camera for visualization. Directional

DisplayAttributes

Display attributes specify how objects such as meshes, geometries, and

EntityType

An enum for specifying the source of an image. When listing extracts,

EntityType

An enum for specifying the source of an image. When listing extracts,

Field

The field controls the field displayed on the object. If the field doesn't

FieldComponent

Specifies which component of a field is used for visualization.

FieldComponent

Specifies which component of a field is used for visualization.

ImageExtract

The image extract represents the request to extract an image from some data.

ImageStatusType

Represents the status of an image request.

Plane

This class defines a plane.

Representation

The representation defines how objects will appear in the scene.

Representation

The representation defines how objects will appear in the scene.

Scene

The scene class is the base for any visualization. The scene is constructed

Slice

The slice filter is used to extract a cross-section of a 3D dataset by

Vector3

Represents a 3-dimensional vector.

VisQuantity

The visualization quantity. This is a subset of all quantities.

Functions

list_images(→ List[ImageExtract])

Lists all previously created image associated with a project and an entity.

Package Contents

class luminarycloud.vis.CameraDirection

Bases: enum.IntEnum

Directional camera options

Attributes:
X_POSITIVE

Look down the positive x-axis

Y_POSITIVE

Look down the positive y-axis

Z_POSITIVE

Look down the positive z-axis

X_NEGATIVE

Look down the negative x-axis

Y_NEGATIVE

Look down the negative y-axis

Z_NEGATIVE

Look down the negative z-axis

X_NEGATIVE
X_POSITIVE
Y_NEGATIVE
Y_POSITIVE
Z_NEGATIVE
Z_POSITIVE
class luminarycloud.vis.CameraProjection

Bases: enum.IntEnum

The type of projection used in the camera.

Attributes:
ORTHOGRAPHIC

A orthographic (i.e., parallel) projection.

PERSPECTIVE

A perspective projection.

ORTHOGRAPHIC
PERSPECTIVE
class luminarycloud.vis.Clip(name: str)

Bases: Filter

Clip the dataset using a plane. .. warning:: This feature is experimental and may change or be removed in the future.

display_attrs
id = 'clip-'
name
property plane: Plane
class luminarycloud.vis.ColorMap

The color map allows user control over how field values are mapped to colors. Color maps are assigned to fields (e.g., the quantity and component) and not individual display attributes. This means that there can only ever be one color map per field/component combination (e.g., velocity-magnitude or velocity-x). Any display attribute in the scene (i.e., filter display attributes or global display attributes) that maps to this color map will be color in the same manner. .. warning:: This feature is experimental and may change or be removed in the future.

Attributes:
fieldField

The field and component this color map applies to.

presetColorMapPreset

The color map preset to use. This defines the colors used in the color map. Default is ‘JET’.

data_rangeDataRange

An optional data range to use for the color map. The user must explicity set the data ranges. If not set explicitly, the fields global data range is used. For comparing multiple results, either with different solutions in the same simulation or with different simulations, its highly recommended that a range is provided so the color scales are the same between the resulting images. Default: is an invalid data range.

discretizebool

Use discrete color bins instead of a continuous range. When True, ‘n_colors’ indicates how many discrete bins to use. Default: False.

n_colorsint

How many discrete bins to use when discretize is True. Valid n_colors values are [1, 256]. Default: 8.

data_range: DataRange
discretize: bool = False
field: Field
n_colors: int = 8
preset: ColorMapPreset
class luminarycloud.vis.ColorMapPreset

Bases: enum.IntEnum

Predefined color map presets.

COOL_TO_WARM
JET
TURBO
VIRIDIS
WAVE
XRAY
class luminarycloud.vis.ColorMapPreset

Bases: enum.IntEnum

Predefined color map presets.

COOL_TO_WARM
JET
TURBO
VIRIDIS
WAVE
XRAY
class luminarycloud.vis.DataRange

The data range represents a range of values. Ranges are only valid if the max value is greater than the or equal to the min_value. The default is invalid. .. warning:: This feature is experimental and may change or be removed in the future.

is_valid() bool
max_value: float
min_value: float
class luminarycloud.vis.DirectionalCamera

Class defining a directional camera for visualization. Directional camera are oriented around the visible objects in the scene and will always face towards the scene. .. warning:: This feature is experimental and may change or be removed in the future.

direction: CameraDirection
name: str = 'default directional camera'
projection: CameraProjection
class luminarycloud.vis.DisplayAttributes

Display attributes specify how objects such as meshes, geometries, and filters appear in the scene. .. warning:: This feature is experimental and may change or be removed in the future.

Attributes:

visiblebool

If the object is visible or not. Default: True

opacityfloat

How opaque the object is. This is a normalized number between 0 (i.e., fully transparent) and 1 (i.e., fully opaque). Default: 1

fieldField

What field quantity/component to color by, if applicable.

representationRepresentation

how the object is represented in the scene (e.g., surface, surface with edges, wireframe or points). Default: surface.

field: Field
opacity: float = 1.0
representation: Representation
visible: bool = True
class luminarycloud.vis.EntityType

Bases: enum.IntEnum

An enum for specifying the source of an image. When listing extracts, the user must specify what type of extract they are interested in. This enum is only used by the visualization code.

Attributes:
SIMULATION

Specifies a similuation entity (i.e., a result).

MESH

Specifies a mesh entity.

GEOMETRY

Specifies a geometry entity.

GEOMETRY = 2
MESH = 1
SIMULATION = 0
class luminarycloud.vis.EntityType

Bases: enum.IntEnum

An enum for specifying the source of an image. When listing extracts, the user must specify what type of extract they are interested in. This enum is only used by the visualization code.

Attributes:
SIMULATION

Specifies a similuation entity (i.e., a result).

MESH

Specifies a mesh entity.

GEOMETRY

Specifies a geometry entity.

GEOMETRY = 2
MESH = 1
SIMULATION = 0
class luminarycloud.vis.Field

The field controls the field displayed on the object. If the field doesn’t exist, we show a solid color. .. warning:: This feature is experimental and may change or be removed in the future.

component: FieldComponent
quantity: VisQuantity
class luminarycloud.vis.FieldComponent

Bases: enum.IntEnum

Specifies which component of a field is used for visualization. When using scalars, the X component is the only valid component.

MAGNITUDE
X
Y
Z
class luminarycloud.vis.FieldComponent

Bases: enum.IntEnum

Specifies which component of a field is used for visualization. When using scalars, the X component is the only valid component.

MAGNITUDE
X
Y
Z
class luminarycloud.vis.ImageExtract(extract_id: str, project_id: str, name: str, desciption: str, status: ImageStatusType)

The image extract represents the request to extract an image from some data. The operation exectutes asyncronously, so the caller must check the status of the image extract. If the status is completed, then the resuling image is available for download.

delete() None

Delete the image.

download_image(file_name: str) None

Download the resulting image. If that status is not complete, an error will be raised.

Parameters:
file_name: str, required

The file name to save the image to. ‘.jpg’ will be appended to the file name.

refresh() ImageExtract

Refesh the status of the ImageExtract.

Returns:
self
wait(interval_seconds: float = 5, timeout_seconds: float = float('inf')) ImageStatusType

Wait until the ImageExtract is completed or failed.

Parameters:
intervalfloat, optional

Number of seconds between polls.

timeoutfloat, optional

Number of seconds before timeout.

Returns:
ImageStatusType: Current status of the image extract.
description: str
name: str
status: ImageStatusType
class luminarycloud.vis.ImageStatusType

Bases: enum.IntEnum

Represents the status of an image request.

Attributes:
ACTIVE

The request is currently active and being processed.

COMPLETED

The request is complete.

FAILED

The request has failed.

INVALID

The request is invalid.

.. warning:: This feature is experimental and may change or be removed in the future.
ACTIVE
COMPLTETED
FAILED
INVALID
class luminarycloud.vis.Plane

This class defines a plane. .. warning:: This feature is experimental and may change or be removed in the future.

property normal: luminarycloud.types.Vector3
property origin: luminarycloud.types.Vector3
class luminarycloud.vis.Representation

Bases: enum.IntEnum

The representation defines how objects will appear in the scene.

POINTS
SURFACE
SURFACE_WITH_EDGES
WIREFRAME
class luminarycloud.vis.Representation

Bases: enum.IntEnum

The representation defines how objects will appear in the scene.

POINTS
SURFACE
SURFACE_WITH_EDGES
WIREFRAME
class luminarycloud.vis.Scene(project_id: str, entity: luminarycloud.geometry.Geometry | luminarycloud.solution.Solution | luminarycloud.mesh.Mesh)

The scene class is the base for any visualization. The scene is constructed with what “entity” you want to visualize: a solution, a mesh, or a geometry.

global display attributes: The global display attributes control the default appearance of all the surfaces (i.e. boundaries). Attributes include visibitiy, what fields are displayed on the surfaces (if applicable), and representation (e.g., surface, surface with edges, …).

Individaul surface visibities can be overidden to hide/show specific surfaces. Additionally, if the scene is contructed around a simulation, a helper method is provided to automatically hide surfaces associated with far fields.

Warning

This feature is experimental and may change or be removed in the future.

add_color_map(color_map: luminarycloud.vis.display.ColorMap) None

Add a color map to the scene. If a color map with the field already exists, it will be overwritten.

add_filter(filter: luminarycloud.vis.filters.Filter) None

Add a filter to the scene. Filters not currently supported with geometries and will raise an error if added.

create_image(width: int, height: int, name: str, description: str) ImageExtract

Create an image of the scene using the camera. Parameters ———- width : int

The width of the image.

heightint

The height of the image.

namestr

A short name for the image.

descriptionstr

A longer description of the scene and image.

hide_far_field() None

Hide all far fields surfaces. Will work if the entity is a simulation.

set_camera(camera: DirectionalCamera) None

Set the scene’s camera.

surface_ids() List[str]

Get a list of all the surface ids associated with the mesh.

surface_visibility(id: str, visible: bool) None

Explicitly override the the visibility of a surface by id.

global_display_attrs
class luminarycloud.vis.Slice(name: str)

Bases: Filter

The slice filter is used to extract a cross-section of a 3D dataset by slicing it with a plane. .. warning:: This feature is experimental and may change or be removed in the future.

display_attrs
id = 'slice-'
name
property plane: Plane
property project_vectors: bool
class luminarycloud.vis.Vector3

Represents a 3-dimensional vector.

x: float = 0.0
y: float = 0.0
z: float = 0.0
class luminarycloud.vis.VisQuantity

Bases: enum.IntEnum

The visualization quantity. This is a subset of all quantities. .. warning:: This feature is experimental and may change or be removed in the future.

ABSOLUTE_PRESSURE
DENSITY
FRICTION_COEFFICIENT
HEAT_FLUX
MACH
NONE
PRESSURE
PRESSURE_COEFFICIENT
Q_CRITERION
TEMPERATURE
TOTAL_PRESSURE
TOTAL_PRESSURE_COEFFICIENT
TOTAL_TEMPREATURE
VELOCITY
WALL_SHEAR_STRESS
luminarycloud.vis.list_images(project_id: str, entity: luminarycloud.geometry.Geometry | luminarycloud.mesh.Mesh | luminarycloud.solution.Solution) List[ImageExtract]

Lists all previously created image associated with a project and an entity. Parameters .. warning:: This feature is experimental and may change or be removed in the future. ———- project_id : str

The project id to query.

entityGeometry | Mesh | Solution

Specifies what types of image extracts to list(e.g., geometry, mesh or solution).