Commit 7eeee4e3 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Add focusbox getter

parent ff3271e1
...@@ -45,6 +45,7 @@ class telescope(): ...@@ -45,6 +45,7 @@ class telescope():
self.radec = None self.radec = None
self.speed_az = None self.speed_az = None
self.speed_el = None self.speed_el = None
self.focusbox_pos = None
__num_instances += 1 __num_instances += 1
...@@ -138,6 +139,7 @@ class telescope(): ...@@ -138,6 +139,7 @@ class telescope():
self.dist_el = (float(vals[3])*u.rad).to(u.deg) self.dist_el = (float(vals[3])*u.rad).to(u.deg)
self.speed_az = float(vals[4]) self.speed_az = float(vals[4])
self.speed_el = float(vals[5]) self.speed_el = float(vals[5])
self.focusbox_pos = float(vals[6])
self._event_traces.set() self._event_traces.set()
def setRaDec(self, setpoint): def setRaDec(self, setpoint):
...@@ -203,6 +205,17 @@ class telescope(): ...@@ -203,6 +205,17 @@ class telescope():
logging.info('Offset sent to DT: {}'.format(cmd)) logging.info('Offset sent to DT: {}'.format(cmd))
self._offsetsocket.send(cmd) self._offsetsocket.send(cmd)
def getFocusboxPosition(self, waitForUpdate=False):
'''
Get the focusbox position. If waitForUpdate=True, it waits for the
next signal from the socket.
Returns an astropy quantity
'''
if waitForUpdate or self.focusbox_pos is None:
self._event_traces.clear()
self._event_traces.wait()
return self.focusbox_pos * 0.1 * u.m
def getAzEl(self, waitForUpdate=False): def getAzEl(self, waitForUpdate=False):
''' '''
Get azimut and elevation. If waitForUpdate=True, it waits for the Get azimut and elevation. If waitForUpdate=True, it waits for the
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment