public void TestGetRasterCoordinate() { DateTime start = new DateTime(2018, 10, 30, 12, 0, 0); DateTime end = new DateTime(2018, 10, 30, 13, 0, 0); var appt = new Appointment(); appt.start_time = start; appt.end_time = end; appt.Coordinates = new List <Coordinate>(); var coord_1 = new Coordinate(12, 12); var coord_2 = new Coordinate(15, 15); appt.Coordinates.Add(coord_1); appt.Coordinates.Add(coord_2); Coordinate output_coord_1 = CoordinateCalculationController.GetRasterCoordinate(appt, start); Coordinate output_coord_2 = CoordinateCalculationController.GetRasterCoordinate(appt, end); Assert.AreEqual(coord_1.RightAscension, output_coord_1.RightAscension, 0.05); Assert.AreEqual(coord_1.Declination, output_coord_1.Declination, 0.05); Assert.IsTrue(coord_2.RightAscension > output_coord_2.RightAscension); Assert.IsTrue(coord_2.Declination > output_coord_2.Declination); }
public void TestGetRasterOrientation() { DateTime start = new DateTime(2018, 10, 30, 12, 0, 0); DateTime end = new DateTime(2018, 10, 30, 13, 0, 0); var appt = new Appointment(); appt.start_time = start; appt.end_time = end; appt.Coordinates = new List <Coordinate>(); var coord_1 = new Coordinate(12, 12); var coord_2 = new Coordinate(15, 15); appt.Coordinates.Add(coord_1); appt.Coordinates.Add(coord_2); Coordinate output_coord_1 = CoordinateCalculationController.GetRasterCoordinate(appt, start); Orientation output_orientation_1 = CoordinateCalculationController.CoordinateToOrientation(output_coord_1, start); Coordinate output_coord_2 = CoordinateCalculationController.GetRasterCoordinate(appt, end); Orientation output_orientation_2 = CoordinateCalculationController.CoordinateToOrientation(output_coord_2, end); Assert.AreEqual(46.41, output_orientation_1.Elevation, 0.05); Assert.AreEqual(119.24, output_orientation_1.Azimuth, 0.05); Assert.AreEqual(31.04, output_orientation_2.Elevation, 0.05); Assert.AreEqual(97, output_orientation_2.Azimuth, 0.05); }