treble_tsdk.core.source

Classes

OnAxisResponse

OnAxisResponse(transfer_function: 'np.ndarray', frequency: 'np.ndarray')

Source

SourceEstimate

SourceProperties

SourceType

Available source types.

TaskInfo

TaskType

Available task types

class treble_tsdk.core.source.OnAxisResponse

OnAxisResponse(transfer_function: ‘np.ndarray’, frequency: ‘np.ndarray’)

__init__(transfer_function: numpy.ndarray, frequency: numpy.ndarray) None
classmethod from_base64(encoded: str) OnAxisResponse

Deserialize an OnAxisResponse from a base64 encoded string.

to_base64() str

Serialize the OnAxisResponse to a base64 encoded string. Uses numpy’s save format to preserve dtype and shape information.

frequency: numpy.ndarray
transfer_function: numpy.ndarray
class treble_tsdk.core.source.Source
__init__(x: float, y: float, z: float, source_type: SourceType, label: str, source_properties: SourceProperties | None = None, id: str | None = None, tasks: list[TaskInfoDto] | None = None, order_number: int | None = None, tags: list[str] = [], sub_sources: list[dict | SourceDto] | None = None, child_receivers: list[dict | ReceiverDto] | None = None, metadata: dict[str, str] | ObjectMetadata | None = None)

Represents a Simulation source.

Parameters:
  • x (float) – X position of source in meters.

  • y (float) – Y position of source in meters.

  • z (float) – Z position of source in meters.

  • source_type (SourceType) – Type of source.

  • label (str) – Source label.

  • source_properties (SourceProperties) – Optional, additional source properties.

classmethod make_boundary_velocity_layer(label: str, boundary_velocity_layer: BoundaryVelocityLayer | str, disable_source_correction: bool = False, source_position: Point3d | None = None, calculate_source_position: bool = True) Source

Shortcut to create a boundary velocity Source object with boundary layer specified.

Parameters:
  • label (str) – Source label.

  • boundary_velocity_definition (BoundaryVelocityLayer) – Boundary velocity definition.

  • source_position (Point3d) – Sets the Source position, note that setting this on a BoundaryVelocityLayer source is optional and will not be used when simulating.

  • calculate_source_position (bool) – If True, the source position will be calculated based on the center of the boundary layer. Note: setting the source_position parameter will override this behaviour.

Returns:

Source object.

classmethod make_boundary_velocity_submodel(location: Point3d | list[float] | None = None, orientation: Rotation | None = None, label: str = '', boundary_velocity_submodel: BoundaryVelocitySubmodel | None = None, disable_source_correction: bool = False, tags: list[str] = [], **kwargs) Source

Shortcut to create a boundary velocity Source object with SourceSubmodel.

Parameters:
  • location (Point3d|list[float]) – Location of the source.

  • orientation (Rotation) – Orientation of the source.

  • label (str) – Source label.

  • boundary_velocity_definition (BoundaryVelocitySubmodel) – Boundary velocity submodel.

Returns:

Source object.

classmethod make_cardioid(location: Point3d | list[float] | None = None, orientation: Rotation | None = None, label: str = '', tags: list[str] = [], **kwargs) Source

Shortcut to create a cardioid Source object.

Parameters:
  • location (Point3d|list[float]) – Location of the source.

  • orientation (Rotation) – Orientation of the source.

  • label (str) – Source label.

classmethod make_dipole(location: Point3d | list[float] | None = None, orientation: Rotation | None = None, label: str = '', tags: list[str] = [], **kwargs) Source

Shortcut to create a dipole Source object.

Parameters:
  • location (Point3d|list[float]) – Location of the source.

  • orientation (Rotation) – Orientation of the source.

  • label (str) – Source label.

classmethod make_directive(location: Point3d | list[float] | None = None, orientation: Rotation | None = None, label: str = '', source_directivity: SourceDirectivityObj | str | None = None, use_wave_based_pattern: bool = False, tags: list[str] = [], on_axis_response: OnAxisResponse | None = None, **kwargs) Source

Shortcut to create a directive Source object.

Parameters:
  • location (Point3d|list[float]) – Location of the source.

  • orientation (Rotation) – Orientation of the source.

  • label (str) – Source label.

  • source_directivity (SourceDirectivityObj|str) – Source directivity.

  • use_wave_based_pattern (bool) – If flag is set to True, the GA solver will use an approximate directivity fitted to be used in the wave based solver.

classmethod make_moving_directive(trajectory: Trajectory, orientation: TrajectoryOrientation | None = None, label: str = '', source_directivity: SourceDirectivityObj | str | None = None, use_wave_based_pattern: bool = False, tags: list[str] = [], on_axis_response: OnAxisResponse | None = None, **kwargs) Source
classmethod make_moving_omni(trajectory: Trajectory, label: str = '', tags: list[str] = [], **kwargs) Source

