-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import time | ||
|
||
from panoptes.pocs.mount.ioptron.base import Mount as BaseMount | ||
|
||
|
||
class Mount(BaseMount): | ||
|
||
def __init__(self, location, mount_version='0012', *args, **kwargs): | ||
self._mount_version = mount_version | ||
super(Mount, self).__init__(location, *args, **kwargs) | ||
self.logger.success('iOptron HAE16 mount created') | ||
|
||
def search_for_home(self): | ||
"""Search for the home position. | ||
This method uses the internal homing pin on the HAE16 mount to return the | ||
mount to the home (or zero) position. | ||
""" | ||
self.logger.info('Searching for the home position.') | ||
self.query('search_for_home') | ||
while self.is_home is False: | ||
time.sleep(1) | ||
self.update_status() | ||
|
||
def set_target_coordinates(self, *args, **kwargs): | ||
"""After setting target coordinates, check number of positions. | ||
The HAE16 can determine if there are 0, 1, or 2 possible positions | ||
for the given RA/Dec, with the latter being the case for the meridian | ||
flip. | ||
""" | ||
target_set = super().set_target_coordinates(*args, **kwargs) | ||
self.logger.debug(f'Checking number of possible positions for {self._target_coordinates}') | ||
num_possible_positions = self.query('query_positions') | ||
self.logger.debug(f'Number of possible positions: {num_possible_positions}') | ||
|
||
if num_possible_positions == 0: | ||
self.logger.warning(f'No possible positions for {self._target_coordinates}') | ||
return False | ||
|
||
# TODO check if this is true with the HAE16. | ||
# There is currently a bug with with the HAE16 where it will reset the | ||
# target coordinates after querying the number of possible positions so | ||
# we need to set them again. | ||
target_set = super().set_target_coordinates(*args, **kwargs) | ||
|
||
return target_set |