public void RawTransformTest() { using (AscomTools _AscomTools = new AscomTools()) { double siteLongitude = -1.333333; double siteLatitude = 52.666667; _AscomTools.Transform.SiteLatitude = siteLatitude; _AscomTools.Transform.SiteLongitude = siteLongitude; _AscomTools.Transform.SiteElevation = 192; DateTime testTime = new DateTime(2019, 1, 18, 21, 11, 00); double lst = AstroConvert.LocalApparentSiderealTime(siteLongitude, testTime); _AscomTools.Transform.SetAzimuthElevation(0.0, siteLatitude); _AscomTools.Transform.JulianDateTT = _AscomTools.Util.DateLocalToJulian(testTime); double ra = _AscomTools.Transform.RATopocentric; double dec = _AscomTools.Transform.DECTopocentric; double alt = _AscomTools.Transform.ElevationTopocentric; double az = _AscomTools.Transform.AzimuthTopocentric; double lstExpected = 4.95996448153762; double raExpected = 10.9439120745406; double decExpected = 89.9999999983757; double azExpected = 8.03515690758855E-09; double altExpected = 52.6666669999972; Assert.AreEqual(lstExpected, lst, 0.001, "LST test failed"); Assert.AreEqual(raExpected, ra, 0.0001, "RA test failed"); Assert.AreEqual(decExpected, dec, 0.0001, "Dec test failed"); Assert.AreEqual(azExpected, az, 0.0001, "Az test failed"); Assert.AreEqual(altExpected, alt, 0.0001, "Alt test failed"); } }
public void Refresh(AscomTools tools, DateTime syncTime) { SyncTime = syncTime; LocalApparentSiderialTime = new HourAngle(AstroConvert.LocalApparentSiderealTime(tools.Transform.SiteLongitude, syncTime)); Equatorial = new EquatorialCoordinate(GetRA(ObservedAxes), GetDec(ObservedAxes)); UpdateAltAzimuth(tools, syncTime); }
public void MoveRADec(AxisPosition newAxisPosition, AscomTools tools, DateTime syncTime) { // double[] delta = ObservedAxes.GetDeltaTo(newAxisPosition); SyncTime = syncTime; LocalApparentSiderialTime = new HourAngle(AstroConvert.LocalApparentSiderealTime(tools.Transform.SiteLongitude, syncTime)); // Apply the axis rotation to the new position. ObservedAxes = newAxisPosition; Equatorial = new EquatorialCoordinate(GetRA(ObservedAxes), GetDec(ObservedAxes)); UpdateAltAzimuth(tools, syncTime); }
public MountCoordinate(EquatorialCoordinate equatorial, AxisPosition axisPosition, AscomTools tools, DateTime syncTime) { ObservedAxes = axisPosition; SyncTime = syncTime; LocalApparentSiderialTime = new HourAngle(AstroConvert.LocalApparentSiderealTime(tools.Transform.SiteLongitude, syncTime)); if (tools.Transform.SiteLatitude < 0.0) { Hemisphere = HemisphereOption.Southern; } Equatorial = equatorial; this.UpdateAltAzimuth(tools, syncTime); }
public void TestingHA() { double ra = 0.0; double ha = 0.0; HourAngle lst = new HourAngle(AstroConvert.LocalApparentSiderealTime(_Tools.Transform.SiteLongitude, _Now)); System.Diagnostics.Debug.WriteLine($"LST = {lst.Value}"); System.Diagnostics.Debug.WriteLine("\tRA\t\t\tHA"); System.Diagnostics.Debug.WriteLine("\t==\t\t\t=="); for (int i = 0; i < 24; i++) { ra = i * 1.0; ha = AstroConvert.RangeHA(ra - lst); System.Diagnostics.Debug.WriteLine($"\t{ra}\t\t{ha}"); } Assert.IsTrue(true); }