Skip to content

Commit

Permalink
Add the iOptron HAE16 mount class.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgee committed Feb 14, 2025
1 parent 13523c3 commit 93a52a1
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/panoptes/pocs/mount/ioptron/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

class MountInfo(IntEnum):
"""The return type given by the MountInfo command to identify the mount."""
HAE16 = 12
CEM25 = 25
CEM26 = 26
CEM26EC = 27
Expand Down
47 changes: 47 additions & 0 deletions src/panoptes/pocs/mount/ioptron/hae16.py
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

0 comments on commit 93a52a1

Please sign in to comment.