treble_tsdk.core.source
Classes
OnAxisResponse(transfer_function: 'np.ndarray', frequency: 'np.ndarray') |
|
Available source types. |
|
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, _cloned_from_id: str | 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.
- look_at(target: Point3d | Receiver)
Set the source orientation so it faces a target point.
- Parameters:
target – The point the source should face. Accepts a
Point3dor any object with alocationattribute (e.g. aReceiveror anotherSource). The source’s azimuth and elevation are set so it looks from its current position toward the target, with roll reset to 0. If the source has nosource_propertiesyet, one is created.
- 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_layer (BoundaryVelocityLayer | str) – Boundary velocity layer definition or layer name.
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 | Point3d | Receiver | 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:
orientation (Rotation|Point3d|Receiver) – Orientation of the source. Accepts either an explicit
Rotation(azimuth/elevation/roll) or a look-at target given as aPoint3d(or any object with alocationattribute, e.g. aReceiver). When a look-at target is given, the source is oriented to face that point fromlocationwith roll 0. Defaults to a zeroRotation.label (str) – Source label.
boundary_velocity_submodel (BoundaryVelocitySubmodel) – Boundary velocity submodel.
- Returns:
Source object.
- classmethod make_cardioid(location: Point3d | list[float] | None = None, orientation: Rotation | Point3d | Receiver | None = None, label: str = '', tags: list[str] = [], **kwargs) Source
Shortcut to create a cardioid Source object.
- Parameters:
orientation (Rotation|Point3d|Receiver) – Orientation of the source. Accepts either an explicit
Rotation(azimuth/elevation/roll) or a look-at target given as aPoint3d(or any object with alocationattribute, e.g. aReceiver). When a look-at target is given, the source is oriented to face that point fromlocationwith roll 0. Defaults to a zeroRotation.label (str) – Source label.
- classmethod make_dipole(location: Point3d | list[float] | None = None, orientation: Rotation | Point3d | Receiver | None = None, label: str = '', tags: list[str] = [], **kwargs) Source
Shortcut to create a dipole Source object.
- Parameters:
orientation (Rotation|Point3d|Receiver) – Orientation of the source. Accepts either an explicit
Rotation(azimuth/elevation/roll) or a look-at target given as aPoint3d(or any object with alocationattribute, e.g. aReceiver). When a look-at target is given, the source is oriented to face that point fromlocationwith roll 0. Defaults to a zeroRotation.label (str) – Source label.
- classmethod make_directive(location: Point3d | list[float] | None = None, orientation: Rotation | Point3d | Receiver | 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:
orientation (Rotation|Point3d|Receiver) – Orientation of the source. Accepts either an explicit
Rotation(azimuth/elevation/roll) or a look-at target given as aPoint3d(or any object with alocationattribute, e.g. aReceiver). When a look-at target is given, the source is oriented to face that point fromlocationwith roll 0. Defaults to a zeroRotation.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.
- 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.
- classmethod make_source_receiver_device(location: Point3d | list[float] = None, orientation: Rotation | Point3d | Receiver = None, label: str = '', device: SourceReceiverDevice = None, tags: list[str] = [], render_device_microphones: bool = True)
Shortcut to create a source/receiver device Source object.
- Parameters:
orientation (Rotation|Point3d|Receiver) – Orientation of the device. Accepts either an explicit
Rotation(azimuth/elevation/roll) or a look-at target given as aPoint3d(or any object with alocationattribute, e.g. aReceiver). When a look-at target is given, the device is oriented to face that point fromlocationwith roll 0. Defaults to a zeroRotation.label (str) – Source label.
device (SourceReceiverDevice) – The device definition.
- Returns:
Source object representing the device.
- property id: str
- property label: str
- 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 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
-
- property estimated_cost_in_tokens: float
- 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 azimuth_angle: float
- property elevation_angle: float
- property on_axis_response: OnAxisResponse | None
- property roll_angle: float
- class treble_tsdk.core.source.TaskInfo
-
- 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_type: TaskType