Shortcut to create a moving omni Source object.

Parameters:
  • trajectory (Trajectory) – The trajectory for the moving source.

  • label (str) – Source label.

  • tags (list[str]) – Source tags.

Returns:

Moving Source object.

classmethod make_omni(location: Point3d | list[float] | None = None, label: str = '', tags: list[str] = [], **kwargs) Source

Shortcut to create an omni Source object.

Parameters:
  • location (Point3d|list[float]) – Location of the source.

  • label (str) – Source label.

Returns:

Source object.

pos_as_point() Point3d
property id: str
property label: str
property location: Point3d
property metadata: ObjectMetadata | dict[str, str] | None
property order_number: int
property orientation: Rotation | None

Returns the rotation of the source if it has been set..

property source_properties: SourceProperties
property source_type: SourceType
property sub_sources: list[Source] | None
property tags: list[str]
property tasks: list[TaskInfo] | None

Read only property containing task list associated with this source.

property x: float
property y: float
property z: float
class treble_tsdk.core.source.SourceEstimate
__init__(dto: SourceEstimateDto)
property estimated_cost_in_tokens: float
property estimated_gpus_allocated: int | None
property estimated_runtime_hours: float
property source_id: str
property source_label: str
class treble_tsdk.core.source.SourceProperties
__init__(azimuth_angle: float = 0.0, elevation_angle: float = 0.0, roll_angle: float = 0.0, source_directivity: str | SourceDirectivityObj = None, boundary_velocity_definition: BoundaryVelocitySubmodel | BoundaryVelocityLayer | str = None, source_boundary_layer_name: str = None, source_boundary_mesh_local_sizing: float = None, source_boundary_mesh_keep_exterior_edges: bool = False, disable_source_correction: bool = None, use_wave_based_pattern: bool = None, array_sub_sources: list['Source'] = None, array_source_directivity_upload_id: str = None, on_axis_response: OnAxisResponse = None, device: _SourceReceiverDevice = None)

Additional source properties.

Parameters:
  • azimuth_angle (float) – Azimuth rotation angle for directional sources. From 0° to 360°.

  • elevation_angle (float) – Elevation rotation angle for directional sources. From 0° to 90°.

  • source_directivity (str|SourceDirectivityObj) – If the source type is Directive this parameter specifies the source directivity.

  • boundary_velocity_definition (BoundaryVelocitySubmodel|BoundaryVelocityLayer|str) – If the source type is a boundary velocity source this parameter specified properties of that.

  • source_boundary_layer_name – Deprecated. Use source_boundary_velocity instead.

  • source_boundary_mesh_local_sizing – Deprecated. Use source_boundary_velocity instead.

  • source_boundary_mesh_keep_exterior_edges – Deprecated. Use source_boundary_velocity instead.

  • disable_source_correction (bool) – Optional: Disable source correction in solvers.

  • use_wave_based_pattern (bool) – Optional: If flag is set and source is of type Directive. The GA solver will use an approximate directivity fitted to be used in the wave based solver.

  • array_sub_sources (list["Source"]) – Optional: List of sub sources for array sources.

  • array_source_directivity_upload_id (str) – Optional: Upload ID of the array source directivity.

  • on_axis_response (OnAxisResponse) – Optional: On axis response for array sources. Must be optionally defined only for sub sources of the array source.

property array_sub_sources: list[Source] | None
property azimuth_angle: float
property boundary_velocity_submodel_id: str | None
property disable_source_correction: bool | None
property elevation_angle: float
property on_axis_response: OnAxisResponse | None
property roll_angle: float
property source_boundary_layer_name: str | None
property source_boundary_mesh_keep_exterior_edges: bool | None
property source_boundary_mesh_local_sizing: float | None
property source_directivity_id: str | None
property use_wave_based_pattern: bool | None
class treble_tsdk.core.source.SourceType

Available source types.

classmethod list()
classmethod print()
array = 'Array'
boundary_velocity = 'BoundaryVelocity'
cardioid = 'Cardioid'
dipole = 'Dipole'
directive = 'Directive'
moving = 'Moving'
omni = 'Omni'
class treble_tsdk.core.source.TaskInfo
__init__(dto: TaskInfoDto)
property completed_at: str
property created_at: str
property id: str
property name: str
property progress_percentage: float
property started_at: str
property status: str
property status_message: str
property task_sub_type: str | None
property task_type: TaskType
property tokens_cost: decimal
class treble_tsdk.core.source.TaskType

Available task types

device_rendering = 'DeviceRendering'
dg = 'DG'
ga = 'GA'
geometrical = 'GA'
geometry_checking = 'GeometryChecking'
hybrid = 'Hybrid'
join_directive_speech = 'JoinDirectiveSpeech'
join_directivity = 'JoinDirectivity'
mesher = 'Mesher'
post_processing = 'PostProcessing'
wave_based = 'DG'