Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomMoonEvent ¶
type CustomMoonEvent struct {
Name string
BeforeTransit bool
Elevation func(todayData MoonPosition) float64
}
CustomMoonEvent is the custom event when Moon reach the specified elevation angle.
type CustomSunEvent ¶
type CustomSunEvent struct {
Name string
BeforeTransit bool
Elevation func(todayData SunPosition) float64
}
CustomSunEvent is the custom event when Sun reach the specified elevation angle.
type Location ¶
type Location struct {
Latitude float64
Longitude float64
Elevation float64
Temperature float64
Pressure float64
}
Location is coordinate and data for the location where Sun and Moon position will be calculated.
type MoonEvents ¶
type MoonEvents struct {
Transit MoonPosition
Moonrise MoonPosition
Moonset MoonPosition
Others map[string]MoonPosition
}
MoonEvents is the positions of Moon when rise, set, transit, and reached custom elevation angles.
func GetMoonEvents ¶
func GetMoonEvents(date time.Time, loc Location, opts *Options, customEvents ...CustomMoonEvent) (MoonEvents, error)
GetMoonEvents calculates the time when Moon rise, set, transit, and reached elevation angles that defined by `CustomMoonEvent`.
type MoonPhases ¶
type MoonPhases struct {
NewMoon time.Time
FirstQuarter time.Time
FullMoon time.Time
LastQuarter time.Time
NextNewMoon time.Time
MonthLength float64
}
MoonPhases is times when Moon reach its phases.
func GetMoonPhases ¶
func GetMoonPhases(dt time.Time, opts *Options) MoonPhases
GetMoonPhases calculate the time for Moon phases around the specified date time. It uses timezone in `dt` for the location, so adjust it properly.
type MoonPosition ¶
type MoonPosition struct {
DateTime time.Time
JulianDay float64
GeocentricLongitude float64
GeocentricLatitude float64
GeocentricDistance float64
HorizontalParallax float64
NutationLongitude float64
NutationObliquity float64
EclipticTrueObliquity float64
ApparentLongitude float64
MeanSiderealTime float64
ApparentSiderealTime float64
GeocentricRightAscension float64
GeocentricDeclination float64
ObserverLocalHourAngle float64
RightAscensionParallax float64
TopocentricRightAscension float64
TopocentricDeclination float64
TopocentricLocalHourAngle float64
TopocentricElevationAngle float64
TopocentricZenithAngle float64
TopocentricAstroAzimuthAngle float64
TopocentricAzimuthAngle float64
Elongation float64
PercentIlluminated float64
MoonSunAngle float64
Phase MoonPhase
}
MoonPosition is the result from calculating Moon position.
func GetMoonPosition ¶
GetMoonPosition calculates the Moon position for the specified location and date time.
func (MoonPosition) IsZero ¶
func (mp MoonPosition) IsZero() bool
IsZero reports whether Moon position is empty or not.
type SunEvents ¶
type SunEvents struct {
Transit SunPosition
Sunrise SunPosition
Sunset SunPosition
Others map[string]SunPosition
}
SunEvents is the positions of Sun when rise, set, transit, and reached custom elevation angles.
func GetSunEvents ¶
func GetSunEvents(date time.Time, loc Location, opts *Options, customEvents ...CustomSunEvent) (SunEvents, error)
GetSunEvents calculates the time when Sun rise, set, transit, and reached elevation angles that defined by `CustomSunEvent`.
type SunPosition ¶
type SunPosition struct {
DateTime time.Time
JulianDay float64
EarthHeliocentricLongitude float64
EarthHeliocentricLatitude float64
EarthRadiusVector float64
GeocentricLongitude float64
GeocentricLatitude float64
NutationLongitude float64
NutationObliquity float64
EclipticTrueObliquity float64
AbberationCorrection float64
ApparentLongitude float64
MeanSiderealTime float64
ApparentSiderealTime float64
GeocentricRightAscension float64
GeocentricDeclination float64
ObserverLocalHourAngle float64
RightAscensionParallax float64
TopocentricRightAscension float64
TopocentricDeclination float64
TopocentricLocalHourAngle float64
TopocentricElevationAngle float64
TopocentricZenithAngle float64
TopocentricAstroAzimuthAngle float64
TopocentricAzimuthAngle float64
SurfaceIncidenceAngle float64
}
SunPosition is the result from calculating Sun position.
func GetSunPosition ¶
GetSunPosition calculates the Sun position for the specified location and date time.
func (SunPosition) IsZero ¶
func (sp SunPosition) IsZero() bool
IsZero reports whether Sun position is empty or not.