CBPComponent#
- class lsst.ts.cbp.CBPComponent(csc, log=None)#
Bases:
objectThis 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.log (
Noneorlogging.Logger) – Optionally, the DDS logger can be passed to this class to publish log messages over DDS.
- log#
- Type:
- reader#
- Type:
- writer#
- Type:
- lock#
- Type:
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 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[, log, await_reply, ...])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.
- connected#
- 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.
- should_be_connected#
- 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.
- Parameters:
- Raises:
ValueError – Raised when a value is outside of the given range.
- async change_focus(position)#
Change focus.
- Parameters:
position (
int) – The value of the new focus (microns).- 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)
- 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)#
Move the azimuth encoder.
- Parameters:
position (
float) – The desired azimuth (degrees).- Raises:
ValueError – Raised when the new value falls outside the accepted range.
- async move_elevation(position)#
Move the elevation encoder.
- Parameters:
position (
float) – The desired elevation (degrees)- Raises:
ValueError – Raised when the new value falls outside the accepted range.
- async send_command(msg, log=True, await_reply=True, await_terminator=True)#
Send the encoded command and read the reply.
- Parameters:
msg (
str) – The string command to be sent.log (
bool) – Call with False to suppress log messages. Useful for debugging purposes to limit output.await_reply (
bool) – If false, don’t wait for reply else wait for reply.await_terminator (
bool) – If false, reply has no terminator else reply has expected terminator.
- Returns:
reply – The reply to the command sent.
- Return type:
- async set_mask(mask)#
Set the mask value
- async set_mask_rotation(mask_rotation)#
Set the mask rotation
- Parameters:
mask_rotation (
float) – The mask_rotation value that will be sent.- Raises:
ValueError – Raised when the new value falls outside the accepted range.
- async set_park()#
Park the CBP.
- async set_unpark()#
Unpark the CBP.
- async update_in_position()#
Update the in position status of each actuator, based on the most recently read encoder data.
- Returns:
did_change – True if anything changed (and so the event was published)
- Return type:
- async update_status()#
Update the status.