From ece822bc570dc9806b652dc4c422dc648893d29d Mon Sep 17 00:00:00 2001 From: Wilfred Tyler Gee Date: Fri, 10 Nov 2023 12:13:53 -1000 Subject: [PATCH] Dealing with dumb older RA millisecond values. --- src/panoptes/pocs/mount/ioptron/base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/panoptes/pocs/mount/ioptron/base.py b/src/panoptes/pocs/mount/ioptron/base.py index eea9db110..d05f9e05f 100644 --- a/src/panoptes/pocs/mount/ioptron/base.py +++ b/src/panoptes/pocs/mount/ioptron/base.py @@ -259,7 +259,12 @@ def _mount_coord_to_skycoord(self, mount_coords): def _skycoord_to_mount_coord(self, coords): """ Converts between SkyCoord and a iOptron RA/Dec format. """ - ra_coord = coords.ra.to(self._ra_coords_units).value + # Do some special handling of older firmware that had RA coords in a time unit. + if self._ra_coords_units == 'millisecond': + ra_coord = (coords.ra.to(u.hourangle).value * u.hour).to(self._ra_coords_units).value + else: + ra_coord = coords.ra.to(self._ra_coords_units).value + dec_coord = coords.dec.to(self._dec_coords_units).value ra_mount = self._ra_format.format(ra_coord)