Ray#

class ansys.speos.core.input_files.ray_file.Ray(position=(0.0, 0.0, 0.0), direction=(0.0, 0.0, 1.0), wavelength=555.0, energy=1.0, polarization=None)#

Bases: ansys.speos.core.input_files._base._ValueComparable

Single ray of a Speos ray file.

Parameters:
positionTuple[float, float, float], optional

Cartesian coordinates the ray starts from, in mm. By default, (0.0, 0.0, 0.0).

directionTuple[float, float, float], optional

Direction cosines (l, m, n) of the ray, which must be a unit vector. By default, (0.0, 0.0, 1.0).

wavelengthfloat, optional

Wavelength of the ray, in nm. By default, 555.0.

energyfloat, optional

Relative radiometric energy of the ray, between 0 and 1. The absolute flux of the ray is its share of the total flux of the file. By default, 1.0.

polarizationOptional[Tuple[float, float, float, float, float]], optional

Polarization (o, p, q, r, s), where (o, p, q) is the normalized big axis of the polarization ellipse, r the ratio of its small axis over its big axis and s the handedness, 0 for right and 1 for left. By default, None, for an unpolarized ray.

Parameters:

Notes

The direction cosines relate to the zenith angle theta and the azimuth angle phi through l = sin(theta) * cos(phi), m = sin(theta) * sin(phi) and n = cos(theta). Vector setters store finite immutable tuples. The direction must already be normalized within a tolerance of 1e-3 when constructing or updating a ray; it is not normalized automatically.

Overview#

validate

Check that the ray direction retains its unit norm.

position

Starting coordinates in mm.

direction

Direction cosines of the ray.

wavelength

Wavelength of the ray, in nm.

energy

Relative radiometric energy.

polarization

Polarization ellipse parameters.

Import detail#

from ansys.speos.core.input_files.ray_file import Ray

Property detail#

property Ray.position: Tuple[float, ...]#

Starting coordinates in mm.

Parameters:
valuesTuple[float, float, float]

New Cartesian coordinates the ray starts from, in mm.

Returns:
Tuple[float, …]

Three finite Cartesian coordinates.

property Ray.direction: Tuple[float, ...]#

Direction cosines of the ray.

Parameters:
valuesTuple[float, float, float]

New direction cosines (l, m, n) of the ray, which must be a unit vector. The norm must be within 1e-3 of one; the vector is not normalized automatically.

Returns:
Tuple[float, …]

Three finite coordinates with unit norm within 1e-3.

property Ray.wavelength: float#

Wavelength of the ray, in nm.

Parameters:
valuefloat

New wavelength of the ray, in nm.

Returns:
float

Finite wavelength.

property Ray.energy: float#

Relative radiometric energy.

Parameters:
valuefloat

New relative radiometric energy of the ray, between 0 and 1. The absolute flux of the ray is its share of the total flux of the file.

Returns:
float

Finite relative energy.

property Ray.polarization: Tuple[float, ...] | None#

Polarization ellipse parameters.

Parameters:
valuesOptional[Tuple[float, float, float, float, float]]

New polarization (o, p, q, r, s), where (o, p, q) is the normalized big axis of the polarization ellipse, r the ratio of its small axis over its big axis and s the handedness, 0 for right and 1 for left. Use None for an unpolarized ray.

Returns:
Optional[Tuple[float, …]]

Five finite parameters, or None for an unpolarized ray.

Method detail#

Ray.validate()#

Check that the ray direction retains its unit norm.

Raises:
ValueError

If the direction is not a unit vector.