Example #1
0
        public static PlateConstantsLinearFit FromReflectedLinearFit(object reflObj)
        {
            var rv = new PlateConstantsLinearFit();

            rv.Const_A = StarMap.GetPropValue <double>(reflObj, "Const_A");
            rv.Const_B = StarMap.GetPropValue <double>(reflObj, "Const_B");
            rv.Const_C = StarMap.GetPropValue <double>(reflObj, "Const_C");
            rv.Const_D = StarMap.GetPropValue <double>(reflObj, "Const_D");
            rv.Const_E = StarMap.GetPropValue <double>(reflObj, "Const_E");
            rv.Const_F = StarMap.GetPropValue <double>(reflObj, "Const_F");

            rv.Const_A1 = StarMap.GetPropValue <double>(reflObj, "Const_A1");
            rv.Const_B1 = StarMap.GetPropValue <double>(reflObj, "Const_B1");
            rv.Const_C1 = StarMap.GetPropValue <double>(reflObj, "Const_C1");
            rv.Const_D1 = StarMap.GetPropValue <double>(reflObj, "Const_D1");
            rv.Const_E1 = StarMap.GetPropValue <double>(reflObj, "Const_E1");
            rv.Const_F1 = StarMap.GetPropValue <double>(reflObj, "Const_F1");

            rv.m_FitInfo = new FitInfo(new List <PlateConstStarPair>());
            object fitInfo = StarMap.GetPropValue <object>(reflObj, "m_FitInfo");

            rv.m_FitInfo.FittedFocalLength = StarMap.GetPropValue <double>(fitInfo, "FittedFocalLength");

            return(rv);
        }
