public async Task <DeepSkyObject> GetTarget() { string route = "/api/objects/info?format=json"; var request = new HttpGetRequest(this.baseUrl + route); try { var response = await request.Request(new CancellationToken()); if (string.IsNullOrEmpty(response)) { return(await GetView()); } var jobj = JObject.Parse(response); var status = jobj.ToObject <StellariumObject>(); var ra = Astrometry.EuclidianModulus(status.RightAscension, 360); var dec = status.Declination; var coordinates = new Coordinates(Angle.ByDegree(ra), Angle.ByDegree(dec), Epoch.J2000); var dso = new DeepSkyObject(status.Name, coordinates, string.Empty); return(dso); } catch (Exception ex) { Logger.Error(ex); throw ex; } }
public void GetEuclidianModulus(double x, double y, double expected) { var modulus = Astrometry.EuclidianModulus(x, y); Assert.AreEqual(expected, modulus, MODULUS_TOLERANCE); }
public void GetEuclidianModulus(float x, float y, float expected) { var modulus = Astrometry.EuclidianModulus(x, y); Assert.AreEqual(expected, modulus, MODULUS_TOLERANCE); }