/// <summary>
        /// Calculates equatorial geocentric coordinates of Pluto for current epoch
        /// </summary>
        private CrdsEquatorial Pluto_Equatorial0(SkyContext c)
        {
            PrecessionalElements pe     = Precession.ElementsFK5(Date.EPOCH_J2000, c.JulianDay);
            CrdsEquatorial       eq2000 = c.Get(Pluto_EclipticalJ2000).ToEquatorial(epsilonJ2000);

            return(Precession.GetEquatorialCoordinates(eq2000, pe));
        }
Exemple #2
0
        /// <summary>
        /// Gets equatorial coordinates of a star for current epoch
        /// </summary>
        public CrdsEquatorial Equatorial(SkyContext c, ushort hrNumber)
        {
            Star star = Stars.ElementAt(hrNumber - 1);

            PrecessionalElements p = c.Get(GetPrecessionalElements);
            double years           = c.Get(YearsSince2000);

            // Initial coodinates for J2000 epoch
            CrdsEquatorial eq0 = new CrdsEquatorial(star.Equatorial0);

            // Take into account effect of proper motion:
            // now coordinates are for the mean equinox of J2000.0,
            // but for epoch of the target date
            eq0.Alpha += star.PmAlpha * years / 3600.0;
            eq0.Delta += star.PmDelta * years / 3600.0;

            // Equatorial coordinates for the mean equinox and epoch of the target date
            CrdsEquatorial eq = Precession.GetEquatorialCoordinates(eq0, p);

            // Nutation effect
            var eq1 = Nutation.NutationEffect(eq, c.NutationElements, c.Epsilon);

            // Aberration effect
            var eq2 = Aberration.AberrationEffect(eq, c.AberrationElements, c.Epsilon);

            // Apparent coordinates of the star
            eq += eq1 + eq2;

            return(eq);
        }
        public override void Render(IMapContext map)
        {
            Graphics g          = map.Graphics;
            bool     isGround   = settings.Get <bool>("Ground");
            bool     isLabels   = settings.Get <bool>("StarsLabels");
            Brush    brushNames = new SolidBrush(map.GetColor("ColorStarsLabels"));

            if (map.MagLimit > 8 && settings.Get <bool>("Stars") && settings.Get <bool>("Tycho2"))
            {
                Brush brushStar = GetColor(map);

                PrecessionalElements pe = Precession.ElementsFK5(map.JulianDay, Date.EPOCH_J2000);

                var eq0 = map.Center.ToEquatorial(map.GeoLocation, map.SiderealTime);

                CrdsEquatorial eq = Precession.GetEquatorialCoordinates(eq0, pe);

                SkyContext context = new SkyContext(map.JulianDay, map.GeoLocation);

                tycho2.LockedStar   = map.LockedObject as Tycho2Star;
                tycho2.SelectedStar = map.SelectedObject as Tycho2Star;

                var stars = tycho2.GetStars(context, eq, map.ViewAngle, m => MagFilter(map, m));

                foreach (var star in stars)
                {
                    if (!isGround || star.Horizontal.Altitude > 0)
                    {
                        PointF p = map.Project(star.Horizontal);
                        if (!map.IsOutOfScreen(p))
                        {
                            float size = map.GetPointSize(star.Magnitude);

                            if (map.Schema == ColorSchema.White)
                            {
                                g.FillEllipse(Brushes.White, p.X - size / 2 - 1, p.Y - size / 2 - 1, size + 2, size + 2);
                            }
                            g.FillEllipse(brushStar, p.X - size / 2, p.Y - size / 2, size, size);

                            if (isLabels && map.ViewAngle < 1 && size > 3)
                            {
                                map.DrawObjectCaption(fontNames, brushNames, star.ToString(), p, size);
                            }
                            map.AddDrawnObject(star);
                        }
                    }
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// Gets equatorial coordinates of deep sky object for current epoch
        /// </summary>
        private CrdsEquatorial Equatorial(SkyContext c, DeepSky ds)
        {
            PrecessionalElements p = c.Get(GetPrecessionalElements);

            // Equatorial coordinates for the mean equinox and epoch of the target date
            CrdsEquatorial eq = Precession.GetEquatorialCoordinates(ds.Equatorial0, p);

            // Nutation effect
            var eq1 = Nutation.NutationEffect(eq, c.NutationElements, c.Epsilon);

            // Aberration effect
            var eq2 = Aberration.AberrationEffect(eq, c.AberrationElements, c.Epsilon);

            // Apparent coordinates of the object
            eq += eq1 + eq2;

            return(eq);
        }
        public override void Render(IMapContext map)
        {
            peFrom1950 = Precession.ElementsFK5(Date.EPOCH_B1950, map.JulianDay);
            peTo1950   = Precession.ElementsFK5(map.JulianDay, Date.EPOCH_B1950);

            Color colorGridEquatorial = map.GetColor("ColorEquatorialGrid");
            Color colorGridHorizontal = map.GetColor("ColorHorizontalGrid");
            Color colorLineEcliptic   = map.GetColor("ColorEcliptic");
            Color colorLineGalactic   = map.GetColor("ColorGalacticEquator");
            Color colorLineMeridian   = map.GetColor("ColorMeridian");

            penGridEquatorial.Color = colorGridEquatorial;
            penGridHorizontal.Color = colorGridHorizontal;
            penLineEcliptic.Color   = colorLineEcliptic;
            penLineGalactic.Color   = colorLineGalactic;
            penLineMeridian.Color   = colorLineMeridian;

            if (settings.Get <bool>("GalacticEquator"))
            {
                DrawGrid(map, penLineGalactic, LineGalactic);
            }
            if (settings.Get <bool>("EquatorialGrid"))
            {
                DrawGrid(map, penGridEquatorial, GridEquatorial);
                DrawEquatorialPoles(map);
            }
            if (settings.Get <bool>("HorizontalGrid"))
            {
                DrawGrid(map, penGridHorizontal, GridHorizontal);
                DrawHorizontalPoles(map);
            }
            if (settings.Get <bool>("EclipticLine"))
            {
                DrawGrid(map, penLineEcliptic, LineEcliptic);
                DrawEquinoxLabels(map);
                DrawLunarNodes(map);
            }
            if (settings.Get <bool>("MeridianLine"))
            {
                DrawGrid(map, penLineMeridian, LineMeridian);
            }
        }
Exemple #6
0
        private CrdsEquatorial StarEquatorial(SkyContext c, ConjunctedStar star)
        {
            PrecessionalElements p = c.Get(PrecessionalElements);

            // Number of years, with fractions, since J2000 epoch
            double years = (c.JulianDay - Date.EPOCH_J2000) / 365.25;

            // Initial coodinates for J2000 epoch
            CrdsEquatorial eq0 = new CrdsEquatorial(star.Equatorial0);

            // Take into account effect of proper motion:
            // now coordinates are for the mean equinox of J2000.0,
            // but for epoch of the target date
            eq0.Alpha += star.PmAlpha * years / 3600.0;
            eq0.Delta += star.PmDelta * years / 3600.0;

            // Equatorial coordinates for the mean equinox and epoch of the target date
            // without aberration and nutation corrections
            return(Precession.GetEquatorialCoordinates(eq0, p));
        }
Exemple #7
0
        /// <summary>
        /// Gets equatorial coordinates of a star for current epoch
        /// </summary>
        public CrdsEquatorial Equatorial(SkyContext c, Nova n)
        {
            PrecessionalElements p = c.Get(GetPrecessionalElements);
            double years           = c.Get(YearsSince2000);

            // Initial coodinates for J2000 epoch
            CrdsEquatorial eq0 = new CrdsEquatorial(n.Equatorial0);

            // Equatorial coordinates for the mean equinox and epoch of the target date
            CrdsEquatorial eq = Precession.GetEquatorialCoordinates(eq0, p);

            // Nutation effect
            var eq1 = Nutation.NutationEffect(eq, c.NutationElements, c.Epsilon);

            // Aberration effect
            var eq2 = Aberration.AberrationEffect(eq, c.AberrationElements, c.Epsilon);

            // Apparent coordinates of the star
            eq += eq1 + eq2;

            return(eq);
        }
Exemple #8
0
        /// <summary>
        /// Gets equatorial coordinates of a star for current epoch
        /// </summary>
        private CrdsEquatorial Equatorial(SkyContext context, Tycho2Star star)
        {
            PrecessionalElements p = context.Get(PrecessionalElements);
            double years           = context.Get(YearsSince2000);

            // Take into account effect of proper motion:
            // now coordinates are for the mean equinox of J2000.0,
            // but for epoch of the target date
            var eq0 = star.Equatorial0 + new CrdsEquatorial(star.PmRA * years / 3600000, star.PmDec * years / 3600000);

            // Equatorial coordinates for the mean equinox and epoch of the target date
            CrdsEquatorial eq = Precession.GetEquatorialCoordinates(eq0, p);

            // Nutation effect
            var eqN = Nutation.NutationEffect(eq, context.NutationElements, context.Epsilon);

            // Aberration effect
            var eqA = Aberration.AberrationEffect(eq, context.AberrationElements, context.Epsilon);

            // Apparent coordinates of the star
            eq += eqN + eqA;

            return(eq);
        }