private void InitializeRADecFilters() { RAFrom = new AsyncObservableCollection <KeyValuePair <double?, string> >(); RAThrough = new AsyncObservableCollection <KeyValuePair <double?, string> >(); DecFrom = new AsyncObservableCollection <KeyValuePair <double?, string> >(); DecThrough = new AsyncObservableCollection <KeyValuePair <double?, string> >(); RAFrom.Add(new KeyValuePair <double?, string>(null, string.Empty)); RAThrough.Add(new KeyValuePair <double?, string>(null, string.Empty)); DecFrom.Add(new KeyValuePair <double?, string>(null, string.Empty)); DecThrough.Add(new KeyValuePair <double?, string>(null, string.Empty)); for (int i = 0; i < 25; i++) { Astrometry.HoursToDegrees(i); RAFrom.Add(new KeyValuePair <double?, string>(Astrometry.HoursToDegrees(i), i.ToString())); RAThrough.Add(new KeyValuePair <double?, string>(Astrometry.HoursToDegrees(i), i.ToString())); } for (int i = -90; i < 91; i = i + 5) { DecFrom.Add(new KeyValuePair <double?, string>(i, i.ToString())); DecThrough.Add(new KeyValuePair <double?, string>(i, i.ToString())); } }
public void HoursToDegree_ValueTest() { var hours = 5.2; var expecteddeg = 78; var deg = Astrometry.HoursToDegrees(hours); Assert.AreEqual(expecteddeg, deg); }
public void Create_RAHoursTest(double ra, double dec) { var epoch = Epoch.JNOW; var coordinates = new Coordinates(ra, dec, epoch, Coordinates.RAType.Hours); Assert.AreEqual(ra, coordinates.RA, 0.0001); Assert.AreEqual(Astrometry.HoursToDegrees(ra), coordinates.RADegrees, 0.0001); Assert.AreEqual(dec, coordinates.Dec, 0.0001); Assert.AreEqual(epoch, coordinates.Epoch); }
public void CreateByHoursTest(double inputHours) { var angle = Angle.ByHours(inputHours); var expectedDegree = Astrometry.HoursToDegrees(inputHours); var expectedArcmin = Astrometry.DegreeToArcmin(expectedDegree); var expectedArcsec = Astrometry.DegreeToArcsec(expectedDegree); var expectedRadian = Astrometry.ToRadians(expectedDegree); Assert.AreEqual(inputHours, angle.Hours, TOLERANCE); Assert.AreEqual(expectedRadian, angle.Radians, TOLERANCE); Assert.AreEqual(expectedDegree, angle.Degree, TOLERANCE); Assert.AreEqual(expectedArcmin, angle.ArcMinutes, TOLERANCE); Assert.AreEqual(expectedArcsec, angle.ArcSeconds, TOLERANCE); }
private void CalculateAltitude() { var start = this._referenceDate; Altitudes.Clear(); var siderealTime = Astrometry.GetLocalSiderealTime(start, _longitude); var hourAngle = Astrometry.GetHourAngle(siderealTime, this.Coordinates.RA); for (double angle = hourAngle; angle < hourAngle + 24; angle += 0.1) { var degAngle = Astrometry.HoursToDegrees(angle); var altitude = Astrometry.GetAltitude(degAngle, _latitude, this.Coordinates.Dec); Altitudes.Add(new DataPoint(DateTimeAxis.ToDouble(start), altitude)); start = start.AddHours(0.1); } MaxAltitude = Altitudes.OrderByDescending((x) => x.Y).FirstOrDefault(); CalculateTransit(_latitude); }