Skip to content

Commit

Permalink
Driver Templates - Fix Telescope.SiderealTime bugs introduced in prev…
Browse files Browse the repository at this point in the history
…ious 2 commits
  • Loading branch information
Peter-Simpson committed Aug 24, 2018
1 parent d545a72 commit 1e246af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Expand Up @@ -7,12 +7,11 @@
using ASCOM;
using ASCOM.Utilities;
using ASCOM.Astrometry.AstroUtils;
using ASCOM.Astrometry.NOVAS;

class DeviceTelescope
{
Util utilities = new Util();
AstroUtils astroUtils = new AstroUtils();
AstroUtils astroUtilities = new AstroUtils();

TraceLogger tl = new TraceLogger();

Expand Down Expand Up @@ -424,7 +423,7 @@ public double SiderealTime
{
// Now using NOVAS 3.1
double siderealTime = 0.0;
using (var novas = new NOVAS31())
using (var novas = new ASCOM.Astrometry.NOVAS.NOVAS31())
{
var jd = utilities.DateUTCToJulian(DateTime.UtcNow);
novas.SiderealTime(jd, 0, novas.DeltaT(jd),
Expand All @@ -437,7 +436,7 @@ public double SiderealTime
siderealTime += SiteLongitude / 360.0 * 24.0;

// Reduce to the range 0 to 24 hours
siderealTime = astroUtils.ConditionRA(siderealTime);
siderealTime = astroUtilities.ConditionRA(siderealTime);

tl.LogMessage("SiderealTime", "Get - " + siderealTime.ToString());
return siderealTime;
Expand Down
Expand Up @@ -6,12 +6,11 @@ Imports ASCOM.DeviceInterface
Imports ASCOM
Imports ASCOM.Utilities
Imports ASCOM.Astrometry.AstroUtils
Imports ASCOM.Astrometry.NOVAS

Class DeviceTelescope
Implements ITelescopeV3
Private utilities As New Util()
Private aUtils As New AstroUtils()
Private astroUtilities As New AstroUtils()
Private TL As New TraceLogger()

#Region "ITelescope Implementation"
Expand Down Expand Up @@ -340,7 +339,7 @@ Class DeviceTelescope
Get
' now using novas 3.1
Dim lst As Double = 0.0
Using novas As New NOVAS31
Using novas As New ASCOM.Astrometry.NOVAS.NOVAS31
Dim jd As Double = utilities.DateUTCToJulian(DateTime.UtcNow)
novas.SiderealTime(jd, 0, novas.DeltaT(jd),
Astrometry.GstType.GreenwichMeanSiderealTime,
Expand All @@ -353,7 +352,7 @@ Class DeviceTelescope
lst += SiteLongitude / 360.0 * 24.0

' Reduce to the range 0 to 24 hours
lst = aUtils.ConditionRA(lst)
lst = astroUtilities.ConditionRA(lst)

TL.LogMessage("SiderealTime", "Get - " & lst.ToString())
Return lst
Expand Down

0 comments on commit 1e246af

Please sign in to comment.