Pupil Mask#
- class phobos.PupilMask(*args, **kwargs)[source]#
Bases:
objectSingleton Class to control the mask wheel in the optical system.
Warning
It is highly recommended to reset the mask to the home position using the reset=True parameter when initializing the PupilMask object.
- zaber_h_home#
Home position for the horizontal motor (in steps).
- Type:
int
- zaber_v_home#
Home position for the vertical motor (in steps).
- Type:
int
- newport_home#
Angular home position for the first mask (in degrees).
- Type:
float
- move_h(pos: int, abs: bool = False) str[source]#
Move the mask to the horizontal by a certain number of steps.
- Parameters:
pos (int) – Number of steps to move.
abs (bool, optional) – If True, move to an absolute position. Default is False.
- Returns:
Response from the motor after moving to the target position.
- Return type:
str
- move_v(pos: int, abs: bool = False) str[source]#
Move the mask vertically by a certain number of steps.
- Parameters:
pos (int) – Number of steps to move.
abs (bool, optional) – If True, move to an absolute position. Default is False.
- Returns:
Response from the motor after moving to the target position.
- Return type:
str
- rotate_clockwise(
- pos: float,
- abs: bool = False,
Rotate the mask clockwise by a certain number of degrees. Alias: rotate()
- Parameters:
pos (float) – Number of degrees to rotate.
abs (bool, optional) – If True, rotate to an absolute position. Default is False.
- Returns:
Response from the motor after moving to the target position.
- Return type:
str
- apply_mask(key: str, config_path: str = None)[source]#
Rotate the mask wheel and move the Zabers to the desired mask position. It can load the positions of the wheel and the zabers from a YAML file. In this case, key is the string of the key of the YAML file of the desired configuration to set.
If no such file is given, key (string or int) is the number of the mask to put. The zabers remains are not moved.
- Parameters:
key (str or int) – Key of the config to load.
config_path (str, optional) – YAML file in which are stored the motors positions. See “Configuration file” documentation. for each wheel position. The default is None.
- Returns:
Response from the motor after moving to the target position.
- Return type:
str
- get_pos()[source]#
Get the current position of the mask.
- Returns:
float – Current angular position of the mask wheel (in degrees).
int – Current position of the horizontal Zaber motor (in steps).
int – Current position of the vertical Zaber motor (in steps).