예제 #1
0
        public FormTargetTrack(DailyPosition dp, DailyPosition mp, string targetNameS)
        {
            InitializeComponent();
            targetName = targetNameS;

            tgtDateUTC   = dp.UTCdate;
            moonDateUTC  = mp.iRise;
            tgtUpH       = dp.Rising.ToLocalTime().Hour + (dp.Rising.ToLocalTime().Minute / 60.0);
            tgtDownH     = dp.Setting.ToLocalTime().Hour + (dp.Setting.ToLocalTime().Minute / 60.0);
            tgtDecD      = 90.0 - Transform.RadiansToDegrees(dp.Position.Dec);
            tgtPosition  = dp.Position;
            MoonPosition = mp.Position;
            obsLocation  = dp.Location;
            //Set lat
            obsLatD = Transform.RadiansToDegrees(dp.Location.Lat);

            //Moon look up stuff
            Celestial.RADec moonRADec = DailyPosition.MoonRaDec(Celestial.DateToJ2kC(dp.UTCdate));
            moonDecD = 90 - Transform.RadiansToDegrees(mp.Position.Dec);
            //Get the rise/set times from TSX
            sky6StarChart         tsxs = new sky6StarChart();
            sky6ObjectInformation tsxo = new sky6ObjectInformation();

            //Set the date/time to the local date for the target
            tsxs.SetDocumentProperty(Sk6DocumentProperty.sk6DocProp_JulianDateNow, Celestial.DateToJulian(tgtDateUTC));

            //Get some target stuff that's hard to calculate
            tsxs.Find(targetName);
            //wait a second
            System.Threading.Thread.Sleep(500);
            tsxo.Property(Sk6ObjectInformationProperty.sk6ObjInfoProp_TRANSIT_TIME);
            tgtTransitH = tsxo.ObjInfoPropOut;

            //Test stuff
            //double testmoontransitH = MoonPosition.TransitTime(tgtDateUTC, obsLocation);

            //Get some moon stuff now
            tsxs.SetDocumentProperty(Sk6DocumentProperty.sk6DocProp_JulianDateNow, Celestial.DateToJulian(moonDateUTC));
            tsxs.Find("Moon");
            //wait a second
            System.Threading.Thread.Sleep(500);
            tsxo.Property(Sk6ObjectInformationProperty.sk6ObjInfoProp_RISE_TIME);
            moonRiseH = tsxo.ObjInfoPropOut;
            tsxo.Property(Sk6ObjectInformationProperty.sk6ObjInfoProp_SET_TIME);
            moonSetH = tsxo.ObjInfoPropOut;
            //put the target back in
            tsxs.Find(targetName);

            tsxs = null;
            tsxo = null;
            return;
        }
예제 #2
0
 public static DailyPosition[] MoonPhase(DailyPosition[] tgtdata)
 {
     //Computes moon phase for each date in tgtdata
     Celestial.RADec sunradec;
     Celestial.RADec moonradec;
     foreach (DailyPosition dp in tgtdata)
     {
         sunradec  = DailyPosition.SunRADec(Celestial.DateToJ2kC(dp.UTCdate));
         moonradec = DailyPosition.MoonRaDec(Celestial.DateToJ2kC(dp.UTCdate));
         dp.SetMoonPhase(sunradec.RA, moonradec.RA);
     }
     return(tgtdata);
 }
예제 #3
0
 public static DailyPosition[] MoonCycle(DailyPosition[] tgtspots, Celestial.LatLon obsLocation)
 {
     //Calculate an array of dailypositions of intervals when the moon is above the horizon
     DailyPosition[] moonedspots = new DailyPosition[tgtspots.Length];
     for (int dayidx = 0; dayidx < tgtspots.Length; dayidx++)
     {
         moonedspots[dayidx] = new DailyPosition(tgtspots[dayidx].Rising,
                                                 tgtspots[dayidx].Setting,
                                                 DailyPosition.MoonRaDec(Celestial.DateToJ2kC(tgtspots[dayidx].Rising)),
                                                 obsLocation,
                                                 0);
     }
     return(moonedspots);
 }