Example #2
0
        public static PlateConstantsFit FromReflectedObject(object reflObj)
        {
            string constType = reflObj.GetType().ToString();

            if (constType.Contains("PlateConstantsLinearFit"))
            {
                return(PlateConstantsLinearFit.FromReflectedLinearFit(reflObj));
            }
            else if (constType.Contains("PlateConstantsQadraticFit"))
            {
                return(PlateConstantsQadraticFit.FromReflectedQadraticFit(reflObj));
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        public static PlateConstantsFit LeastSquareSolve(
            List <PlateConstStarPair> pairs,
            double ra0Deg,
            double de0Deg,
            FitOrder fitOrder,
            int minNumberOfStars)
        {
            if (fitOrder == FitOrder.Linear)
            {
                PlateConstantsLinearFit linearFit = new PlateConstantsLinearFit(pairs);
                try
                {
                    if (linearFit.LeastSquareSolve(ra0Deg, de0Deg, minNumberOfStars))
                    {
                        return(linearFit);
                    }
                }
                catch (Exception ex)
                {
                    Trace.WriteLine("{0} exception during PlateConstantsFit.", ex.GetType().Name);
                    return(null);
                }
            }

            if (fitOrder == FitOrder.Quadratic)
            {
                PlateConstantsQadraticFit qadraticFit = new PlateConstantsQadraticFit(pairs);
                try
                {
                    if (qadraticFit.LeastSquareSolve(ra0Deg, de0Deg, minNumberOfStars))
                    {
                        return(qadraticFit);
                    }
                }
                catch (Exception ex)
                {
                    Trace.WriteLine("{0} exception during PlateConstantsFit.", ex.GetType().Name);
                    return(null);
                }
            }

            return(null);
        }
Example #4
0
        public static PlateConstantsFit ConstructLinearConstantsFit(
            double a, double b, double c, double d, double e, double f,
            double a1, double b1, double c1, double d1, double e1, double f1)
        {
            PlateConstantsLinearFit linearFit = new PlateConstantsLinearFit(new List <PlateConstStarPair>());

            linearFit.Const_A  = a;
            linearFit.Const_B  = b;
            linearFit.Const_C  = c;
            linearFit.Const_D  = d;
            linearFit.Const_E  = e;
            linearFit.Const_F  = f;
            linearFit.Const_A1 = a1;
            linearFit.Const_B1 = b1;
            linearFit.Const_C1 = c1;
            linearFit.Const_D1 = d1;
            linearFit.Const_E1 = e1;
            linearFit.Const_F1 = f1;
            return(linearFit);
        }
        public static PlateConstantsLinearFit FromReflectedLinearFit(object reflObj)
        {
            var rv = new PlateConstantsLinearFit();

            rv.Const_A = StarMap.GetPropValue<double>(reflObj, "Const_A");
            rv.Const_B = StarMap.GetPropValue<double>(reflObj, "Const_B");
            rv.Const_C = StarMap.GetPropValue<double>(reflObj, "Const_C");
            rv.Const_D = StarMap.GetPropValue<double>(reflObj, "Const_D");
            rv.Const_E = StarMap.GetPropValue<double>(reflObj, "Const_E");
            rv.Const_F = StarMap.GetPropValue<double>(reflObj, "Const_F");

            rv.Const_A1 = StarMap.GetPropValue<double>(reflObj, "Const_A1");
            rv.Const_B1 = StarMap.GetPropValue<double>(reflObj, "Const_B1");
            rv.Const_C1 = StarMap.GetPropValue<double>(reflObj, "Const_C1");
            rv.Const_D1 = StarMap.GetPropValue<double>(reflObj, "Const_D1");
            rv.Const_E1 = StarMap.GetPropValue<double>(reflObj, "Const_E1");
            rv.Const_F1 = StarMap.GetPropValue<double>(reflObj, "Const_F1");

            rv.m_FitInfo = new FitInfo(new List<PlateConstStarPair>());
            object fitInfo = StarMap.GetPropValue<object>(reflObj, "m_FitInfo");
            rv.m_FitInfo.FittedFocalLength = StarMap.GetPropValue<double>(fitInfo, "FittedFocalLength");

            return rv;
        }
Example #6
0
        public static PlateConstantsFit LeastSquareSolve(
			List<PlateConstStarPair> pairs,
			double ra0Deg,
			double de0Deg,
			FitOrder fitOrder,
			int minNumberOfStars)
        {
            if (fitOrder == FitOrder.Linear)
            {
                PlateConstantsLinearFit linearFit = new PlateConstantsLinearFit(pairs);
                try
                {
                    if (linearFit.LeastSquareSolve(ra0Deg, de0Deg, minNumberOfStars))
                        return linearFit;
                }
                catch (Exception ex)
                {
                    Trace.WriteLine("{0} exception during PlateConstantsFit.", ex.GetType().Name);
                    return null;
                }
            }

            if (fitOrder == FitOrder.Quadratic)
            {
                PlateConstantsQadraticFit qadraticFit = new PlateConstantsQadraticFit(pairs);
                try
                {
                    if (qadraticFit.LeastSquareSolve(ra0Deg, de0Deg, minNumberOfStars))
                        return qadraticFit;
                }
                catch (Exception ex)
                {
                    Trace.WriteLine("{0} exception during PlateConstantsFit.", ex.GetType().Name);
                    return null;
                }
            }

            return null;
        }
Example #7
0
 public static PlateConstantsFit ConstructLinearConstantsFit(
     double a, double b, double c, double d, double e, double f, 
     double a1, double b1, double c1, double d1, double e1, double f1)
 {
     PlateConstantsLinearFit linearFit = new PlateConstantsLinearFit(new List<PlateConstStarPair>());
     linearFit.Const_A = a;
     linearFit.Const_B = b;
     linearFit.Const_C = c;
     linearFit.Const_D = d;
     linearFit.Const_E = e;
     linearFit.Const_F = f;
     linearFit.Const_A1 = a1;
     linearFit.Const_B1 = b1;
     linearFit.Const_C1 = c1;
     linearFit.Const_D1 = d1;
     linearFit.Const_E1 = e1;
     linearFit.Const_F1 = f1;
     return linearFit;
 }