CBPComponent¶
-
class
lsst.ts.cbp.
CBPComponent
(csc)¶ 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.
- Parameters
- csc
CBPCSC
The running CSC for the CBP.
- csc
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
- csc
CBPCSC
- log
logging.Logger
- reader
asyncio.StreamReader
orNone
- writer
asyncio.StreamWriter
orNone
- lock
asyncio.Lock
- timeout
int
- long_timeout
int
- host
str
- port
int
- connected
bool
- error_tolerance
float
- csc
Attributes Summary
Return autoparked value.
Return azimuth value.
Return elevation value.
Return focus value.
Return inPosition event data.
Return mask value.
Return mask rotation value.
Return parked value.
Return status telemetry data.
Return target event data.
Methods Summary
assert_in_range
(name, value, min_value, …)Raise ValueError if a value is out of range.
change_focus
(position)Change focus.
Read and record the status of the encoders.
Get the park variable from CBP.
configure
(config)Configure the CBP.
connect
()Create a socket and connect to the CBP’s static address and designated port.
Disconnect from the tcp socket.
Generate initial mask info.
Get the azimuth value.
Get the position data of the CBP.
Read and record the mount elevation encoder, in degrees.
Get the focus value.
get_mask
()Get mask and mask rotation value.
move_azimuth
(position)Move the azimuth encoder.
move_elevation
(position)Move the elevation encoder.
send_command
(msg)Send the encoded command and read the reply.
set_mask
(mask)Set the mask value
set_mask_rotation
(mask_rotation)Set the mask rotation
set_park
()Park the CBP.
Unpark the CBP.
Update the in position status of each actuator, based on the most recently read encoder data.
Update the status.
Attributes Documentation
-
auto_parked
¶ Return autoparked value.
-
azimuth
¶ Return azimuth value.
-
elevation
¶ Return elevation value.
-
focus
¶ Return focus value.
-
in_position
¶ Return inPosition event data.
-
mask
¶ Return mask value.
-
mask_rotation
¶ Return mask rotation value.
-
parked
¶ Return parked value.
-
status
¶ Return status telemetry data.
-
target
¶ Return target event data.
Methods Documentation
-
assert_in_range
(name, value, min_value, max_value)¶ Raise ValueError if a value is out of range.
-
async
change_focus
(position: int)¶ Change focus.
- Parameters
- position
int
The value of the new focus (microns).
- position
- Raises
- ValueError
Raised when the new value falls outside the accepted range.
-
async
check_cbp_status
()¶ Read and record the status of the encoders.
-
async
check_park
()¶ Get the park variable from CBP.
-
configure
(config)¶ Configure the CBP.
- Parameters
- config
types.SimpleNamespace
- config
-
async
connect
()¶ Create a socket and connect to the CBP’s static address and designated port.
-
async
disconnect
()¶ Disconnect from the tcp socket.
Safe to call even if already disconnected.
-
generate_mask_info
()¶ Generate initial mask info.
-
async
get_azimuth
()¶ Get the azimuth value.
-
async
get_cbp_telemetry
()¶ Get the position data of the CBP.
-
async
get_elevation
()¶ Read and record the mount elevation encoder, in degrees.
Note that the low-level controller calls this axis “altitude”.
-
async
get_focus
()¶ Get the focus value.
-
async
get_mask
()¶ Get mask and mask rotation value.
-
async
move_azimuth
(position: float)¶ Move the azimuth encoder.
- Parameters
- position
float
The desired azimuth (degrees).
- position
- Raises
- ValueError
Raised when the new value falls outside the accepted range.
-
async
move_elevation
(position: float)¶ Move the elevation encoder.
- Parameters
- position
float
The desired elevation (degrees)
- position
- Raises
- ValueError
Raised when the new value falls outside the accepted range.
-
async
send_command
(msg)¶ Send the encoded command and read the reply.
-
async
set_mask
(mask: str)¶ Set the mask value
- Parameters
- mask
str
This is the name of the mask which is converted to an int using a dictionary.
- mask
- Raises
- KeyError
Raised when new mask is not a key in the dictionary.
-
async
set_mask_rotation
(mask_rotation: float)¶ Set the mask rotation
- Parameters
- mask_rotation
float
The mask_rotation value that will be sent.
- mask_rotation
- Raises
- ValueError
Raised when the new value falls outside the accepted range.
-
async
set_park
()¶ Park the CBP.
-
async
set_unpark
()¶ Unpark the CBP.
-
update_in_position
()¶ Update the in position status of each actuator, based on the most recently read encoder data.
- Returns
- did_change
bool
True if anything changed (and so the event was published)
- did_change
-
async
update_status
()¶ Update the status.