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
440f64c3
Commit
440f64c3
authored
Oct 08, 2017
by
Tammo Jan Dijkema
Browse files
Handle invalid setpoints, fix typo in exception
parent
5b77f664
Changes
1
Hide whitespace changes
Inline
Side-by-side
__init__.py
View file @
440f64c3
...
...
@@ -2,7 +2,7 @@ from __future__ import print_function
import
socket
import
logging
from
astropy.coordinates
import
SkyCoord
,
AltAz
from
astropy.coordinates
import
SkyCoord
,
AltAz
,
RangeError
from
astropy
import
units
as
u
from
configparser
import
ConfigParser
import
os.path
...
...
@@ -23,7 +23,7 @@ class telescope():
'J2000' or 'AZEL'.
'''
if
setmode
not
in
(
'J2000'
,
'AZEL'
,
None
):
raise
ValueError
(
"Mode must be None, 'J2000' or 'AZEL', not "
+
mode
)
raise
ValueError
(
"Mode must be None, 'J2000' or 'AZEL', not "
+
set
mode
)
self
.
setmode
=
setmode
if
consoleHost
is
None
:
...
...
@@ -101,7 +101,11 @@ class telescope():
(
ra
,
dec
)
=
(
vals
[
2
],
vals
[
3
])
self
.
radec
=
SkyCoord
(
ra
,
dec
,
frame
=
'icrs'
)
(
setpoint_ra
,
setpoint_dec
)
=
(
vals
[
0
],
vals
[
1
])
self
.
setpoint_radec
=
SkyCoord
(
setpoint_ra
,
setpoint_dec
,
frame
=
'icrs'
)
try
:
# The setpoint can be invalid
self
.
setpoint_radec
=
SkyCoord
(
setpoint_ra
,
setpoint_dec
,
frame
=
'icrs'
)
except
RangeError
:
self
.
setpoint_radec
=
None
self
.
_event_j2000
.
set
()
def
_readtraces
(
self
,
tracehost
,
traceport
):
...
...
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