ansys_optical_automation.speos_process package#
Submodules#
ansys_optical_automation.speos_process.speos_sensors module#
- class ansys_optical_automation.speos_process.speos_sensors.Camera(name, SpeosSim, SpaceClaim)[source]#
Bases:
ansys_optical_automation.speos_process.speos_sensors.Sensor
Provides methods for defining the Speos camera sensor.
Methods
convert_object_version
(obj)Function to convert Speos returns from latest to used API version Parameters ---------- obj : SpeosSelectedObject
find_axes
([origin])Find a component with the same name as the sensor, look in it for an axis system and an origin point (if available), and save them as properties in self.
set_distortion
(distortion_file_name)- Parameters
set_position
([x_reverse, y_reverse, origin, ...])Set the origin and x and y directions of the sensor.
set_sensitivity
(color, sensitivity_file_name)- Parameters
set_transmittance
(transmittance_file_name)- Parameters
- set_distortion(distortion_file_name)[source]#
- Parameters
- distortion_file_namestr
Name of the OPT distortion file.
- class ansys_optical_automation.speos_process.speos_sensors.IntensitySensor(name, SpeosSim, SpaceClaim)[source]#
Bases:
ansys_optical_automation.speos_process.speos_sensors.Sensor
Provides methods for the Speos intensity sensor.
Methods
convert_object_version
(obj)Function to convert Speos returns from latest to used API version Parameters ---------- obj : SpeosSelectedObject
find_axes
([origin])Find a component with the same name as the sensor, look in it for an axis system and an origin point (if available), and save them as properties in self.
set_format
([sensor_format])Set the sensor format.
set_integration_angle
(integration_value)set integration angle of the radiance sensor
set_layer
(layer_type)Set the layer type of the sensor.
set_position
([x_reverse, y_reverse, origin, ...])Set the origin and x and y directions of the sensor.
set_range
([x_start, x_end, y_start, y_end, ...])Set the sensor size.
set_resolution
([x_resolution, y_resolution])Set the resolution of the sensor.
set_sampling
([x_sampling, y_sampling])Set the number of samples on the axes.
set_type
(sensor_type)Set the sensor type.
set_wavelength
([w_start, w_end, w_sampling, ...])Set the wavelength of the sensor.
- set_format(sensor_format=None)[source]#
Set the sensor format.
- Parameters
- sensor_formatstr
Format of the sensor. Options are
"XMP"
,"IESNATypeA"
,"IESNATypeB"
,"IESNATypeC"
, and"Eulumdat"
.
- set_integration_angle(integration_value)[source]#
set integration angle of the radiance sensor
- Parameters
- integration_value
- set_layer(layer_type)[source]#
Set the layer type of the sensor.
- Parameters
- layer_typestr
Layer type of the sensor. Options are
"source"
,"face"
,"sequence"
, and"none"
.
- set_range(x_start=None, x_end=None, y_start=None, y_end=None, x_mirrored=False, y_mirrored=False)[source]#
Set the sensor size.
- Parameters
- x_startint or float, optional
X size of the sensor in millimeters for the positive part. The default is
None
.- x_endint or float, optional
X size of the sensor in millimeters for the negative part. The default is
None
.- y_startint of float, optional
Y size of the sensor in millimeters for the positive part. The default is
None
.- y_endint or float, optional
Y size of the sensor in millimeters for the negative part. The default is
None
.- x_mirroredbool, optional
Mirrored extend option of the X size of the sensor. The default is
False
.- y_mirroredbool, optional
Mirrored extend option of the Y size of the sensor. The default is
False
.
- set_resolution(x_resolution=None, y_resolution=None)[source]#
Set the resolution of the sensor.
- Parameters
- x_resolutionint, optional
X resolution of the sensor in millimeters. The default is
None
.- y_resolutionint, optional
Y resolution of the sensor in millimeters. The default is
None
.
- set_sampling(x_sampling=None, y_sampling=None)[source]#
Set the number of samples on the axes.
- Parameters
- x_samplingint, optionl
Number of samples on the X-axis. The default is
None
.- y_samplingint
Number of samples on the Y-axis. The default is
None
.
- set_type(sensor_type)[source]#
Set the sensor type.
- Parameters
- sensor_typestr
Type of the sensor. Options are
"photometric"
,"colorimetric"
,"radiometric"
and"spectral"
.
- set_wavelength(w_start=None, w_end=None, w_sampling=None, w_resolution=None)[source]#
Set the wavelength of the sensor.
- Parameters
- w_startint, optional
Start of the wavelength band in nanometers. The default is
None
.- w_endint, optional
End of the wavelength band in nanometers. The default is
None
.- w_samplingint, optional
Number of spectral samples. The default is
None
.- w_resolutionfloat, optional
Spectral sampling or resolution (size of one sample) in nanometers. The default is
None
.
- class ansys_optical_automation.speos_process.speos_sensors.RadianceSensor(name, SpeosSim, SpaceClaim)[source]#
Bases:
ansys_optical_automation.speos_process.speos_sensors.Sensor
Provides methods for the Speos Radiance sensor.
Methods
convert_object_version
(obj)Function to convert Speos returns from latest to used API version Parameters ---------- obj : SpeosSelectedObject
find_axes
([origin])Find a component with the same name as the sensor, look in it for an axis system and an origin point (if available), and save them as properties in self.
set_definition_type
(definition_type)set radiancec sensor definition type.
set_focal_value
(focal_value)Set focal value of the radiance sensor
set_fov
(horizontal_fov, vertical_fov, ...)set field of view and sampling of the radiance sensor (Definition from Observer)
set_integration_angle
(integration_value)set integration angle of the radiance sensor
set_layer
(layer_type)set the layer type of the radiance sensor
set_observer_directions
(front_direction, ...)set front and top directions of the radiance sensor (Definition from Observer)
set_observer_point
(observer_point)set observer point of the radiance sensor (Definition from Observer)
set_observer_type
(observer_type)set observer type of the radiance sensor
set_position
([x_reverse, y_reverse, origin, ...])Set the origin and x and y directions of the sensor.
set_range
([x_start, x_end, y_start, y_end, ...])Set the sensor size.
set_resolution
(x_resolution, y_resolution)set x and y resolution of the radiance sensor
set_sampling
(x_sampling, y_sampling)set x and y sampling of the radiance sensor
set_type
(sensor_type)set type of the radiance sensor
set_wavelength_resolution
(resolution)set wavelength resolution of the radiance sensor
set_xmp_template
(xml_file[, take_dimension, ...])set the xmp template.
- set_definition_type(definition_type)[source]#
set radiancec sensor definition type.
- Parameters
- definition_typestr
type as observer or frame
- Returns
- set_focal_value(focal_value)[source]#
Set focal value of the radiance sensor
- Parameters
- focal_valuefloat
- set_fov(horizontal_fov, vertical_fov, horizontal_sampling, vertical_sampling)[source]#
set field of view and sampling of the radiance sensor (Definition from Observer)
- Parameters
- horizontal_fovfloat
- vertical_fovfloat
- horizontal_samplingfloat
- vertical_samplingfloat
- set_integration_angle(integration_value)[source]#
set integration angle of the radiance sensor
- Parameters
- integration_value
- set_observer_directions(front_direction, top_direction)[source]#
set front and top directions of the radiance sensor (Definition from Observer)
- Parameters
- front_directionaxis or line
- top_directionaxis or line
- set_observer_point(observer_point)[source]#
set observer point of the radiance sensor (Definition from Observer)
- Parameters
- observer_pointpoint or origin (coordinate system)
- set_observer_type(observer_type)[source]#
set observer type of the radiance sensor
- Parameters
- observer_typestr
- set_range(x_start=None, x_end=None, y_start=None, y_end=None, x_mirrored=False, y_mirrored=False)[source]#
Set the sensor size.
- Parameters
- x_startint or float, optional
X size of the sensor in millimeters for the positive part. The default is
None
.- x_endint or float, optional
X size of the sensor in millimeters for the negative part. The default is
None
.- y_startint of float, optional
Y size of the sensor in millimeters for the positive part. The default is
None
.- y_endint or float, optional
Y size of the sensor in millimeters for the negative part. The default is
None
.- x_mirroredbool, optional
Mirrored extend option of the X size of the sensor. The default is
False
.- y_mirroredbool, optional
Mirrored extend option of the Y size of the sensor. The default is
False
.
- set_resolution(x_resolution, y_resolution)[source]#
set x and y resolution of the radiance sensor
- Parameters
- x_resolution
- y_resolution
- set_sampling(x_sampling, y_sampling)[source]#
set x and y sampling of the radiance sensor
- Parameters
- x_samplingint
- y_samplingint
- set_wavelength_resolution(resolution)[source]#
set wavelength resolution of the radiance sensor
- Parameters
- resolutionfloat
- set_xmp_template(xml_file, take_dimension=False, take_display=False)[source]#
set the xmp template.
- Parameters
- xml_filestr
path of xml file
- take_dimensionbool
True if setting of dimension used from xml, otherwise False
- take_displaybool
True if setting of XMP display used from xml, otherwise False
- Returns
- class ansys_optical_automation.speos_process.speos_sensors.Sensor(name, SpeosSim, SpaceClaim)[source]#
Bases:
ansys_optical_automation.scdm_core.base.BaseSCDM
Provides the parent class for all Speos sensor types.
This class contains methods and properties that are common to all sensor types. It shouldn’t be used by itself. Subclasses should be used instead.
Methods
convert_object_version
(obj)Function to convert Speos returns from latest to used API version Parameters ---------- obj : SpeosSelectedObject
find_axes
([origin])Find a component with the same name as the sensor, look in it for an axis system and an origin point (if available), and save them as properties in self.
set_position
([x_reverse, y_reverse, origin, ...])Set the origin and x and y directions of the sensor.
- find_axes(origin=None)[source]#
Find a component with the same name as the sensor, look in it for an axis system and an origin point (if available), and save them as properties in self.
- Parameters
- originSpaceClaim curve object, optional
Name of the origin point to use for sensor positioning. For example,
origin="EPP_195"
. This point must exist underCurves
in the component of the same name as the sensor.
- set_position(x_reverse=False, y_reverse=False, origin=None, axes=None)[source]#
Set the origin and x and y directions of the sensor.
For some intensity sensors, set the origin and polar-axis and V0/H0-axis.
- Parameters
- x_reversebool, optional
Whether to reverse the direction of the X-axis of the sensor. The default is
False
.- y_reversebool, optional
Whether to reverse the direction of the Y-axis of the sensor. The default is
False
.- origintext or integer, optional
SpaceClaim axis system or a point. The default is
None
.- axeslist, optional
List in the format
[x-axis, y-axis]
that defines the orientation of the axis, wherex-axis
andy-axis
are SCDM axis objects (not an axis system). For IESNA and Elumdat intensity sensors, provide the polar-axis and V0/H0-axis instead.
ansys_optical_automation.speos_process.speos_simulations module#
- class ansys_optical_automation.speos_process.speos_simulations.Simulation(name, SpeosSim, SpaceClaim, kind='inverse')[source]#
Bases:
ansys_optical_automation.scdm_core.base.BaseSCDM
Provides methods for creating, modifying, and running Speos simulations.
Methods
add_sensor
(sensor_name)Add a sensor to the simulation.
convert_object_version
(obj)Function to convert Speos returns from latest to used API version Parameters ---------- obj : SpeosSelectedObject
Add all bodies from the simulation's list of bodies (self.my_bodies) to the simulation geometries.
export_grid
(sensor_name)Export the projected grid as a SpaceClaim component.
method to do a linked export
Run a simulation on the local CPU.
save_grid
(sensor_name, save_name)# TODO Save components in the main script in SpaceClaim.
select_geometrical_sets
(geosets_list)Add all geometries from a list of Catia geometrical sets to the simulation's list of bodies.
select_geometries
(component_list)Add all Mesh bodies and Design bodies from components provided in a component list to the simulation's list of bodies.
set_grid_params
([primary_step, ...])Set the parameters of the projected grid for the generated camera.
set_rays_limit
(rays)Set the computation limit either by a maximum number of rays (for direct and inverse simulations) or by a maximum number passes (for inverse simulations).
- add_sensor(sensor_name)[source]#
Add a sensor to the simulation.
- Parameters
- sensor_namestr
Name of the sensor.
- define_geometries()[source]#
Add all bodies from the simulation’s list of bodies (self.my_bodies) to the simulation geometries. This works Like the green
validate
button in Speos.
- export_grid(sensor_name)[source]#
Export the projected grid as a SpaceClaim component.
- Parameters
- sensor_namestr
Name of the sensor with the grid to import as a geometry.
- linked_export_simulation()[source]#
method to do a linked export
- Returns
- str
string containing the path to the simulation file
- select_geometrical_sets(geosets_list)[source]#
Add all geometries from a list of Catia geometrical sets to the simulation’s list of bodies.
- Parameters
- geosets_listlist
List with the names of Catia geometrical sets to add. For example,
["geo_set1", "geo_set2"]
.
- select_geometries(component_list)[source]#
Add all Mesh bodies and Design bodies from components provided in a component list to the simulation’s list of bodies.
- Parameters
- component_listlist
List with component names. For example,
["part1", "part2"]
.
- set_grid_params(primary_step=20, secondary_step=4, max_distance=1500, max_incidence=89, min_distance=2)[source]#
Set the parameters of the projected grid for the generated camera.
- Parameters
- primary_stepint, optional
Primary step of the grid. The default is
20
.- secondary_stepint, optional
Secondary step of the grid. The default is
4
.- max_distancefloat, optional
Maximum distance between a pixel and the camera in millimeters. The default is
1500
.- max_incidencefloat, optional
Maximum angle (degree) under which two projected pixels are to be connected by a line. The default is
89
.- min_distancefloat or int, optional
Distance tolerance in millimeters for which two adjacent pixels are to be connected by a line. The default is
2
.