Esempio n. 1
0
 public SkyObject(Blob blob)
 {
     CatEntry = null;
     ObjectBlob = blob;
     Name = "";
     Position = new SkyVector(new HourAngle(), new Angle());
 }
Esempio n. 2
0
 public CatalogEntry(string name, string altName, string saoNum, string gcNum, SkyVector position)
 {
     Name = name;
     AltName = altName;
     SAO = saoNum;
     GC = gcNum;
     Position = position;
 }
Esempio n. 3
0
        public bool IsNearPosition(SkyVector position, SkyVector error)
        {
            double ra = position.RA.Degrees.Fractional;
            double de = position.DE.Fractional;

            double localRa = Position.RA.Degrees.Fractional;
            double localDe = Position.DE.Fractional;
            
            double raError = error.RA.Degrees.Fractional;
            double deError = error.DE.Fractional;

            double raDiff = Math.Abs(ra - localRa);
            double deDiff = Math.Abs(de - localDe);

            bool result = (raDiff <= raError) & (deDiff <= deError);
            return result;
        }
Esempio n. 4
0
 public bool GetStarAtPosition(SkyVector position, double raError, double deError, out SAOEntry entry)
 {
     return GetStarAtPosition(position.RA, position.DE, raError, deError, out entry);
 }
Esempio n. 5
0
 public SkyObject(SkyVector position, Blob blob)
 {
     Position = position;
     ObjectBlob = blob;
 }
Esempio n. 6
0
 public SkyObject(string name, SkyVector position, Blob blob)
 {
     Name = name;
     Position = position;
     ObjectBlob = blob;
 }
Esempio n. 7
0
        /// <summary>
        /// Automatically identifies objects in the image based on their locations. Requires two objects to be identified manually.
        /// </summary>
        /// <param name="unidentified">A list of objects that could not be identified.</param>
        /// <returns>Returns true if there are enough starter IDs. Otherwise returns false.</returns>
        public bool AutoIdentify(out SkyObject[] unidentified)
        {
            List<SkyObject> unid = new List<SkyObject>();

            SkyObject a, b;
            a = b = null;

            for (int i = 0; i < objects.Count; i++)
            {
                if (objects[i].CatEntry != null)
                {
                    if (a == null)
                        a = objects[i];
                    else if (b == null)
                        b = objects[i];
                    else
                        break;
                }
            }

            if (b == null)
            {
                unidentified = null;
                return false;
            }

            PointVector pA = new PointVector(a.Location);
            PointVector pB = new PointVector(b.Location);
            PointVector pDiff = pA - pB;

            SkyVector sA = a.CatEntry.Position;
            SkyVector sB = b.CatEntry.Position;
            SkyVector sDiff = sA - sB;

            double xScaleLength = sDiff.RA.Degrees.Fractional / pDiff.X;
            double yScaleLength = sDiff.DE.Fractional / pDiff.Y;

            for (int i = 0; i < objects.Count; i++)
            {
                if (objects[i].CatEntry != null)
                    continue;

                PointVector pObj = new PointVector(objects[i].Location);
                PointVector pObjDiff = pA - pObj;

                double xScaleDiff = xScaleLength * pObjDiff.X;
                double yScaleDiff = yScaleLength * pObjDiff.Y;
                SkyVector scaleDiff = new SkyVector(new HourAngle(xScaleDiff), yScaleDiff);

                SkyVector objPos = sA - scaleDiff;

                // Try to find star in catalog
                CatalogEntry entry;
                if (Program.GC.GetStarAtPosition(objPos, 0.025f, 0.025f, out entry))
                {
                    objects[i].CatEntry = entry;
                }
                else
                {
                    objects[i].Position = objPos;
                    unid.Add(objects[i]);
                }
            }

            unidentified = unid.ToArray();
            return true;
        }