PIM

Complete Device

class pcdsdevices.epics.PIM(prefix, prefix_det=None, read_attrs=None, **kwargs)

Bases: pcdsdevices.epics.pim.PIMMotor

Full profile intensity monitor including the motor to move the yag, and the detector to view it.

Parameters:
  • prefix (str) – The EPICS base of the motor
  • prefix_det (str, optional) – The EPICS base PV of the detector. If None, it will be inferred from the motor prefix
  • read_attrs (sequence of attribute names, optional) – The signals to be read during data acquisition (i.e., in read() and describe() calls)
  • configuration_attrs (sequence of attribute names, optional) – The signals to be returned when asked for the motor configuration (i.e. in read_configuration(), and describe_configuration() calls)
  • name (str, optional) – The name of the offset mirror
check_camera()

Checks if the camera is acquiring images.

Raises:
  • NotInsertedError – Error raised if the camera is not in the inserted position
  • NotAcquiringError – Error raised if the camera is not acquiring
detector

FormattedComponent attribute

FormattedComponent(PIMPulnixDetector, '{self._prefix_det}', read_attrs=['stats2'])

Major Components

class pcdsdevices.epics.pim.PIMMotor(prefix, *, read_attrs=None, configuration_attrs=None, name=None, parent=None, timeout=None, **kwargs)

Standard position monitor motor that can move the stage to insert the yag or diode, or retract it from the beam path.

Parameters:
  • prefix (str) – The EPICS base of the motor
  • read_attrs (sequence of attribute names, optional) – The signals to be read during data acquisition (i.e., in read() and describe() calls)
  • configuration_attrs (sequence of attribute names, optional) – The signals to be returned when asked for the motor configuration (i.e. in read_configuration(), and describe_configuration() calls)
  • name (str, optional) – The name of the offset mirror
blocking

Bool for if the yag is in a blocking position.

Returns:blocking
Return type:bool
insert(*args, **kwargs)

Alias for move_in() for lightpath interface

move(position, wait=False, **kwargs)

Move the PIM to the inputted position, optionally waiting for the move to complete. String inputs are not case sensitive and must be one of the following:

“DIODE”, “OUT”, “IN”, “YAG”

Enumerated positions can also be inputted where:

1 : “DIODE”, 2 : “OUT”, 3 : “IN”, 3 : “YAG”
Parameters:
  • position (str or number) – String or enumerated position to move to.
  • wait (bool, optional) – Wait for the status object to complete the move before returning
  • timeout (float, optional) – Maximum time to wait for the motion. If None, the default timeout for this positioner is used
  • settle_time (float, optional) – Delay after the set() has completed to indicate completion to the caller
Returns:

status – Status object of the move

Return type:

MoveStatus

Raises:

ValueError – If the inputted position to move to is not a valid position

move_diode(wait=False, **kwargs)

Move the PIM to the DIODE position. Alias for move(“DIODE”).

Returns:status – Status object of the move
Return type:MoveStatus
move_in(wait=False, **kwargs)

Move the PIM to the YAG position. Alias for move(“YAG”).

Returns:status – Status object of the move
Return type:MoveStatus
move_out(wait=False, **kwargs)

Move the PIM to the OUT position. Alias for move(“OUTx”).

Returns:status – Status object of the move
Return type:MoveStatus
mv(position, wait=False, **kwargs)

Move the PIM to the inputted position, optionally waiting for the move to complete. String inputs are not case sensitive and must be one of the following:

“DIODE”, “OUT”, “IN”, “YAG”

Enumerated positions can also be inputted where:

1 : “DIODE”, 2 : “OUT”, 3 : “IN”, 3 : “YAG”
Parameters:
  • position (str or number) – String or enumerated position to move to.
  • wait (bool, optional) – Wait for the status object to complete the move before returning
  • timeout (float, optional) – Maximum time to wait for the motion. If None, the default timeout for this positioner is used
  • settle_time (float, optional) – Delay after the set() has completed to indicate completion to the caller
Returns:

status – Status object of the move

Return type:

MoveStatus

Raises:

ValueError – If the inputted position to move to is not a valid position

position

Return the current position of the yag.

Returns:position
Return type:str
remove(*args, **kwargs)

Alias for move_out() for lightpath interface

state

Return the current position of the yag.

Returns:position
Return type:str
states

FormattedComponent attribute

FormattedComponent(PIMStates, '{self.prefix}')
subscribe(cb, event_type=None, run=True)

Subscribe to changes of the PIMMotor

Parameters:
  • cb (callable) – Callback to be run
  • event_type (str, optional) – Type of event to run callback on
  • run (bool, optional) – Run the callback immediatelly
