Beispiel #1
0
        public FormTargetPath(DailyPosition dp, DailyPosition mp, string targetName, string moonDataDescription)
        {
            //Windows Form to show path of target over one imaging session (one night) in graphical form
            InitializeComponent();
            string   tName         = targetName;
            DateTime localtoday    = dp.UTCdate.ToLocalTime();
            DateTime localtomorrow = dp.UTCdate.ToLocalTime().AddDays(1);

            this.Text = tName + ": " + "Altitude on night of " + localtoday.ToString("MMM dd") + " / " + localtomorrow.ToString("MMM dd");

            if (dp.Visibility == DailyPosition.VisibilityState.UpNever)
            { //Can//t get a rise out of it
                return;
            }
            else
            {
                //Graph altitude for both target and moon with the start and end set by the target duration
                GraphAltitude(dp.Rising, dp.Setting, dp.Position, dp.Location, "AltitudePath", Color.AliceBlue);
                GraphAltitude(dp.Rising, dp.Setting, mp.Position, dp.Location, "MoonPath", Color.Yellow);
            }
            string lineBreak = "\r\n" + "Moon Phases";

            this.MoonDataTextBox.Text = moonDataDescription.Replace("\r\n", "     ");
            this.MoonDataTextBox.Text = MoonDataTextBox.Text.Replace("Moon Phase", lineBreak);
            return;
        }
Beispiel #2
0
        //Write detail data for (individual cells as tool tips for (cursor hover
        public void WriteToolTip(int iRow, int jCol, DailyPosition dpt)
        {
            string tiptext = "Start Imaging: " + dpt.Rising.ToLocalTime().ToString("t") + "\r\n" +
                             "End Imaging: " + dpt.Setting.ToLocalTime().ToString("t") + "\r\n" +
                             "Moon Up: " + ((1 - dpt.MoonFree) * 100).ToString("0") + "%" + "\r\n" +
                             "Moon Phase: " + (dpt.MoonPhase * 100).ToString("0") + "%" + "\r\n";

            MonthCalendar.Rows[iRow].Cells[jCol].ToolTipText = tiptext;
            return;
        }
Beispiel #3
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;
        }
Beispiel #4
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);
 }
Beispiel #5
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);
 }
Beispiel #6
0
 public static DailyPosition[] TargetCycle(Celestial.RADec tgtRADec, DailyPosition[] sunspots, Celestial.LatLon obsLocation, double minalt)
 {
     //Calculate an array of dailypositions for dark periods of the given target (as an RA/Dec object)
     DailyPosition[] tgtspots = new DailyPosition[sunspots.Length];
     for (int dayidx = 0; dayidx < sunspots.Length - 1; dayidx++)
     {
         tgtspots[dayidx] = new DailyPosition(sunspots[dayidx].Setting,
                                              sunspots[dayidx + 1].Rising,
                                              tgtRADec,
                                              obsLocation,
                                              minalt);
     }
     tgtspots[tgtspots.Length - 1] = new DailyPosition();
     tgtspots[sunspots.Length - 1] = tgtspots[sunspots.Length - 2];
     return(tgtspots);
 }
Beispiel #7
0
        //public methods for managing the daily position functions
        //SunCycle generates a year of sunrise and sunset events
        //TargetCycle generates a year of target rise and set events (within sunrise-sunset)
        //MoonCycle generates a year of moon rise and set events (within target rise-set)
        //MoonPhase adds phase to target events
        //Moonclear adds moonless percentage to target events

        public static DailyPosition[] SunCycle(int dYear, Celestial.LatLon obsLocation)
        {
            //Calculates a year//s worth of sunrises and sunsets
            const double twilight = -18; //(degrees)

            DailyPosition[] sunspots = new DailyPosition[367];
            Celestial.RADec sunpos;

            DateTime ndate = new DateTime(dYear, 1, 1, 0, 0, 0); //create datetime object for jan 1, dYear
            DateTime udate = ndate.ToUniversalTime();            //convert to UTC
            DateTime sdate = udate.AddDays(-1);                  //back up one day to make sure Jan 1 is covered

            for (int dayidx = 0; dayidx < sunspots.Length; dayidx++)
            {
                DateTime tdate = sdate.AddDays(dayidx);
                sunpos           = DailyPosition.SunRADec(Celestial.DateToJ2kC(tdate));
                sunspots[dayidx] = new DailyPosition(tdate,
                                                     tdate.AddDays(1),
                                                     sunpos,
                                                     obsLocation,
                                                     twilight);
            }
            return(sunspots);
        }