public void Seasons() { // 2 min error const double error = 2.0 / (24 * 60); // example 26.a { double jd = SolarEphem.Season(new Date(1962, 1, 1).ToJulianDay(), Season.Summer); Assert.AreEqual(2437837.39245, jd, error); } { double jd = SolarEphem.Season(new Date(1991, 1, 1).ToJulianDay(), Season.Spring); Assert.AreEqual(new Date(new DateTime(1991, 3, 21, 3, 2, 54, DateTimeKind.Utc)).ToJulianEphemerisDay(), jd, error); } { double jd = SolarEphem.Season(new Date(1991, 1, 1).ToJulianDay(), Season.Summer); Assert.AreEqual(new Date(new DateTime(1991, 6, 21, 21, 19, 46, DateTimeKind.Utc)).ToJulianEphemerisDay(), jd, error); } { double jd = SolarEphem.Season(new Date(1991, 1, 1).ToJulianDay(), Season.Autumn); Assert.AreEqual(new Date(new DateTime(1991, 9, 23, 12, 49, 04, DateTimeKind.Utc)).ToJulianEphemerisDay(), jd, error); } { double jd = SolarEphem.Season(new Date(1991, 1, 1).ToJulianDay(), Season.Winter); Assert.AreEqual(new Date(new DateTime(1991, 12, 22, 8, 54, 38, DateTimeKind.Utc)).ToJulianEphemerisDay(), jd, error); } }
public ICollection <AstroEvent> EventsSeasons(AstroEventsContext context) { List <AstroEvent> events = new List <AstroEvent>(); for (double jd = context.From; jd < context.To; jd += 365) { events.Add(new AstroEvent(SolarEphem.Season(jd, Season.Spring), Text.Get("SunEvents.Seasons.Spring"))); events.Add(new AstroEvent(SolarEphem.Season(jd, Season.Summer), Text.Get("SunEvents.Seasons.Summer"))); events.Add(new AstroEvent(SolarEphem.Season(jd, Season.Autumn), Text.Get("SunEvents.Seasons.Autumn"))); events.Add(new AstroEvent(SolarEphem.Season(jd, Season.Winter), Text.Get("SunEvents.Seasons.Winter"))); } return(events); }
public ICollection <AstroEvent> EventsSeasons(AstroEventsContext context) { List <AstroEvent> events = new List <AstroEvent>(); for (double jd = context.From; jd < context.To; jd += 365) { // check for cancel if (context.CancelToken?.IsCancellationRequested == true) { return(new AstroEvent[0]); } events.Add(new AstroEvent(SolarEphem.Season(jd, Season.Spring), Text.Get("SunEvents.Seasons.Spring"))); events.Add(new AstroEvent(SolarEphem.Season(jd, Season.Summer), Text.Get("SunEvents.Seasons.Summer"))); events.Add(new AstroEvent(SolarEphem.Season(jd, Season.Autumn), Text.Get("SunEvents.Seasons.Autumn"))); events.Add(new AstroEvent(SolarEphem.Season(jd, Season.Winter), Text.Get("SunEvents.Seasons.Winter"))); } return(events); }
private Date Seasons(SkyContext c, Season s) { return(c.GetDate(SolarEphem.Season(c.JulianDay, s))); }