Exemplo n.º 1
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");
            }
        }
Exemplo n.º 2
0
        public void GetInfo(CelestialObjectInfo <Asteroid> info)
        {
            info
            .SetTitle(info.Body.Names.First())
            .SetSubtitle(Text.Get("Asteroid.Type"))
            .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");
        }
        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", "");
            }
        }
Exemplo n.º 4
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");
            }
        }
Exemplo n.º 5
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);
            }
        }
Exemplo n.º 6
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);
            }
        }
Exemplo n.º 7
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);
            }
        }