Commit 07cc1678 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Fix for python2

parent 9dc97bb7
...@@ -160,7 +160,7 @@ class telescope(): ...@@ -160,7 +160,7 @@ class telescope():
(ra, dec) = setpoint.to_string('hmsdms').split() (ra, dec) = setpoint.to_string('hmsdms').split()
cmd = bytes('{:s}\t{:s}\n'.format(ra, dec.strip('+')), 'UTF-8') cmd = '{:s}\t{:s}\n'.format(ra, dec.strip('+')).encode('UTF-8')
logging.info('J2000 setpoint sent to DT: {}'.format(cmd)) logging.info('J2000 setpoint sent to DT: {}'.format(cmd))
self._outsocket.send(cmd) self._outsocket.send(cmd)
...@@ -180,7 +180,7 @@ class telescope(): ...@@ -180,7 +180,7 @@ class telescope():
if isinstance(el, u.Quantity): if isinstance(el, u.Quantity):
el = el.to(u.deg).value el = el.to(u.deg).value
cmd = bytes('{:f}\t{:f}\n'.format(az, el), 'UTF-8') cmd = '{:f}\t{:f}\n'.format(az, el).encode('UTF-8')
logging.info('AzEl sent to DT: {}'.format(cmd)) logging.info('AzEl sent to DT: {}'.format(cmd))
self._outsocket.send(cmd) self._outsocket.send(cmd)
...@@ -203,7 +203,7 @@ class telescope(): ...@@ -203,7 +203,7 @@ class telescope():
else: else:
off_el = np.deg2rad(off_el) off_el = np.deg2rad(off_el)
cmd = bytes('{:f}\t{:f}\n'.format(off_az, off_el), 'UTF-8') cmd = '{:f}\t{:f}\n'.format(off_az, off_el).encode('UTF-8')
logging.info('Offset sent to DT: {}'.format(cmd)) logging.info('Offset sent to DT: {}'.format(cmd))
self._offsetsocket.send(cmd) self._offsetsocket.send(cmd)
......
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