LunarHorizonEventSequence

class LunarHorizonEventSequence(start: Instant, latitude: Double, longitude: Double, limit: Duration = 365.days, requestedHorizonEvents: List<LunarEvent.HorizonEvent.HorizonEventType> = LunarEvent.HorizonEvent.all, reverse: Boolean = false) : Sequence<LunarEvent.HorizonEvent>

Sequence representing all LunarEvent.HorizonEvents supported by Kastro. The sequence will be ordered by LunarEvent.time either advancing forwards or backwards in time depending on the reverse parameter.

As implied by being a Sequence values will be lazily calculated so setting a large or even infinite limit is acceptable.

Parameters

start

Time representing the beginning of the sequence

latitude

Latitude of the observer in degrees

longitude

Longitude of the observer in degrees

limit

Point at which the sequence will end. If you wish for an infinite sequence simply put Duration.INFINITE for limit. Calculations are done lazily so requesting an infinite sequence is not harmful. Limit only exists to allow certain logical checks such as if you wanted to know if there will be any event in the next hour you could use limit and then check if the resulting sequence is empty. Defaults to 365 days.

requestedHorizonEvents

A List of LunarEvent.HorizonEvent.HorizonEventTypes to calculate event times for.

reverse

Whether the sequence should advance in reverse chronological order. By default, this is false

Constructors

Link copied to clipboard
constructor(start: Instant, location: Pair<Double, Double>, limit: Duration = 365.days, requestedHorizonEvents: List<LunarEvent.HorizonEvent.HorizonEventType> = LunarEvent.HorizonEvent.all, reverse: Boolean = false)

Alternative constructor with location as a Pair. Provided as a convenience. See primary constructor for more information

constructor(start: Instant, latitude: Double, longitude: Double, limit: Duration = 365.days, requestedHorizonEvents: List<LunarEvent.HorizonEvent.HorizonEventType> = LunarEvent.HorizonEvent.all, reverse: Boolean = false)

Functions

Link copied to clipboard
open operator override fun iterator(): Iterator<LunarEvent.HorizonEvent>