/// <summary> /// In place time slip /// </summary> /// <param name="c">Coordinate</param> /// <param name="offset">hour offset</param> private void Local_Convert(Coordinate c, double offset) { //Find new lunar set rise times if (MoonSet.HasValue) { moonSet = moonSet.Value.AddHours(offset); } if (MoonRise.HasValue) { moonRise = moonRise.Value.AddHours(offset); } //Perigee Perigee.ConvertTo_Local_Time(offset); //Apogee Apogee.ConvertTo_Local_Time(offset); //Eclipse LunarEclipse.ConvertTo_LocalTime(offset); ////Solar if (sunSet.HasValue) { sunSet = sunSet.Value.AddHours(offset); } if (SunRise.HasValue) { sunRise = SunRise.Value.AddHours(offset); } AdditionalSolarTimes.Convert_To_Local_Time(offset); //Eclipse SolarEclipse.ConvertTo_LocalTime(offset); SunCalc.CalculateZodiacSign(c.GeoDate.AddHours(offset), this); MoonCalc.GetMoonSign(c.GeoDate.AddHours(offset), this); }
/// <summary> /// Calculates all celestial data. Coordinates will notify as changes occur /// </summary> /// <param name="lat">Decimal format latitude</param> /// <param name="longi">Decimal format longitude</param> /// <param name="date">Geographic DateTime</param> internal void CalculateCelestialTime(double lat, double longi, DateTime date) { date = new DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, DateTimeKind.Utc); SunCalc.CalculateSunTime(lat, longi, date, this); MoonCalc.GetMoonTimes(date, lat, longi, this); MoonCalc.GetMoonDistance(date, this); SunCalc.CalculateZodiacSign(date, this); MoonCalc.GetMoonSign(date, this); MoonCalc.GetMoonIllumination(date, this, lat, longi); perigee = MoonCalc.GetPerigeeEvents(date); apogee = MoonCalc.GetApogeeEvents(date); Calculate_Celestial_IsUp_Booleans(date, this); }
/// <summary> /// In place time slip /// </summary> /// <param name="c">Coordinate</param> /// <param name="offset">hour offset</param> /// <param name="el">Celestial EagerLoad Option</param> private void Local_Convert(Coordinate c, double offset, Celestial_EagerLoad el) { //Find new lunar set rise times if (el == Celestial_EagerLoad.All || el == Celestial_EagerLoad.Lunar) { if (MoonSet.HasValue) { moonSet = moonSet.Value.AddHours(offset); } if (MoonRise.HasValue) { moonRise = moonRise.Value.AddHours(offset); } Perigee.ConvertTo_Local_Time(offset); Apogee.ConvertTo_Local_Time(offset); LunarEclipse.ConvertTo_LocalTime(offset); MoonCalc.GetMoonSign(c.GeoDate.AddHours(offset), this); } ////Solar if (el == Celestial_EagerLoad.All || el == Celestial_EagerLoad.Solar) { if (sunSet.HasValue) { sunSet = sunSet.Value.AddHours(offset); } if (SunRise.HasValue) { sunRise = SunRise.Value.AddHours(offset); } AdditionalSolarTimes.Convert_To_Local_Time(offset); //Eclipse SolarEclipse.ConvertTo_LocalTime(offset); SunCalc.CalculateZodiacSign(c.GeoDate.AddHours(offset), this); } }