class pcdsdevices.epics.pim.PIMPulnixDetector(*args, **kwargs)

Pulnix detector that is used in the PIM. Plugins should be added on an as needed basis here.

acquiring

Checks to see if the camera is currently acquiring images. Alias for cam.acquire

Returns:acquiring
Return type:bool
centroid

Returns the beam centroid in x and y. Alias for (centroid_x, centroid_y)

Returns:centroids – Tuple of the centroids in x and y
Return type:tuple
Raises:NotAcquiringError – When this property is called but the camera isn’t acquiring.
centroid_x

Returns the beam centroid in x. Alias for stats2.centroids.x.

Returns:centroid_x – Centroid of the image in x.
Return type:float
Raises:NotAcquiringError – When this property is called but the camera isn’t acquiring.
centroid_y

Returns the beam centroid in y. Alias for stats2.centroids.y.

Returns:centroid_y – Centroid of the image in y.
Return type:float
Raises:NotAcquiringError – When this property is called but the camera isn’t acquiring.
check_camera()

Checks if the camera is acquiring images.

Raises:NotAcquiringError – Error raised if called when the camera is not acquiring
image

Returns the image from image1

Returns:image – Image array
Return type:np.ndarray
image1

Component attribute

Component(ImagePlugin, ':IMAGE1:', read_attrs=['array_data'])
image2

Component attribute

Component(ImagePlugin, ':IMAGE2:', read_attrs=['array_data'])
stats2

Component attribute

Component(StatsPlugin, ':Stats2:', read_attrs=['centroid', 'mean_value'])

Variations

class pcdsdevices.epics.pim.PIMFee(prefix, *, prefix_pos='', in_pos=0, out_pos=43, read_attrs=None, name=None, parent=None, configuration_attrs=None, **kwargs)

PIM class for the PIMs in the FEE that run using Dehong’s custom ioc.

Parameters:
  • prefix (str) – The EPICS base of the motor and detector
  • prefix_pos (str, optional) – The EPICS base PV of the state PVs
  • read_attrs (sequence of attribute names, optional) – The signals to be read during data acquisition (i.e., in read() and describe() calls)
  • configuration_attrs (sequence of attribute names, optional) – The signals to be returned when asked for the motor configuration (i.e. in read_configuration(), and describe_configuration() calls)
  • name (str, optional) – The name of the offset mirror
blocking

Bool for if the yag is in a blocking position.

Returns:blocking
Return type:bool
check_camera()

Checks if the camera is acquiring images.

Raises:
  • NotInsertedError – Error raised if the camera is not in the inserted position
  • NotAcquiringError – Error raised if the camera is not acquiring
detector

FormattedComponent attribute

FormattedComponent(FeeOpalDetector, '{self._prefix}', name='Opal Camera')
focus

FormattedComponent attribute

FormattedComponent(ImsMotor, '{self._prefix}:CLF:01', name='Focus Motor')
go

FormattedComponent attribute

FormattedComponent(EpicsSignal, '{self._prefix_pos}:YAG:GO')
image

Returns the image stream reshaped to be the correct size using the size component in cam.

Returns:image – Image array
Return type:np.ndarray
move(position, wait=False, **kwargs)

Move the yag motor to the inputted state, optionally waiting for the move to complete. String inputs are not case sensitive and must be one of the following:

“IN”, “OUT”

If a number is passed then the yag motor will be moved the inputted position.

Parameters:
  • position (str or number) – String or position to move to.
  • wait (bool, optional) – Wait for the status object to complete the move before returning
  • timeout (float, optional) – Maximum time to wait for the motion. If None, the default timeout for this positioner is used
  • settle_time (float, optional) – Delay after the set() has completed to indicate completion to the caller
Returns:

status – Status object of the move

Return type:

MoveStatus

Raises:

ValueError – If the inputted position to move to is not a valid position

move_in(wait=False, **kwargs)

Move the PIM to the IN position. Alias for move(“IN”).

Returns:status – Status object of the move
Return type:MoveStatus
move_out(wait=False, **kwargs)

Move the PIM to the OUT position. Alias for move(“OUT”).

Returns:status – Status object of the move
Return type:MoveStatus
pos

FormattedComponent attribute

FormattedComponent(EpicsSignalRO, '{self._prefix_pos}:POSITION')
position

Return the current position of the yag.

Returns:position
Return type:str
state

Returns the current state of the yag. Alias for self.position.

Returns:position
Return type:str
yag

FormattedComponent attribute

FormattedComponent(ImsMotor, '{self._prefix}:MOTR', name='Yag Motor')
zoom

FormattedComponent attribute

FormattedComponent(ImsMotor, '{self._prefix}:CLZ:01', name='Zoom Motor')