Field Functions#

These functions are for specifying the angular field of a system in Zemax.

skZemax.skZemax_subfunctions._field_functions.Field_ClearVignettingFactors(self) None[source]#

Sets vignetting factors to zero.

skZemax.skZemax_subfunctions._field_functions.Field_DeleteField(self, in_field: int | ZOSAPI_SystemData_IField) None[source]#

Deletes a field.

Parameters:

in_field (Union[int, ZOSAPI_SystemData_IField]) – Field to delete - either the index or the object.

skZemax.skZemax_subfunctions._field_functions.Field_GetAllDataOfField(self, in_field: int | ZOSAPI_SystemData_IField) dict[source]#

Gets all column data of a Field object and returns it as a dict.

Parameters:

in_field (Union[int, ZOSAPI_SystemData_IField]) – The Field - either the index or the object.

Returns:

dict of all Field’s properties

Return type:

dict

skZemax.skZemax_subfunctions._field_functions.Field_GetField(self, fieldNum: int = 1) ZOSAPI_SystemData_IField[source]#

Returns the Field object at the given field index

Parameters:

fieldNum (int, optional) – The field index, defaults to 1

Returns:

The field object at index.

Return type:

ZOSAPI_SystemData_IField

skZemax.skZemax_subfunctions._field_functions.Field_GetFieldType(self) str[source]#

Returns the currently set field type (see Field_SetFieldType()).

Returns:

Name of the currently set field type.

Return type:

str

skZemax.skZemax_subfunctions._field_functions.Field_GetNormalization(self) str[source]#

Returns the currently set normalization. See Field_SetNormalization().

Returns:

The name of the set normalization.

Return type:

str

skZemax.skZemax_subfunctions._field_functions.Field_SetAllDataOfFieldFromDict(self, in_field: int | ZOSAPI_SystemData_IField, Field_dict: dict) None[source]#

Sets all column data of a Field object and returns it as a dict.

Parameters:
  • in_field (Union[int, ZOSAPI_SystemData_IField]) – The Field - either the index or the object.

  • Field_dict (dict) – dict of Field properties to set (i.e. Field_GetDataOfField())

skZemax.skZemax_subfunctions._field_functions.Field_SetFieldType(self, field_type: str = 'Angle') None[source]#

Sets the system field type to one of the following options:

  • Angle (default)

    Angle Field angles are always in degrees. The angles are measured with respect to the object space z axis and the paraxial entrance pupil position on the object space z axis. Positive field angles imply positive slope for the ray in that direction, and thus refer to negative coordinates on distant objects.

  • ObjectHeight

    Object Height Measured in lens units.

  • ParaxialImageHeight

    Paraxial Image Measured in lens units. When paraxial image heights are used as the field definition, the heights are the paraxial image coordinates of the primary wavelength chief ray on the paraxial image surface, and if the optical system has distortion, then the real chief rays will be at different locations.

  • RealImageHeight

    Real Image Measured in lens units. When real image heights are used as the field definition, the heights are the real ray coordinates of the primary wavelength chief ray on the image surface

  • TheodoliteAngle

    If the field definition is Theodolite Angle in the Field Data Editor, the X/Y Field Width indicates the Azimuth/Elevation angle in degrees, respectively.

Parameters:

field_type (str, optional) – Name of the field type, defaults to ‘Angle’

skZemax.skZemax_subfunctions._field_functions.Field_SetNormalization(self, normalization: str = 'Radial') None[source]#

Sets the type of field normalization to apply. This is relevant for specifying rays in normalized normalized x-field coordinate Hx and normalized y-field coordinate Hy.

See LDE_BuildRayTraceNormalizedUnpolarizedRays() for a more in-depth description.

Options are:

  • Radial

    Hx^2 + Hy^2 <= 1

  • Rectangular

    abs(Hx) <= 1 and abs(Hy) <= 1

Parameters:

normalization (str, optional) – Type of normalization to apply when specifying ray coordinates Hx and Hy, defaults to ‘Radial’

skZemax.skZemax_subfunctions._field_functions.Field_SetVignettingFactors(self) None[source]#

Recomputes the vignetting factors for each field based upon the current lens data. Vignetting factors (VDX, VDY, VCX, VCY) are coefficients which describe the apparent entrance pupil size and location for different field positions. These vignetting factors should be left at zero if there is no vignetting in the system. The set vignetting algorithm estimates the vignetting decenter and compression factors so that the four marginal rays in the top, bottom, left, and right edges of the pupil pass within the apertures of each surface. Only the primary wavelength is used.

skZemax.skZemax_subfunctions._field_functions.Fields_AddField(self, field_x: float, field_y: float, field_weight: float = 1.0) ZOSAPI_SystemData_IField[source]#

Adds a new field.

Parameters:
  • field_x (float) – Field X parameter. Typically angle (degrees) in the x-axis. See Field_SetFieldType().

  • field_y (float) – Field Y parameter. Typically angle (degrees) in the y-axis. See Field_SetFieldType().

  • field_weight (float, optional) – Field weight, defaults to 1.0

Returns:

The new field object

Return type:

ZOSAPI_SystemData_IField

skZemax.skZemax_subfunctions._field_functions.Fields_GetNumberOfFields(self) int[source]#

Returns the total number of current field angles

Returns:

The total number of field angles

Return type:

int