Exemple #1
0
        public void GetInfo(CelestialObjectInfo <Tycho2Star> info)
        {
            Tycho2Star s             = info.Body;
            SkyContext c             = info.Context;
            string     constellation = Constellations.FindConstellation(s.Equatorial, c.JulianDay);

            info
            .SetTitle(s.ToString())
            .SetSubtitle("Star")

            .AddRow("Constellation", constellation)

            .AddHeader("Equatorial coordinates (current epoch)")
            .AddRow("Equatorial.Alpha", c.Get(Equatorial, s).Alpha)
            .AddRow("Equatorial.Delta", c.Get(Equatorial, s).Delta)

            .AddHeader("Equatorial coordinates (J2000.0 epoch)")
            .AddRow("Equatorial0.Alpha", s.Equatorial0.Alpha)
            .AddRow("Equatorial0.Delta", s.Equatorial0.Delta)

            .AddHeader("Horizontal coordinates")
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader("Visibility")
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")

            .AddHeader("Properties")
            .AddRow("Magnitude", s.Magnitude);
        }
Exemple #2
0
        public void GetInfo(CelestialObjectInfo <Tycho2Star> info)
        {
            Tycho2Star s             = info.Body;
            SkyContext c             = info.Context;
            string     constellation = Constellations.FindConstellation(s.Equatorial, c.JulianDay);

            info
            .SetTitle(s.ToString())
            .SetSubtitle(Text.Get("Tycho2Star.Subtitle"))

            .AddRow("Constellation", constellation)

            .AddHeader(Text.Get("Tycho2Star.Equatorial"))
            .AddRow("Equatorial.Alpha", c.Get(Equatorial, s).Alpha)
            .AddRow("Equatorial.Delta", c.Get(Equatorial, s).Delta)

            .AddHeader(Text.Get("Tycho2Star.Equatorial0"))
            .AddRow("Equatorial0.Alpha", s.Equatorial0.Alpha)
            .AddRow("Equatorial0.Delta", s.Equatorial0.Delta)

            .AddHeader(Text.Get("Tycho2Star.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("Tycho2Star.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")

            .AddHeader(Text.Get("Tycho2Star.Properties"))
            .AddRow("Magnitude", s.Magnitude);
        }
        /// <summary>
        /// Extension method for parsing trajectory.
        /// </summary>
        /// <param name="trajectoryNode">Node with trajectory</param>
        /// <returns>Trajectory from xml.</returns>
        public static CelestialObjectInfo ParseDetails(this XmlNode detailsNode)
        {
            CelestialObjectInfo details = new CelestialObjectInfo();

            foreach (XmlNode childNode in detailsNode.ChildNodes)
            {
                //Console.WriteLine(childNode.InnerText.ToString());
                switch (childNode.Name.ToLowerInvariant())
                {
                case "gravity":
                    details.Gravity = Double.Parse(childNode.InnerText, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture);
                    //Console.WriteLine("parsed gravity:{1} to {0}", details.Gravity, childNode.InnerText);
                    break;

                case "mass":
                    details.Mass = Double.Parse(childNode.InnerText, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture);
                    //Console.WriteLine("parsed mass:{1} to {0}", details.Mass, childNode.InnerText);
                    break;

                case "description":
                    details.Description = childNode.InnerText.Trim();
                    //Console.WriteLine("parsed desc:{1} to {0}", details.Description, childNode.InnerText.Trim());
                    break;

                default:
                    throw new XmlException("Unexpected detail of celestial object.");
                }
            }
            return(details);
        }
        public void GetInfo(CelestialObjectInfo <JupiterMoon> info)
        {
            info
            .SetSubtitle(Text.Get("Satellite.Subtitle", ("planetName", Text.Get($"Planet.5.GenitiveName"))))
            .SetTitle(info.Body.Names.First())

            .AddRow("Constellation")

            .AddHeader(Text.Get("JupiterMoon.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("JupiterMoon.Equatorial"))
            .AddRow("Equatorial.Alpha")
            .AddRow("Equatorial.Delta")

            .AddHeader(Text.Get("JupiterMoon.Rectangular"))
            .AddRow("Rectangular.X")
            .AddRow("Rectangular.Y")
            .AddRow("Rectangular.Z")

            .AddHeader(Text.Get("JupiterMoon.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")

            .AddHeader(Text.Get("JupiterMoon.Appearance"))
            .AddRow("Phase")
            .AddRow("PhaseAngle")
            .AddRow("Magnitude")
            .AddRow("AngularDiameter")
            .AddRow("Appearance.CM");
        }
Exemple #5
0
 public ObjectInfoVM(CelestialObjectInfo info)
 {
     Title = info.Title;
     Subtitle = info.Subtitle;
     InfoElements = info.InfoElements;
     LinkClickedCommand = new Command<double>(SelectJulianDay);
     CloseCommand = new Command(Close);
 }
Exemple #6
0
        public void GetInfo(CelestialObjectInfo <Moon> info)
        {
            var c = info.Context;

            info.SetTitle(info.Body.Name)

            .AddRow("Constellation")

            .AddHeader(Text.Get("Moon.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("Moon.Equatorial"))
            .AddRow("Equatorial.Alpha")
            .AddRow("Equatorial.Delta")

            .AddHeader(Text.Get("Moon.Equatorial0"))
            .AddRow("Equatorial0.Alpha")
            .AddRow("Equatorial0.Delta")

            .AddHeader(Text.Get("Moon.Ecliptical"))
            .AddRow("Ecliptical.Lambda")
            .AddRow("Ecliptical.Beta")

            .AddHeader(Text.Get("Moon.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")
            .AddRow("RTS.RiseAzimuth")
            .AddRow("RTS.TransitAltitude")
            .AddRow("RTS.SetAzimuth")

            .AddHeader(Text.Get("Moon.Appearance"))
            .AddRow("Phase")
            .AddRow("PhaseAngle")
            .AddRow("Age")
            .AddRow("Magnitude")
            .AddRow("Distance")
            .AddRow("HorizontalParallax")
            .AddRow("AngularDiameter")
            .AddRow("Libration.Latitude")
            .AddRow("Libration.Longitude")

            .AddHeader(Text.Get("Moon.Phases"))
            .AddRow("Phases.NewMoon", c.Get(NearestPhase, MoonPhase.NewMoon), Formatters.DateTime)
            .AddRow("Phases.FirstQuarter", c.Get(NearestPhase, MoonPhase.FirstQuarter), Formatters.DateTime)
            .AddRow("Phases.FullMoon", c.Get(NearestPhase, MoonPhase.FullMoon), Formatters.DateTime)
            .AddRow("Phases.LastQuarter", c.Get(NearestPhase, MoonPhase.LastQuarter), Formatters.DateTime)

            .AddHeader(Text.Get("Moon.Apsis"))
            .AddRow("Apsis.Apogee", c.Get(NearestApsis, MoonApsis.Apogee), Formatters.DateTime)
            .AddRow("Apsis.Perigee", c.Get(NearestApsis, MoonApsis.Perigee), Formatters.DateTime)

            .AddHeader(Text.Get("Moon.MaxDeclinations"))
            .AddRow("MaxDeclinations.North", c.Get(NearestMaxDeclination, MoonDeclination.North), Formatters.DateTime)
            .AddRow("MaxDeclinations.South", c.Get(NearestMaxDeclination, MoonDeclination.South), Formatters.DateTime);
        }
        /// <summary>
        /// Extension method for parsing star.
        /// </summary>
        /// <param name="starNode">Node with a star</param>
        /// <param name="starSystem">Star system where the star belongs to.</param>
        /// <returns>Star from xml.</returns>
        public static Star ParseStar(this XmlNode starNode, StarSystem starSystem)
        {
            String name    = starNode.Attributes["name"].Value;
            String altName = (starNode.Attributes["altName"] != null) ? starNode.Attributes["altName"].Value : "";
            CelestialObjectInfo details    = starNode.LastChild.ParseDetails();
            Trajectory          trajectory = starNode.FirstChild.ParseTrajectory();

            Star star = new Star(name, altName, details, starSystem, trajectory);

            return(star);
        }
Exemple #8
0
        public void GetInfo(CelestialObjectInfo <Comet> info)
        {
            info
            .SetTitle(info.Body.Names.First())
            .SetSubtitle(Text.Get("Comet.Type"))

            .AddRow("Constellation")

            .AddHeader(Text.Get("Comet.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("Comet.Equatorial"))
            .AddRow("Equatorial.Alpha")
            .AddRow("Equatorial.Delta")

            .AddHeader(Text.Get("Comet.EquatorialG"))
            .AddRow("EquatorialG.Alpha")
            .AddRow("EquatorialG.Delta")

            .AddHeader(Text.Get("Comet.Equatorial0T"))
            .AddRow("Equatorial0T.Alpha")
            .AddRow("Equatorial0T.Delta")

            .AddHeader(Text.Get("Comet.Equatorial0"))
            .AddRow("Equatorial0.Alpha")
            .AddRow("Equatorial0.Delta")

            .AddHeader(Text.Get("Comet.Ecliptical"))
            .AddRow("Ecliptical.Lambda")
            .AddRow("Ecliptical.Beta")

            .AddHeader(Text.Get("Comet.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")

            .AddHeader(Text.Get("Comet.Visibility"))
            .AddRow("Visibility.Begin")
            .AddRow("Visibility.End")
            .AddRow("Visibility.Duration")
            .AddRow("Visibility.Period")

            .AddHeader(Text.Get("Comet.Appearance"))
            .AddRow("AngularDiameter")
            .AddRow("Magnitude")
            .AddRow("DistanceFromEarth")
            .AddRow("DistanceFromSun")
            .AddRow("HorizontalParallax");
        }
Exemple #9
0
        public void GetInfo(CelestialObjectInfo <Star> info)
        {
            Star        s       = info.Body;
            SkyContext  c       = info.Context;
            StarDetails details = c.Get(ReadStarDetails, s.Number);

            info
            .SetTitle(string.Join(", ", s.Names))
            .SetSubtitle(Text.Get("Star.Type"))

            .AddRow("Constellation", Constellations.FindConstellation(c.Get(Equatorial, s.Number), c.JulianDay))

            .AddHeader(Text.Get("Star.Equatorial"))
            .AddRow("Equatorial.Alpha", c.Get(Equatorial, s.Number).Alpha)
            .AddRow("Equatorial.Delta", c.Get(Equatorial, s.Number).Delta)

            .AddHeader(Text.Get("Star.Equatorial0"))
            .AddRow("Equatorial0.Alpha", s.Equatorial0.Alpha)
            .AddRow("Equatorial0.Delta", s.Equatorial0.Delta)

            .AddHeader(Text.Get("Star.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("Star.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")

            .AddHeader(Text.Get("Star.Visibility"))
            .AddRow("Visibility.Begin")
            .AddRow("Visibility.End")
            .AddRow("Visibility.Duration")
            .AddRow("Visibility.Period")

            .AddHeader(Text.Get("Star.Properties"))
            .AddRow("Magnitude", s.Mag)
            .AddRow("IsInfraredSource", details.IsInfraredSource)
            .AddRow("SpectralClass", details.SpectralClass);

            if (!string.IsNullOrEmpty(details.Pecularity))
            {
                info.AddRow("Pecularity", details.Pecularity);
            }

            if (details.RadialVelocity != null)
            {
                info.AddRow("RadialVelocity", details.RadialVelocity + " km/s");
            }
        }
Exemple #10
0
        /// <summary>
        /// Metoda pro zpracovani popisu objektu
        /// </summary>
        /// <param name="info">Popis objektu</param>
        /// <returns>Element s popisem</returns>
        private static XElement DetailsToElement(CelestialObjectInfo info)
        {
            XElement infoElement = new XElement("details");

            String gravity = info.Gravity.ToString("0.########E+000", CultureInfo.InvariantCulture);

            infoElement.Add(new XElement("gravity", gravity));
            String mass = info.Mass.ToString("0.########E+000", CultureInfo.InvariantCulture);

            infoElement.Add(new XElement("mass", mass));
            infoElement.Add(new XElement("description", info.Description));

            return(infoElement);
        }
Exemple #11
0
        public void GetInfo(CelestialObjectInfo <Asteroid> info)
        {
            info
            .SetTitle(info.Body.Names.First())
            .SetSubtitle("Minor planet")
            .AddRow("Constellation")

            .AddHeader(Text.Get("Asteroid.Equatorial"))
            .AddRow("Equatorial.Alpha")
            .AddRow("Equatorial.Delta")

            .AddHeader(Text.Get("Asteroid.Equatorial0"))
            .AddRow("Equatorial0.Alpha")
            .AddRow("Equatorial0.Delta")

            .AddHeader(Text.Get("Asteroid.Ecliptical"))
            .AddRow("Ecliptical.Lambda")
            .AddRow("Ecliptical.Beta")

            .AddHeader(Text.Get("Asteroid.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("Asteroid.Appearance"))
            .AddRow("Phase")
            .AddRow("PhaseAngle")
            .AddRow("Magnitude")
            .AddRow("DistanceFromEarth")
            .AddRow("DistanceFromSun")
            .AddRow("HorizontalParallax");

            if (info.Body.PhysicalDiameter > 0)
            {
                info.AddRow("AngularDiameter");
            }

            info
            .AddHeader(Text.Get("Asteroid.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration");

            info
            .AddHeader(Text.Get("Asteroid.Visibility"))
            .AddRow("Visibility.Begin")
            .AddRow("Visibility.End")
            .AddRow("Visibility.Duration")
            .AddRow("Visibility.Period");
        }
Exemple #12
0
        public void GetInfo(CelestialObjectInfo <Sun> info)
        {
            var c = info.Context;

            info.SetTitle(Sun.Name)

            .AddRow("Constellation")
            .AddHeader(Text.Get("Sun.Equatorial0"))
            .AddRow("Equatorial0.Alpha")
            .AddRow("Equatorial0.Delta")

            .AddHeader(Text.Get("Sun.Equatorial"))
            .AddRow("Equatorial.Alpha")
            .AddRow("Equatorial.Delta")

            .AddHeader(Text.Get("Sun.Ecliptical"))
            .AddRow("Ecliptical.Lambda")
            .AddRow("Ecliptical.Beta")

            .AddHeader(Text.Get("Sun.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("Sun.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")

            .AddHeader(Text.Get("Sun.Twilight"))
            .AddRow("Twilight.Astronomical.Dawn")
            .AddRow("Twilight.Nautical.Dawn")
            .AddRow("Twilight.Civil.Dawn")
            .AddRow("Twilight.Civil.Dust")
            .AddRow("Twilight.Nautical.Dust")
            .AddRow("Twilight.Astronomical.Dust")

            .AddHeader(Text.Get("Sun.Appearance"))
            .AddRow("Distance")
            .AddRow("HorizontalParallax")
            .AddRow("AngularDiameter")
            .AddRow("CRN")

            .AddHeader(Text.Get("Sun.Seasons"))
            .AddRow("Seasons.Spring", c.Get(Seasons, Season.Spring), Formatters.DateTime)
            .AddRow("Seasons.Summer", c.Get(Seasons, Season.Summer), Formatters.DateTime)
            .AddRow("Seasons.Autumn", c.Get(Seasons, Season.Autumn), Formatters.DateTime)
            .AddRow("Seasons.Winter", c.Get(Seasons, Season.Winter), Formatters.DateTime);
        }
        /// <summary>
        /// Extension method for parsing planets.
        /// </summary>
        /// <param name="planetsNode">Node with planets</param>
        /// <param name="starSystem">Star system where the planet belongs to.</param>
        /// <returns>List of planets from xml.</returns>
        public static List <Planet> ParsePlanets(this XmlNode planetsNode, StarSystem starSystem)
        {
            List <Planet> planets = new List <Planet>();

            foreach (XmlNode childNode in planetsNode.ChildNodes)
            {
                String name    = childNode.Attributes["name"].Value;
                String altName = (childNode.Attributes["altName"] != null) ? childNode.Attributes["altName"].Value : "";
                CelestialObjectInfo details    = childNode.LastChild.ParseDetails();
                Trajectory          trajectory = childNode.FirstChild.ParseTrajectory();

                planets.Add(new Planet(name, altName, details, starSystem, trajectory));
            }

            return(planets);
        }
Exemple #14
0
        public void GetInfo(CelestialObjectInfo <Meteor> info)
        {
            Meteor     m = info.Body;
            SkyContext c = info.Context;

            string     constellation = Constellations.FindConstellation(c.Get(Equatorial, m), c.JulianDay);
            int        year          = c.GetDate(c.JulianDay).Year;
            var        offset        = c.GeoLocation.UtcOffset;
            var        jd0           = Date.DeltaT(c.JulianDay) / 86400.0 + Date.JulianDay0(year) - offset / 24;
            var        begin         = new Date(jd0 + m.Begin, offset);
            var        max           = new Date(jd0 + m.Max, offset);
            var        end           = new Date(jd0 + m.End, offset);
            SkyContext cMax          = new SkyContext(jd0 + m.Max, c.GeoLocation, c.PreferFastCalculation);
            var        phase         = LunarPhaseAtMax(cMax, m);

            info
            .SetTitle(string.Join(", ", info.Body.Names))
            .SetSubtitle(Text.Get("Meteor.Type"))
            .AddRow("Constellation", constellation)

            .AddHeader(Text.Get("Meteor.Equatorial"))
            .AddRow("Equatorial.Alpha")
            .AddRow("Equatorial.Delta")

            .AddHeader(Text.Get("Meteor.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("Meteor.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")

            .AddHeader(Text.Get("Meteor.Activity"))
            .AddRow("Activity.Begin", begin, Formatters.Date)
            .AddRow("Activity.Max", max, Formatters.Date)
            .AddRow("Activity.End", end, Formatters.Date)
            .AddRow("Activity.LunarPhaseAtMax", phase, Formatters.Phase)

            .AddHeader(Text.Get("Meteor.Data"))
            .AddRow("Data.ZHR", m.ZHR)
            .AddRow("Data.ActivityClass", m.ActivityClass)
            .AddRow("Data.DriftRA", m.Drift.Alpha, Formatters.Angle)
            .AddRow("Data.DriftDec", m.Drift.Delta, Formatters.Angle);
        }
Exemple #15
0
        public void GetInfo(CelestialObjectInfo <Nova> info)
        {
            Nova       n             = info.Body;
            SkyContext c             = info.Context;
            string     constellation = Constellations.FindConstellation(c.Get(Equatorial, n), c.JulianDay);
            int        year          = c.GetDate(c.JulianDay).Year;
            var        offset        = c.GeoLocation.UtcOffset;
            var        jd0           = Date.DeltaT(c.JulianDay) / 86400.0 + Date.JulianDay0(year) - offset / 24;

            info
            .SetTitle(string.Join(", ", info.Body.Names))
            .SetSubtitle(Text.Get("Nova.Type"))
            .AddRow("Constellation", constellation)

            .AddHeader(Text.Get("Nova.Equatorial"))
            .AddRow("Equatorial.Alpha")
            .AddRow("Equatorial.Delta")

            .AddHeader(Text.Get("Nova.Equatorial0"))
            .AddRow("Equatorial0.Alpha", n.Equatorial0.Alpha, Formatters.RA)
            .AddRow("Equatorial0.Delta", n.Equatorial0.Delta, Formatters.Dec)

            .AddHeader(Text.Get("Nova.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("Nova.Properties"))
            .AddRow("Magnitude")
            .AddRow("PeakDate", new Date(n.JulianDayPeak), Formatters.Date)
            .AddRow("MaxMagnitude", n.MaxMagnitude, Formatters.Magnitude)
            .AddRow("MinMagnitude", n.MinMagnitude, Formatters.Magnitude)
            .AddRow("Type", n.NovaType + NovaTypeDescription(n))

            .AddHeader(Text.Get("Nova.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration");
        }
        public void GetInfo(CelestialObjectInfo <GenericMoon> info)
        {
            info
            .SetSubtitle(Text.Get("Satellite.Subtitle", ("planetName", Text.Get($"Planet.{info.Body.Data.planet}.GenitiveName"))))
            .SetTitle(info.Body.Names.First())

            .AddRow("Constellation")
            .AddHeader(Text.Get("GenericMoon.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("GenericMoon.Equatorial"))
            .AddRow("Equatorial.Alpha")
            .AddRow("Equatorial.Delta")

            .AddHeader(Text.Get("GenericMoon.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")

            .AddHeader(Text.Get("GenericMoon.Appearance"))
            .AddRow("Magnitude")
            .AddRow("AngularDiameter")

            .AddHeader(Text.Get("GenericMoon.OrbitalElements"))
            .AddRow("OrbitalElements.Epoch", Formatters.Date.Format(new Date(info.Body.Data.jd)));
            // TODO: add other orbital elements

            decimal validityPeriod = settings.Get <decimal>("GenericMoonsOrbitalElementsValidity");

            if (Math.Abs(info.Body.Data.jd - new Date(DateTime.Today).ToJulianDay()) > (double)validityPeriod)
            {
                info.AddRow("OrbitalElements.Obsolete", "");
            }
        }
Exemple #17
0
        public void GetInfo(CelestialObjectInfo <Planet> info)
        {
            info
            .SetSubtitle(Text.Get("Planet.Subtitle"))
            .SetTitle(info.Body.Names.First())

            .AddRow("Constellation")

            .AddHeader(Text.Get("Planet.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("Planet.Equatorial"))
            .AddRow("Equatorial.Alpha")
            .AddRow("Equatorial.Delta")

            .AddHeader(Text.Get("Planet.Equatorial0"))
            .AddRow("Equatorial0.Alpha")
            .AddRow("Equatorial0.Delta")

            .AddHeader(Text.Get("Planet.Ecliptical"))
            .AddRow("Ecliptical.Lambda")
            .AddRow("Ecliptical.Beta")

            .AddHeader(Text.Get("Planet.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")

            .AddHeader(Text.Get("Planet.Visibility"))
            .AddRow("Visibility.Period")
            .AddRow("Visibility.Begin")
            .AddRow("Visibility.End")
            .AddRow("Visibility.Duration")

            .AddHeader(Text.Get("Planet.Appearance"))
            .AddRow("Phase")
            .AddRow("PhaseAngle")
            .AddRow("Magnitude")
            .AddRow("DistanceFromEarth")
            .AddRow("DistanceFromSun")
            .AddRow("HorizontalParallax")
            .AddRow("AngularDiameter")
            .AddRow("Appearance.CM")
            .AddRow("Appearance.P")
            .AddRow("Appearance.D");

            if (IsMars(info.Body))
            {
                info
                .AddHeader(Text.Get("Planet.MartianCalendar"))
                .AddRow("MartianCalendar.Year")
                .AddRow("MartianCalendar.Month")
                .AddRow("MartianCalendar.Sol")
                .AddRow("MartianCalendar.Ls");

                info
                .AddHeader(Text.Get("Planet.MartianPolarCaps"))
                .AddRow("MartianPolarCaps.North")
                .AddRow("MartianPolarCaps.South");
            }
            else if (IsJupiter(info.Body))
            {
                info
                .AddRow("GRSLongitude");
            }
            else if (IsSaturn(info.Body))
            {
                info
                .AddHeader(Text.Get("Planet.SaturnRings"))
                .AddRow("SaturnRings.a")
                .AddRow("SaturnRings.b");
            }
        }
Exemple #18
0
        public void GetInfo(CelestialObjectInfo <DeepSky> info)
        {
            DeepSky     ds            = info.Body;
            SkyContext  c             = info.Context;
            DeepSkyInfo details       = c.Get(ReadDeepSkyDetails, ds);
            string      constellation = Constellations.FindConstellation(c.Get(Equatorial, ds), c.JulianDay);

            info.SetSubtitle(ds.Status.ToString())
            .SetTitle(string.Join(" / ", ds.Names))
            .AddRow("Constellation", constellation)

            .AddHeader("Equatorial coordinates (current epoch)")
            .AddRow("Equatorial.Alpha", ds.Equatorial.Alpha)
            .AddRow("Equatorial.Delta", ds.Equatorial.Delta)

            .AddHeader("Equatorial coordinates (J2000.0 epoch)")
            .AddRow("Equatorial0.Alpha", ds.Equatorial0.Alpha)
            .AddRow("Equatorial0.Delta", ds.Equatorial0.Delta)

            .AddHeader("Horizontal coordinates")
            .AddRow("Horizontal.Azimuth", ds.Horizontal.Azimuth)
            .AddRow("Horizontal.Altitude", ds.Horizontal.Altitude)

            .AddHeader("Visibility")
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")

            .AddHeader("Properties");

            info.AddRow("DeepSky.Type", details.ObjectType);
            if (ds.Mag != null)
            {
                info.AddRow("VisualMagnitude", ds.Mag, Formatters.Magnitude);
            }
            if (details.PhotoMagnitude != null)
            {
                info.AddRow("PhotoMagnitude", details.PhotoMagnitude, Formatters.Magnitude);
            }
            if (details.SurfaceBrightness != null)
            {
                info.AddRow("Brightness", details.SurfaceBrightness, Formatters.SurfaceBrightness);
            }

            if (ds.SizeA > 0)
            {
                string size = $"{Formatters.AngularDiameter.Format(ds.SizeA / 60)}";
                if (ds.SizeB > 0)
                {
                    size += $" x {Formatters.AngularDiameter.Format(ds.SizeB / 60)}";
                }
                info.AddRow("AngularDiameter", size, Formatters.Simple);
            }
            if (ds.PA > 0)
            {
                info.AddRow("Position angle", ds.PA, Formatters.RotationAxis);
            }

            if (details.Identifiers.Any() || details.PGC != null)
            {
                info.AddHeader("Designations");
                if (details.Identifiers.Any())
                {
                    info.AddRow("Other catalogs identifiers", string.Join(", ", details.Identifiers));
                }
                if (details.PGC != null)
                {
                    info.AddRow("PGC catalog number", string.Join(", ", details.PGC));
                }
            }

            if (!string.IsNullOrEmpty(details.Remarks))
            {
                info.AddRow("Remarks", details.Remarks);
            }
        }
Exemple #19
0
        public void GetInfo(CelestialObjectInfo <DeepSky> info)
        {
            DeepSky     ds            = info.Body;
            SkyContext  c             = info.Context;
            DeepSkyInfo details       = c.Get(ReadDeepSkyDetails, ds);
            string      constellation = Constellations.FindConstellation(c.Get(Equatorial, ds), c.JulianDay);

            info
            .SetSubtitle(Text.Get("DeepSky.Status." + ds.Status.ToString()))
            .SetTitle(string.Join(" / ", ds.Names))
            .AddRow("Constellation", constellation)

            .AddHeader(Text.Get("DeepSky.Equatorial"))
            .AddRow("Equatorial.Alpha", ds.Equatorial.Alpha)
            .AddRow("Equatorial.Delta", ds.Equatorial.Delta)

            .AddHeader(Text.Get("DeepSky.Equatorial0"))
            .AddRow("Equatorial0.Alpha", ds.Equatorial0.Alpha)
            .AddRow("Equatorial0.Delta", ds.Equatorial0.Delta)

            .AddHeader(Text.Get("DeepSky.Horizontal"))
            .AddRow("Horizontal.Azimuth", ds.Horizontal.Azimuth)
            .AddRow("Horizontal.Altitude", ds.Horizontal.Altitude)

            .AddHeader(Text.Get("DeepSky.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")

            .AddHeader(Text.Get("DeepSky.Properties"));

            info.AddRow("Type", details.ObjectType);
            if (ds.Mag != null)
            {
                info.AddRow("VisualMagnitude", ds.Mag, Formatters.Magnitude);
            }
            if (details.PhotoMagnitude != null)
            {
                info.AddRow("PhotoMagnitude", details.PhotoMagnitude, Formatters.Magnitude);
            }
            if (details.SurfaceBrightness != null)
            {
                info.AddRow("SurfaceBrightness", details.SurfaceBrightness, new Formatters.SignedDoubleFormatter(2, " mag/sq.arcsec"));
            }

            if (ds.SizeA > 0)
            {
                string size = $"{Formatters.Angle.Format(ds.SizeA / 60)}";
                if (ds.SizeB > 0)
                {
                    size += $" x {Formatters.Angle.Format(ds.SizeB / 60)}";
                }
                info.AddRow("AngularDiameter", size, Formatters.Simple);
            }
            if (ds.PA > 0)
            {
                info.AddRow("PositionAngle", ds.PA, new Formatters.UnsignedDoubleFormatter(2, "\u00B0"));
            }

            if (details.Identifiers.Any() || details.PGC != null)
            {
                info.AddHeader(Text.Get("DeepSky.Designations"));
                if (details.Identifiers.Any())
                {
                    info.AddRow("OtherCatalogsIdentifiers", string.Join(", ", details.Identifiers));
                }
                if (details.PGC != null)
                {
                    info.AddRow("PGCCatalogNumber", string.Join(", ", details.PGC));
                }
            }

            if (!string.IsNullOrEmpty(details.Remarks))
            {
                info.AddRow("Remarks", details.Remarks);
            }
        }
Exemple #20
0
        public void GetInfo(CelestialObjectInfo <Moon> info)
        {
            var c = info.Context;

            info.SetTitle(info.Body.Name)

            .AddRow("Constellation")

            .AddHeader(Text.Get("Moon.Horizontal"))
            .AddRow("Horizontal.Azimuth")
            .AddRow("Horizontal.Altitude")

            .AddHeader(Text.Get("Moon.Equatorial"))
            .AddRow("Equatorial.Alpha")
            .AddRow("Equatorial.Delta")

            .AddHeader(Text.Get("Moon.Equatorial0"))
            .AddRow("Equatorial0.Alpha")
            .AddRow("Equatorial0.Delta")

            .AddHeader(Text.Get("Moon.Ecliptical"))
            .AddRow("Ecliptical.Lambda")
            .AddRow("Ecliptical.Beta")

            .AddHeader(Text.Get("Moon.RTS"))
            .AddRow("RTS.Rise")
            .AddRow("RTS.Transit")
            .AddRow("RTS.Set")
            .AddRow("RTS.Duration")
            .AddRow("RTS.RiseAzimuth")
            .AddRow("RTS.TransitAltitude")
            .AddRow("RTS.SetAzimuth")

            .AddHeader(Text.Get("Moon.Appearance"))
            .AddRow("Phase")
            .AddRow("PhaseAngle")
            .AddRow("Age")
            .AddRow("Lunation")
            .AddRow("Magnitude")
            .AddRow("Distance")
            .AddRow("HorizontalParallax")
            .AddRow("AngularDiameter")
            .AddRow("Libration.Latitude")
            .AddRow("Libration.Longitude");

            info.AddHeader(Text.Get("Moon.Phases"));
            var phases = new Tuple <string, Date>[] {
                new Tuple <string, Date>("Phases.NewMoon", c.Get(NearestPhase, MoonPhase.NewMoon)),
                new Tuple <string, Date>("Phases.FirstQuarter", c.Get(NearestPhase, MoonPhase.FirstQuarter)),
                new Tuple <string, Date>("Phases.FullMoon", c.Get(NearestPhase, MoonPhase.FullMoon)),
                new Tuple <string, Date>("Phases.LastQuarter", c.Get(NearestPhase, MoonPhase.LastQuarter))
            };

            foreach (var p in phases.OrderBy(i => i.Item2))
            {
                info.AddRow(p.Item1, p.Item2, Formatters.DateTime);
            }

            info.AddHeader(Text.Get("Moon.Apsis"));
            var apsis = new Tuple <string, Date>[] {
                new Tuple <string, Date>("Apsis.Apogee", c.Get(NearestApsis, MoonApsis.Apogee)),
                new Tuple <string, Date>("Apsis.Perigee", c.Get(NearestApsis, MoonApsis.Perigee))
            };

            foreach (var p in apsis.OrderBy(i => i.Item2))
            {
                info.AddRow(p.Item1, p.Item2, Formatters.DateTime);
            }

            info.AddHeader(Text.Get("Moon.MaxDeclinations"));
            var maxDeclinations = new Tuple <string, Date>[] {
                new Tuple <string, Date>("MaxDeclinations.North", c.Get(NearestMaxDeclination, MoonDeclination.North)),
                new Tuple <string, Date>("MaxDeclinations.South", c.Get(NearestMaxDeclination, MoonDeclination.South))
            };

            foreach (var p in maxDeclinations.OrderBy(i => i.Item2))
            {
                info.AddRow(p.Item1, p.Item2, Formatters.DateTime);
            }

            info.AddHeader(Text.Get("Moon.MaxLibrations"));
            var maxLibrations = new Tuple <string, Date>[] {
                new Tuple <string, Date>("MaxLibrations.North", c.Get(NearestMaxLibration, LibrationEdge.North)),
                new Tuple <string, Date>("MaxLibrations.South", c.Get(NearestMaxLibration, LibrationEdge.South)),
                new Tuple <string, Date>("MaxLibrations.East", c.Get(NearestMaxLibration, LibrationEdge.East)),
                new Tuple <string, Date>("MaxLibrations.West", c.Get(NearestMaxLibration, LibrationEdge.West))
            };

            foreach (var p in maxLibrations.OrderBy(i => i.Item2))
            {
                info.AddRow(p.Item1, p.Item2, Formatters.DateTime);
            }
        }