CBPComponent¶
- 
class lsst.ts.cbp.CBPComponent¶
- Bases: - object- This class is for implementing the CBP component. - The component implements a python wrapper over DMC code written by DFM Manufacturing. The following api exposes commands that move the motors of the CBP, sets the focus and selects the mask. - Notes - The class uses the python socket module to build TCP/IP connections to the Galil controller for the CBP. The underlying api is built on DMC. - Attributes: - log : logging.Logger
- The logger for the component 
- socket : socket.Socket
- The socket that handles the TCP/IP connection for the CBP 
- altitude : float
- The value of the CBP altitude encoder in degrees. 
- azimuth : float
- The value of the CBP azimuth encoder in degrees. 
- mask : str
- The current mask name 
- mask_rotation : float
- The current value of the mask rotation encoder in degrees. 
- masks : SimpleNamespace
- A simplenamespace that contains the mask names and rotation values and id. 
- focus : float
- The current value of the focus encoder in microns. 
- panic_status : float
- The current value of the panic variable in the CBP dmc code. A non-zero value represents a panic state and causes the motors to cease functioning until panic is dealt with or goes away. This status is set by the values of the other statuses. 
- auto_park : float
- The current value of the auto_park variable. If this value is one, that means that CBP suffered a power loss that lasted more than 12 seconds and was on battery back up. The CBP will then park itself automatically, moving azimuth to 0 and altitude to -70 and locking focus and mask. To un-park CBP, the park variable should be set to zero. 
- park : float
- The current value of the park variable. This value can be set to one or zero, if set to one it will park the CBP if set to zero it will un-park. 
- encoder_status : Status
- A flag enum that contains the status information for each encoder. 
 - Methods Summary - change_focus(position)- This changes the focus to whatever value the user sent. - check_auto_park()- Gets the autopark variable from CBP - check_cbp_status()- Read and record the status of the encoders. - check_panic_status()- Gets the panic variable from CBP - check_park()- Gets the park variable from CBP - configure(config)- connect()- Create a socket and connect to the CBP’s static address and designated port. - disconnect()- Disconnect from the tcp socket. - generate_mask_info()- Generates initial mask info. - get_azimuth()- Get azimuth value from azimuth encoder which is in degrees. - get_cbp_telemetry()- Gets the position data of the CBP. - get_elevation()- Read and record the mount elevation encoder, in degrees. - get_focus()- This gets the value of the focus encoder. - get_mask()- This gets the current mask value from the encoder which is converted into the name of the mask. - get_mask_rotation()- This gets the mask rotation value from the encoder which is in degrees. - get_motion_status()- move_azimuth(position)- This moves the horizontal axis to the value sent by the user. - move_elevation(position)- This moves the vertical axis to the value that the user sent. - publish()- This updates the attributes within the component. - send_command(msg)- Send the encoded command and read the reply. - set_mask(mask)- This sets the mask value - set_mask_rotation(mask_rotation)- This sets the mask rotation - set_park()- Park the CBP - set_simulation_mode(simulation_mode)- set_unpark()- Unpark the CBP. - Methods Documentation - 
change_focus(position: int)¶
- This changes the focus to whatever value the user sent. - Parameters: - position: int
- The value of the new focus in microns. 
 - Returns: - None
 
 - 
check_auto_park()¶
- Gets the autopark variable from CBP - Returns: - None
 
 - 
check_cbp_status()¶
- Read and record the status of the encoders. - Returns: - None
 
 - 
check_panic_status()¶
- Gets the panic variable from CBP - Returns: - None
 
 - 
check_park()¶
- Gets the park variable from CBP - Returns: - None
 
 - 
configure(config)¶
 - 
connect()¶
- Create a socket and connect to the CBP’s static address and designated port. - Returns: - None
- Nothing 
 
 - 
disconnect()¶
- Disconnect from the tcp socket. 
 - 
generate_mask_info()¶
- Generates initial mask info. 
 - 
get_azimuth()¶
- Get azimuth value from azimuth encoder which is in degrees. - Returns: - None
 
 - 
get_cbp_telemetry()¶
- Gets the position data of the CBP. - Returns: - None
 
 - 
get_elevation()¶
- Read and record the mount elevation encoder, in degrees. - Note that the low-level controller calls this axis “altitude”. - Returns: - None
 
 - 
get_focus()¶
- This gets the value of the focus encoder. Units: microns - Returns: - None
 
 - 
get_mask()¶
- This gets the current mask value from the encoder which is converted into the name of the mask. - Returns: - None
 
 - 
get_mask_rotation()¶
- This gets the mask rotation value from the encoder which is in degrees. - Returns: - None
 
 - 
get_motion_status()¶
 - 
move_azimuth(position: float)¶
- This moves the horizontal axis to the value sent by the user. - Parameters: - position: float
- The desired azimuth (degrees). 
 - Returns: - None
 
 - 
move_elevation(position: float)¶
- This moves the vertical axis to the value that the user sent. - Parameters: - position: float
- The desired elevation (degrees) 
 - Returns: - None
 
 - 
publish()¶
- This updates the attributes within the component. - Returns: - None
 
 - 
send_command(msg)¶
- Send the encoded command and read the reply. - Parameters: - msg : str
- The string command to be sent. 
 
- msg : 
 - 
set_mask(mask: str)¶
- This sets the mask value - Parameters: - mask: str
- This is the name of the mask which is converted to an int using a dictionary. 
 - Returns: - None
 
 - 
set_mask_rotation(mask_rotation: float)¶
- This sets the mask rotation - Parameters: - mask_rotation: float
- The mask_rotation value that will be sent. 
 - Returns: - None
 
 - 
set_park()¶
- Park the CBP - Returns: - None
 
 - 
set_simulation_mode(simulation_mode)¶
 - 
set_unpark()¶
- Unpark the CBP. 
 
- log :