public static SpaceCutout SpaceCutout() { SpaceCutout cutout = new SpaceCutout(); cutout.ImageOne = new System.Windows.Media.Imaging.BitmapImage(); return(cutout); }
public async Task <SpaceCutout> GetSpaceCutout(SpaceNavigation location) { double plateScale = 1.75; double ra = Math.Round(location.Center.RightAscension, 3); double dec = Math.Round(location.Center.Declination, 3); SpaceCutout cutout = new SpaceCutout(); if (DECALSIsResponding) { using (WebResponse response = await FetchDECALSCutout(ra, dec, plateScale)) if (response != null) { double RaStep = (location.RaRange / 3) + (location.RaRange * 0.049); double leftRA = Math.Round(location.Center.RightAscension + RaStep, 3); double rightRA = Math.Round(location.Center.RightAscension - RaStep, 3); cutout.ImageOne = BitmapFromUrl(response.ResponseUri.ToString()); cutout.ImageTwo = BitmapFromUrl(DECaLSEndpoint(plateScale, dec, leftRA)); cutout.ImageThree = BitmapFromUrl(DECaLSEndpoint(plateScale, dec, rightRA)); } } if (SDSSIsResponding && cutout.ImageOne == null) { using (WebResponse response = await FetchSDSSCutout(ra, dec, plateScale)) if (response != null) { cutout.ImageOne = BitmapFromUrl(response.ResponseUri.ToString()); } } if (cutout.ImageOne == null) { GlobalData.GetInstance().Logger?.AddEntry("Cutout_Services_Down"); cutout.ImageOne = BitmapFromUrl("pack://application:,,,/Images/General/star-bg.jpg"); } return(cutout); }