Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
telescope
Commits
07cc1678
Commit
07cc1678
authored
Jan 23, 2018
by
Tammo Jan Dijkema
Browse files
Fix for python2
parent
9dc97bb7
Changes
1
Show whitespace changes
Inline
Side-by-side
telescope.py
View file @
07cc1678
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment