Segment#

class phobos.Segment(id: int, *args, **kwargs)[source]#

Bases: object

Class to represent a segment of the deformable mirror (DM).

dm#

The DM to which the segment belongs.

Type:

DM

id#

The ID of the segment.

Type:

int

piston#

The piston value of the segment in nm.

Type:

float

tip#

The tip value of the segment in milliradians.

Type:

float

tilt#

The tilt value of the segment in milliradians.

Type:

float

__init__(id: int)[source]#

Initialize the segment with the given DM and ID.

Parameters:

id (int) – The ID of the segment.

set_piston(value) str[source]#

Set the piston value of the segment.

Parameters:

value (float) – The piston value to set in nm.

Returns:

The response of the mirror.

Return type:

str

set_phase(phase: float, lam: float = 1550.0) str[source]#

Set the segment piston using a phase command.

This converts a phase (radians) into an optical path difference expressed as a segment piston (nm). The command uses the configured piston range to define the phase origin and direction:

  • phase 0 rad corresponds to the center of the piston range, i.e. mean(Config().get('dm.piston_range'))

  • phase in [0, pi] moves the piston more negative (“recedes”)

  • phase in (pi, 2*pi) moves the piston more positive (“advances”)

The phase is first wrapped modulo 2*pi.

Parameters:
  • phase (float) – Phase command in radians.

  • lam (float, optional) – Wavelength in nanometers. Default is 1550.

Returns:

Hardware response string from the DM controller.

Return type:

str

get_piston() float[source]#

Get the piston value of the segment.

Returns:

The piston value of the segment in nm.

Return type:

float

get_piston_range() list[float][source]#

Get the piston range of the segment.

Returns:

The piston range ([min, max]) of the segment in nm.

Return type:

list[float]

set_tip(value: float) str[source]#

Set the tip value of the segment.

Parameters:

value (float) – The tip value to set in milliradians.

Returns:

The response of the mirror.

Return type:

str

get_tip() float[source]#

Get the tip value of the segment.

Returns:

The tip value of the segment in milliradians.

Return type:

float

get_tip_range() list[float][source]#

Get the tip range of the segment.

Returns:

The tip range ([min, max]) of the segment in radians.

Return type:

list[float]

set_tilt(value: float) str[source]#

Set the tilt value of the segment.

Parameters:

value (float) – The tilt value to set in milliradians.

Returns:

The response of the mirror.

Return type:

str

get_tilt() float[source]#

Get the tilt value of the segment.

Returns:

The tilt value of the segment in milliradians.

Return type:

float

get_tilt_range() list[float][source]#

Get the tilt range of the segment.

Returns:

The tilt range ([min, max]) of the segment in radians.

Return type:

list[float]

set_ptt(
piston: float,
tip: float,
tilt: float,
) tuple[str][source]#

Get the tip-tilt value of the segment.

Parameters:
  • piston (float) – The piston value to set in nm.

  • tip (float) – The tip value to set in milliradians.

  • tilt (float) – The tilt value to set in milliradians.

Returns:

  • str – The response of the mirror for the piston change.

  • str – The response of the mirror for the tip change.

  • str – The response of the mirror for the tilt change.

get_ptt() tuple[float, float, float][source]#

Get the tip-tilt value of the segment.

Returns:

  • float – The piston value of the segment in nm.

  • float – The tip value of the segment in milliradians.

  • float – The tilt value of the segment in milliradians.