Exemplo n.º 1
0
        public DensityArea(
            TangentalNormalizedDirectionAstrometry astrometry,
            int maxStarsInArea,
            double raFrom,
            double raTo,
            double deFrom,
            double deTo)
        {
            m_RAFrom     = raFrom;
            m_RATo       = raTo;
            m_DEFrom     = deFrom;
            m_DETo       = deTo;
            MarkedStars  = 0;
            m_Astrometry = astrometry;

            m_MaxStarsInArea = maxStarsInArea;

            double x1, y1, x2, y2;

            astrometry.GetImageCoordsFromRADE(raFrom, deFrom, out x1, out y1);
            astrometry.GetImageCoordsFromRADE(raTo, deTo, out x2, out y2);

            m_XFrom = x1;
            m_YFrom = y1;
            m_XTo   = x2;
            m_YTo   = y2;

#if ASTROMETRY_DEBUG
            Trace.Assert(x1 < x2);
            Trace.Assert(y1 < y2);
#endif
        }
        public DensityArea(
			TangentalNormalizedDirectionAstrometry astrometry,
			int maxStarsInArea,
			double raFrom, 
			double raTo, 
			double deFrom, 
			double deTo,
            List<ulong> alwaysIncludeStars)
        {
            m_RAFrom = raFrom;
            m_RATo = raTo;
            m_DEFrom = deFrom;
            m_DETo = deTo;
            MarkedStars = 0;
            m_Astrometry = astrometry;

            m_MaxStarsInArea = maxStarsInArea;
            if (alwaysIncludeStars != null) m_AlwaysIncludeStars.AddRange(alwaysIncludeStars);

            double x1, y1, x2, y2;
            astrometry.GetImageCoordsFromRADE(raFrom, deFrom, out x1, out y1);
            astrometry.GetImageCoordsFromRADE(raTo, deTo, out x2, out y2);

            m_XFrom = x1;
            m_YFrom = y1;
            m_XTo = x2;
            m_YTo = y2;

            #if ASTROMETRY_DEBUG
            Trace.Assert(x1 < x2);
            Trace.Assert(y1 < y2);
            #endif
        }
Exemplo n.º 3
0
        private DensityArea ComputeAreaFromXYPixCoords(
            TangentalNormalizedDirectionAstrometry astrometry,
            double x1, double y1, double x2, double y2)
        {
            double ra1, de1, ra2, de2;

            astrometry.GetRADEFromImageCoords(x1, y1, out ra1, out de1);
            astrometry.GetRADEFromImageCoords(x2, y2, out ra2, out de2);
            DensityArea area = new DensityArea(astrometry, MAX_STARS_IN_AREA, ra1, ra2, de1, de2);

            area.DebugResolvedStarsWithAppliedExclusions = DebugResolvedStarsWithAppliedExclusions;

#if ASTROMETRY_DEBUG
            Trace.Assert(Math.Abs(area.XFrom - x1) < 1);
            Trace.Assert(Math.Abs(area.XTo - x2) < 1);
            Trace.Assert(Math.Abs(area.YFrom - y1) < 1);
            Trace.Assert(Math.Abs(area.YTo - y2) < 1);
#endif

            double xx1, yy1, xx2, yy2;
            astrometry.GetImageCoordsFromRADE(area.RAFrom, area.DEFrom, out xx1, out yy1);
            astrometry.GetImageCoordsFromRADE(area.RATo, area.DETo, out xx2, out yy2);

#if ASTROMETRY_DEBUG
            Trace.Assert(Math.Abs(area.XFrom - xx1) < 1);
            Trace.Assert(Math.Abs(area.YFrom - yy1) < 1);
            Trace.Assert(Math.Abs(area.XTo - xx2) < 1);
            Trace.Assert(Math.Abs(area.YTo - yy2) < 1);

            Trace.Assert(Math.Abs(x1 - xx1) < 1);
            Trace.Assert(Math.Abs(y1 - yy1) < 1);
            Trace.Assert(Math.Abs(x2 - xx2) < 1);
            Trace.Assert(Math.Abs(y2 - yy2) < 1);
#endif

            return(area);
        }
        private DensityArea ComputeAreaFromXYPixCoords(
			TangentalNormalizedDirectionAstrometry astrometry,
			double x1, double y1, double x2, double y2,
            List<ulong> alwaysIncludeStars)
        {
            double ra1, de1, ra2, de2;
            astrometry.GetRADEFromImageCoords(x1, y1, out ra1, out de1);
            astrometry.GetRADEFromImageCoords(x2, y2, out ra2, out de2);
            DensityArea area = new DensityArea(astrometry, MAX_STARS_IN_AREA, ra1, ra2, de1, de2, alwaysIncludeStars);
            area.DebugResolvedStarsWithAppliedExclusions = DebugResolvedStarsWithAppliedExclusions;

            #if ASTROMETRY_DEBUG
            Trace.Assert(Math.Abs(area.XFrom - x1) < 1);
            Trace.Assert(Math.Abs(area.XTo - x2) < 1);
            Trace.Assert(Math.Abs(area.YFrom - y1) < 1);
            Trace.Assert(Math.Abs(area.YTo - y2) < 1);
            #endif

            double xx1, yy1, xx2, yy2;
            astrometry.GetImageCoordsFromRADE(area.RAFrom, area.DEFrom, out xx1, out yy1);
            astrometry.GetImageCoordsFromRADE(area.RATo, area.DETo, out xx2, out yy2);

            #if ASTROMETRY_DEBUG
            Trace.Assert(Math.Abs(area.XFrom - xx1) < 1);
            Trace.Assert(Math.Abs(area.YFrom - yy1) < 1);
            Trace.Assert(Math.Abs(area.XTo - xx2) < 1);
            Trace.Assert(Math.Abs(area.YTo - yy2) < 1);

            Trace.Assert(Math.Abs(x1 - xx1) < 1);
            Trace.Assert(Math.Abs(y1 - yy1) < 1);
            Trace.Assert(Math.Abs(x2 - xx2) < 1);
            Trace.Assert(Math.Abs(y2 - yy2) < 1);
            #endif

            return area;
        }