From 1c2a978daee050f19b17b0c75e45d7d2d5c91119 Mon Sep 17 00:00:00 2001 From: Wilfred Gee Date: Fri, 19 Aug 2022 09:27:34 -1000 Subject: [PATCH] Update cem40 * fix the timestamp in the status call by parsing the date properly. * Set the default meridian treatment to flip at 15 deg past meridian (`015`) and not go below 30 degrees alt. --- src/panoptes/pocs/mount/ioptron/cem40.py | 8 ++++++-- src/panoptes/pocs/mount/serial.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/panoptes/pocs/mount/ioptron/cem40.py b/src/panoptes/pocs/mount/ioptron/cem40.py index 35d93c031..90ed7a935 100644 --- a/src/panoptes/pocs/mount/ioptron/cem40.py +++ b/src/panoptes/pocs/mount/ioptron/cem40.py @@ -5,6 +5,7 @@ from astropy import units as u from astropy.coordinates import SkyCoord +from dateutil.parser import parse as parse_date from panoptes.utils.time import current_time from panoptes.utils import error as error from panoptes.pocs.mount.serial import AbstractSerialMount @@ -188,7 +189,7 @@ def search_for_home(self): self.logger.info('Searching for the home position.') self.query('search_for_home') - def _set_initial_rates(self, alt_limit='+00', meridian_treatment='100'): + def _set_initial_rates(self, alt_limit='+30', meridian_treatment='015'): # Make sure we start at sidereal self.query('set_sidereal_tracking') @@ -354,7 +355,10 @@ def _update_status(self): self.state == MountState.TRACKING_PEC self._is_slewing = self.state == MountState.SLEWING - status['timestamp'] = self.query('get_local_time') + # Get offset in hours (as int) then parse rearranged time string. + ts = self.query('get_local_time') + offset = int(float(ts[:4]) / 60) + status['timestamp'] = parse_date(f'{ts[5:11]}T{ts[11:]}{offset}', yearfirst=True) status['tracking_rate_ra'] = self.tracking_rate return status diff --git a/src/panoptes/pocs/mount/serial.py b/src/panoptes/pocs/mount/serial.py index f43747b52..003528fb4 100644 --- a/src/panoptes/pocs/mount/serial.py +++ b/src/panoptes/pocs/mount/serial.py @@ -32,7 +32,7 @@ def __init__(self, location, *args, **kwargs): @property def _port(self): - return self.serial.ser.port + return self.serial.port def connect(self): """Connects to the mount via the serial port (`self._port`)