CelestialCalculateCelestialTimes(Double, Double, DateTime, EagerLoad, Double) Method

Calculate celestial data based on latitude, longitude and UTC date with hours offset at the location.

Definition

Namespace: CoordinateSharp
Assembly: CoordinateSharp (in CoordinateSharp.dll) Version: 2.21.1.1
XMLNS for XAML: Not mapped to an xmlns.
C#
public static Celestial CalculateCelestialTimes(
	double lat,
	double longi,
	DateTime date,
	EagerLoad el,
	double offset
)

Parameters

lat  Double
Decimal format latitude
longi  Double
Decimal format longitude
date  DateTime
Geographic DateTime
el  EagerLoad
EagerLoad
offset  Double
Offset hours

Return Value

Celestial
Celestial

Example

The following example demonstrates how to create a fully populated Celestial object in local time using static functions using solar cycle only eager loading.
C#
// Set EagerLoading parameters to only load solar cycle data for maximum efficiency
EagerLoad el = new EagerLoad(EagerLoadType.Celestial);
el.Extensions = new EagerLoad_Extensions(EagerLoad_ExtensionsType.Solar_Cycle);

//Get Celestial data at N 39, W 72 on 19-Mar-2019 10:10:12 Local using Pacific Standard Time offset in hours (-7)
Celestial cel = Celestial.CalculateCelestialTimes(39, -72, new DateTime(2019, 3, 19, 10, 10, 12), el, -7);
Console.WriteLine(cel.SunRise); //03:54:50 AM

See Also