CoatedSurfaceFile#
- class ansys.speos.core.input_files.coated_surface.CoatedSurfaceFile(wavelengths=_DEFAULT_WAVELENGTHS, incident_angles=_DEFAULT_INCIDENT_ANGLES, samples=None, description=_DEFAULT_DESCRIPTION)#
Bases:
ansys.speos.core.input_files._base.SpeosTextFileFormatSpeos
*.coatedfile, a non-scattering coating varying with angle and wavelength.The file holds one
ansys.speos.core.input_files.coated_surface.CoatedSurfaceSampleper angle of incidence and per wavelength, stored insamples[incidence_index][wavelength_index].- Parameters:
- wavelengths
Sequence[float],optional Wavelengths of the samples, in nm, sorted in increasing order. By default,
[400.0, 550.0, 700.0].- incident_angles
Sequence[float],optional Angles of incidence of the samples, in degrees, sorted in increasing order. By default,
[0.0, 60.0, 90.0].- samples
List[List[CoatedSurfaceSample]],optional Coating responses, one row per angle of incidence and one column per wavelength. By default, a 3 x 3 grid of independent default
ansys.speos.core.input_files.coated_surface.CoatedSurfaceSampleobjects, which reflect all the light.- description
str,optional Free text written on the second line of the file. By default,
"Coating surface".
- wavelengths
- Parameters:
wavelengths (Sequence[float])
incident_angles (Sequence[float])
samples (List[List[CoatedSurfaceSample]] | None)
description (str)
Notes
Called without arguments, the constructor creates a 3 x 3 grid of perfect reflectors. Pass
wavelengths,incident_anglesandsamplestogether to describe another grid, since each default only matches the other ones.A Speos coating is only valid for the rays crossing the interface in one direction. List getters copy the containers, while sample objects remain shared and editable through validated properties. To resize a populated grid, clear
CoatedSurfaceFile.samples, set the axes, then assign the new grid. Empty lists allow drafts;save()requires complete axes and samples.Examples
>>> from ansys.speos.core.input_files.coated_surface import ( ... CoatedSurfaceFile, ... CoatedSurfaceSample, ... ) >>> sample = CoatedSurfaceSample(31.9, 68.1, 31.9, 68.1) >>> CoatedSurfaceFile( ... wavelengths=[480.0, 780.0], ... incident_angles=[0.0, 90.0], ... samples=[[sample, sample], [sample, sample]], ... ).save("mirror.coated")
Overview#
Check the coating against the constraints of the |
Sorted wavelengths in nm, returned as a copy. |
|
Sorted incidence angles in degrees, returned as a copy. |
|
Sample grid with copied containers and shared samples. |
|
Single-line description. |
Usual file extension of the format. |
|
First line of the file. Empty when the format has no header line. |
|
Version-agnostic start of |
Import detail#
from ansys.speos.core.input_files.coated_surface import CoatedSurfaceFile
Property detail#
- property CoatedSurfaceFile.incident_angles: List[float]#
Sorted incidence angles in degrees, returned as a copy.
- property CoatedSurfaceFile.samples: List[List[CoatedSurfaceSample]]#
Sample grid with copied containers and shared samples.
- Parameters:
- values
List[List[CoatedSurfaceSample]] New coating responses, one row per angle of incidence and one column per wavelength.
- values
- Returns:
List[List[CoatedSurfaceSample]]Rows per incidence and columns per wavelength.
Attribute detail#
- CoatedSurfaceFile.EXTENSION = '.coated'#
Usual file extension of the format.
- CoatedSurfaceFile.HEADER = 'OPTIS - Coated surface file v1.0'#
First line of the file. Empty when the format has no header line.
- CoatedSurfaceFile.HEADER_PREFIX = 'OPTIS - Coated surface file'#
Version-agnostic start of
HEADER, used to validate a file being read.
Method detail#
- CoatedSurfaceFile.validate()#
Check the coating against the constraints of the
*.coatedformat.- Raises:
ValueErrorIf no wavelength or angle of incidence is given, they are not sorted, the sample grid does not match them, or a sample holds invalid values.