//When a rise or a set does not occur, the DateTime will return null /// <summary> /// Creates an empty Celestial. /// </summary> public Celestial() { astrologicalSigns = new AstrologicalSigns(); lunarEclipse = new LunarEclipse(); solarEclipse = new SolarEclipse(); CalculateCelestialTime(0, 0, new DateTime(1900, 1, 1, 0, 0, 0, DateTimeKind.Utc), new EagerLoad()); }
/// <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); }
//When as rise or a set does not occur, the DateTime will return null /// <summary> /// Creates an empty Celestial object /// </summary> public Celestial() { AstrologicalSigns = new AstrologicalSigns(); LunarEclipse = new LunarEclipse(); SolarEclipse = new SolarEclipse(); CalculateCelestialTime(0, 0, new DateTime(1900, 1, 1, 0, 0, 0, DateTimeKind.Utc)); }
//Creates empty properties private void Create_Properties() { astrologicalSigns = new AstrologicalSigns(); lunarEclipse = new LunarEclipse(); solarEclipse = new SolarEclipse(); solstices = new Solstices(); equinoxes = new Equinoxes(); }
/// <summary> /// Creates a Celestial object based on a location and specified date. /// </summary> /// <param name="lat">latitude</param> /// <param name="longi">longitude</param> /// <param name="geoDate">DateTime (UTC)</param> /// <remarks> /// Celestial information is normally populated within the Coordinate classes CelestialInfo property. /// However, you may choose to work directly within the Celestial class. /// </remarks> /// <example> /// The following example demonstrates how to get the sunset time at Seattle on 19-Mar-2019 /// directly from a Celestial object. /// <code> /// //Create a Celestial object the calculates from Seattle's signed lat/long on /// //19-Mar-2019 (UTC) Date /// Celestial cel = new Celestial(47.60357, -122.32945, new DateTime(2019, 3, 19)); /// /// //Check if a sunset will occur on the specified day. /// if(cel.SunSet.HasValue) /// { /// Console.WriteLine(cel.SunSet.Value); //3/19/2019 2:19:31 AM /// } /// </code> /// </example> public Celestial(double lat, double longi, DateTime geoDate) { DateTime d = new DateTime(geoDate.Year, geoDate.Month, geoDate.Day, geoDate.Hour, geoDate.Minute, geoDate.Second, DateTimeKind.Utc); astrologicalSigns = new AstrologicalSigns(); lunarEclipse = new LunarEclipse(); solarEclipse = new SolarEclipse(); CalculateCelestialTime(lat, longi, d, new EagerLoad()); }
/// Holdover. Determine if needed. internal Celestial(bool hasCalcs) { astrologicalSigns = new AstrologicalSigns(); lunarEclipse = new LunarEclipse(); solarEclipse = new SolarEclipse(); if (hasCalcs) { CalculateCelestialTime(0, 0, new DateTime(1900, 1, 1, 0, 0, 0, DateTimeKind.Utc), new EagerLoad()); } }
private Celestial(bool hasCalcs) { AstrologicalSigns = new AstrologicalSigns(); LunarEclipse = new LunarEclipse(); SolarEclipse = new SolarEclipse(); if (hasCalcs) { CalculateCelestialTime(0, 0, new DateTime(1900, 1, 1, 0, 0, 0, DateTimeKind.Utc)); } }
/// <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); } }