ansys_optical_automation.post_process package#
Submodules#
ansys_optical_automation.post_process.dpf_base module#
- class ansys_optical_automation.post_process.dpf_base.DataProcessingFramework(extension, application=None)[source]#
Bases:
object
Provides DPF (Data Processing Framework).
The class contains opening and saving functionalities to allow interacting with any results file.
Methods
close
()Function to close open files and applications
open_file
(str_path)Open a file in DPF.
valid_dir
(str_path)Check if a folder is present and, if not, create it.
- application_list = ['SimpleBSDFSurfaceViewer.Application', 'HDRIViewer.Application', 'XMPViewer.Application']#
- binary_format = {'.dat', '.ray', '.sdf'}#
- open_file(str_path)[source]#
Open a file in DPF.
- Parameters
- str_pathstr
Path for the file to open. For example,
r"C:\temp\Test.speos360"
.
- Returns
- None
- text_format = {'.spcd', '.spectrum'}#
ansys_optical_automation.post_process.dpf_brdf_viewer module#
- class ansys_optical_automation.post_process.dpf_brdf_viewer.BrdfMeasurementPoint(input_incidence, input_wavelength, input_theta, input_brdf)[source]#
Bases:
object
class of a single brdf point measure: brdf = f(wavelength, incidence, theta) no phi dependency for measured brdf
- class ansys_optical_automation.post_process.dpf_brdf_viewer.BrdfStructure(wavelength_list)[source]#
Bases:
object
class of BRDF contains method to host and convert 2d reflectance brdf values into 3d brdf file.
Methods
brdf_1d_function
(wavelength, incident)to provide a 1d linear fitting function for 2d measurement brdf points.
convert
([sampling])convert the provided 2d measurement brdf data.
export_to_speos
(export_dir)save the 4d brdf structure into a brdf file.
- brdf_1d_function(wavelength, incident)[source]#
to provide a 1d linear fitting function for 2d measurement brdf points.
- Parameters
- wavelengthfloat
wavelength used to find the target brdf values.
- incidentfloat
incident used to find the target brdf values.
- Returns
ansys_optical_automation.post_process.dpf_hdri_viewer module#
- class ansys_optical_automation.post_process.dpf_hdri_viewer.DpfHdriViewer[source]#
Bases:
ansys_optical_automation.post_process.dpf_base.DataProcessingFramework
Provides for launching Speos postprocessing software, Virtual reality lab.
This framework is used to interact with the software and automatically perform analysis and postprocessing on the simulation results
Methods
close
()Function to close open files and applications
export_vr_views
([export_path, phi_angles, ...])Export VR results for all or specific configurations for defined angles or all angles as image (JPG) files.
Get the source list stored in the simulation result.
open_file
(str_path)Open a file in DPF.
set_source_power
(source, value)Set the source with power value provided.
set_source_ratio
(source, value)Set the source with power ratio value provided.
timeline_animation_run
(csv_file)function to run animation in observer result.
valid_dir
(str_path)Check if a folder is present and, if not, create it.
- export_vr_views(export_path=None, phi_angles=None, theta_angles=None, config_ids=None)[source]#
Export VR results for all or specific configurations for defined angles or all angles as image (JPG) files.
- Parameters
- export_pathstring
Path for exporting the JPG files. If this path does not exist, it is created.
- phi_angleslist of floats, optional
List of phi angles to export. The default is
None
, in which case all phi angles are exported.- theta_angleslist of floats, optional
List of theta angles to export. The default is
None
, in which case all theta angles are exported.- config_idslist of positive integers or list of strings or a string or an integer, optional
List of configurations IDs to export. The default is
None
, in which case all configuration IDs are exported.
- get_source_list()[source]#
Get the source list stored in the simulation result.
- Returns
- list
List of sources available in the postprocessing file.
- set_source_power(source, value)[source]#
Set the source with power value provided.
- Parameters
- sourceint/str
source defined by id or name.
- valuefloat
source power.
- Returns
ansys_optical_automation.post_process.dpf_rayfile module#
- class ansys_optical_automation.post_process.dpf_rayfile.DpfRay(x, y, z, l_dir, m_dir, n_dir, wavelength, e)[source]#
Bases:
object
this class defines the ray property
- Attributes
coordinate_x
return ray cardinal_coordinate_x
coordinate_y
return ray cardinal_coordinate_y
coordinate_z
return ray cardinal_coordinate_z
energy
return ray energy
radiation_l
return ray vector_radiation_l
radiation_m
return ray vector_radiation_m
radiation_n
return ray vector_radiation_n
wavelength
return ray wavelength
- property coordinate_x: float#
return ray cardinal_coordinate_x Returns:
cardinal_coordinate_x
- property coordinate_y: float#
return ray cardinal_coordinate_y Returns:
cardinal_coordinate_y
- property coordinate_z: float#
return ray cardinal_coordinate_z Returns:
cardinal_coordinate_z
- property energy: float#
return ray energy Returns:
energy
- property radiation_l: float#
return ray vector_radiation_l Returns:
vector_radiation_l
- property radiation_m: float#
return ray vector_radiation_m Returns:
vector_radiation_m
- property radiation_n: float#
return ray vector_radiation_n Returns:
vector_radiation_n
- property wavelength: float#
return ray wavelength Returns:
wavelength
- class ansys_optical_automation.post_process.dpf_rayfile.DpfRayfile(file_path)[source]#
Bases:
ansys_optical_automation.post_process.dpf_base.DataProcessingFramework
this class contains method to read extract ray data from given binary rayfile
- Attributes
photometric_power
this method return Photometric Power value
radiometric_power
this method return the Radiometric Power value
rays
this method return a list of rays
rays_number
this method return the number of rays
Methods
close
()Function to close open files and applications
export_file
([export_folder_dir, convert])this method generates a file to be exported Parameters ----------
this method convert the rayfile into speos format
this method convert the rayfile into zemax format
this method load the information from rayfile provided
open_file
(str_path)Open a file in DPF.
set_ray_count
(raynumber)redfine raynumber Parameters ---------- raynumber : int
valid_dir
(str_path)Check if a folder is present and, if not, create it.
- conversion_extension = {'.dat': '.ray', '.ray': '.sdf', '.sdf': '.ray'}#
- export_file(export_folder_dir=None, convert=False)[source]#
this method generates a file to be exported Parameters ———-
- export_folder_dirstr ,optional
defines path where to export the rayfile
- convertBoolean , optional
defines if the export is a conversion, default value is False
- outfile: str
output file
- property photometric_power: float#
this method return Photometric Power value Returns:
Photometric Power value
- property radiometric_power: float#
this method return the Radiometric Power value Returns:
Radiometric Power value
- property rays: [<class 'ansys_optical_automation.post_process.dpf_rayfile.DpfRay'>]#
this method return a list of rays Returns:
a list of rays
- property rays_number: int#
this method return the number of rays Returns:
number of rays in rayfile
ansys_optical_automation.post_process.dpf_stack module#
- class ansys_optical_automation.post_process.dpf_stack.DpfStack(version)[source]#
Bases:
object
Provides DPF (Data Processing Framework).
The class contains opening and saving functionalities to allow interacting between stack and speos and zemax.
Methods
conver the stack result into required information by speos coated file.
conver the stack result into required information by Zemax .dat coating file.
open_file
(stack_file)Open a stack file.
- convert_stack_to_speos()[source]#
conver the stack result into required information by speos coated file.
ansys_optical_automation.post_process.dpf_xmp_viewer module#
- class ansys_optical_automation.post_process.dpf_xmp_viewer.DpfXmpViewer[source]#
Bases:
ansys_optical_automation.post_process.dpf_base.DataProcessingFramework
Provides for launching Speos postprocessing software, XMP Viewer.
This framework is used to interact with the software and automatically perform analysis and postprocessing on the simulation results
Methods
close
()Function to close open files and applications
export
([format])function to export an XMP map to another format
export_template_measures
(template_path, ...)Function to import measurement tamplate and export measures as text Parameters ---------- template_path : str path to XML template file export_path : str path to measurement text export
open_file
(str_path)Open a file in DPF.
read_txt_export
(txt_path[, inc_data])- Parameters
rect_export_spectrum
(x_pos, y_pos, width, height)- Parameters
valid_dir
(str_path)Check if a folder is present and, if not, create it.
- export(format='txt')[source]#
function to export an XMP map to another format
- Parameters
- formatstr
export format allowed values [“txt”, “png”, “bmp”, “jpg”, “tiff”, “pf”, “ies”, “ldt”, “extended.txt”]
- export_template_measures(template_path, export_path)[source]#
Function to import measurement tamplate and export measures as text Parameters ———- template_path : str
path to XML template file
- export_pathstr
path to measurement text export
- Returns
- None
- open_file(str_path)[source]#
Open a file in DPF.
- Parameters
- str_pathstr
Path for the file to open. For example,
r"C:\temp\Test.speos360"
.
- Returns
- None
- class ansys_optical_automation.post_process.dpf_xmp_viewer.MapStruct(map_type, value_type, intensity_type, unit_type, axis_unit, size, resolution, layers=1, layer_name=None, wl_res=None)[source]#
Bases:
object
Provides a DPF to represent the data stored in an Ansys Speos XMP file
Methods
export_to_xmp
([export_path])this function exports the current mapstruct in the dir defined as Mapstruct.xmp. Parameters ---------- export_path: str path to be exported. Default at C: emp.
valid_dir
(str_path)Check if a folder is present and, if not, create it.