Esempio n. 1
0
        public void GetImageCoordsFromRADE(double RADeg, double DEDeg, out double x, out double y)
        {
            double xTang, yTang;

            TangentPlane.CelestialToTangent(RADeg, DEDeg, m_RA0Deg, m_DE0Deg, out xTang, out yTang);

            x = m_A1 * xTang + m_B1 * yTang + m_C1;
            y = m_D1 * xTang + m_E1 * yTang + m_F1;
        }
Esempio n. 2
0
        public void GetImageCoordsFromRADE(double RADeg, double DE, out double x, out double y)
        {
            double xTang, yTang;

            TangentPlane.CelestialToTangent(RADeg, DE, m_RA0Deg, m_DE0Deg, out xTang, out yTang);


            m_SolvedConstants.GetImageCoordsFromTangentCoords(xTang, yTang, out x, out y);
        }
Esempio n. 3
0
        public void GetImageCoordsFromRADE(double RADeg, double DE, out double x, out double y)
        {
            double tangentalX, tangentalY;

            TangentPlane.CelestialToTangent(RADeg, DE, this.m_RA0Deg, this.m_DE0Deg, out tangentalX, out tangentalY);

            tangentalY = -tangentalY;

            double plateX = tangentalX * (focalLength * 1000.0 / cellWidth);
            double plateY = tangentalY * (focalLength * 1000.0 / cellHeight);

            double mtxX = Math.Cos(EtaRadians) * plateX + Math.Sin(EtaRadians) * plateY;
            double mtxY = Math.Cos(EtaRadians) * plateY - Math.Sin(EtaRadians) * plateX;


            m_Image.MatrixCoordsToImageCoords(mtxX, mtxY, out x, out y, CoordinateReference.Center);

            x += m_Image.CenterXImage;
            y += m_Image.CenterYImage;
        }
Esempio n. 4
0
        private PlateConstStarPair AddStar(double x, double RADeg, double y, double DE, double mag, int intensity, double detectionCertainty, bool isSaturated)
        {
            double xExpected, yExpected;

            TangentPlane.CelestialToTangent(RADeg, DE, m_Tangent_RA0, m_Tangent_DE0, out xExpected, out yExpected);

            PlateConstStarPair pair = new PlateConstStarPair();

            pair.x                  = x;
            pair.y                  = y;
            pair.ExpectedXTang      = xExpected;
            pair.ExpectedYTang      = yExpected;
            pair.Mag                = mag;
            pair.Intensity          = (uint)intensity;
            pair.IsSaturated        = isSaturated;
            pair.DetectionCertainty = detectionCertainty;

            m_Pairs.Add(pair);

            return(pair);
        }
Esempio n. 5
0
        public ThreeStarFit(
            AstroPlate image,
            StarPair pair1,
            StarPair pair2,
            StarPair pair3)
        {
            m_Image = image;

            // X1 = a*x1 + b*y1 + c
            // Y1 = d*x1 + e*y1 + f
            // X2 = a*x2 + b*y2 + c
            // Y2 = d*x2 + e*y2 + f
            // X3 = a*x3 + b*y3 + c
            // Y3 = d*x3 + e*y3 + f

            // NOTE: First do a SimpleRaDec fit to get the RA0/DE0

            double DX12 = pair1.RADeg - pair2.RADeg;
            double DX23 = pair2.RADeg - pair3.RADeg;
            double DY12 = pair1.DEDeg - pair2.DEDeg;
            double DY23 = pair2.DEDeg - pair3.DEDeg;
            double dx12 = pair1.XImage - pair2.XImage;
            double dx23 = pair2.XImage - pair3.XImage;
            double dy12 = pair1.YImage - pair2.YImage;
            double dy23 = pair2.YImage - pair3.YImage;

            // Singularity
            if (DX12 * DX23 * DY12 * DY23 * dx12 * dx23 * dy12 * dy23 == 0)
            {
                m_IsSingularity = true;
                return;
            }

            m_A = (DX12 * dy23 - DX23 * dy12) / (dx12 * dy23 - dx23 * dy12);
            m_B = (DX12 - m_A * dx12) / dy12;
            m_C = pair1.RADeg - m_A * pair1.XImage - m_B * pair1.YImage;
            m_D = (DY12 * dy23 - DY23 * dy12) / (dx12 * dy23 - dx23 * dy12);
            m_E = (DY12 - m_D * dx12) / dy12;
            m_F = pair1.DEDeg - m_D * pair1.XImage - m_E * pair1.YImage;

            m_RA0Deg = m_A * m_Image.CenterXImage + m_B * m_Image.CenterYImage + m_C;
            m_DE0Deg = m_D * m_Image.CenterXImage + m_E * m_Image.CenterYImage + m_F;

            // NOTE: Then do the Tangental solution

            TangentPlane.CelestialToTangent(pair1.RADeg, pair1.DEDeg, m_RA0Deg, m_DE0Deg, out pair1.XTangent, out pair1.YTangent);
            TangentPlane.CelestialToTangent(pair2.RADeg, pair2.DEDeg, m_RA0Deg, m_DE0Deg, out pair2.XTangent, out pair2.YTangent);
            TangentPlane.CelestialToTangent(pair3.RADeg, pair3.DEDeg, m_RA0Deg, m_DE0Deg, out pair3.XTangent, out pair3.YTangent);

            DX12 = pair1.XTangent - pair2.XTangent;
            DX23 = pair2.XTangent - pair3.XTangent;
            DY12 = pair1.YTangent - pair2.YTangent;
            DY23 = pair2.YTangent - pair3.YTangent;

            m_A = (DX12 * dy23 - DX23 * dy12) / (dx12 * dy23 - dx23 * dy12);
            m_B = (DX12 - m_A * dx12) / dy12;
            m_C = pair1.XTangent - m_A * pair1.XImage - m_B * pair1.YImage;
            m_D = (DY12 * dy23 - DY23 * dy12) / (dx12 * dy23 - dx23 * dy12);
            m_E = (DY12 - m_D * dx12) / dy12;
            m_F = pair1.YTangent - m_D * pair1.XImage - m_E * pair1.YImage;

            m_A1 = m_E / (m_E * m_A - m_B * m_D);
            m_B1 = -m_B / (m_E * m_A - m_B * m_D);
            m_C1 = (m_B * m_F - m_C * m_E) / (m_E * m_A - m_B * m_D);
            m_D1 = m_D / (m_B * m_D - m_A * m_E);
            m_E1 = -m_A / (m_B * m_D - m_A * m_E);
            m_F1 = (m_A * m_F - m_C * m_D) / (m_B * m_D - m_A * m_E);

            m_IsSolved = true;
        }