License | AGPL-3 |
---|---|
Maintainer | swiss-ephemeris@lfborjas.com |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
- Classes for general concepts
- Fundamental aliases/newtypes
- Fundamental enumerations
- Coordinate/position systems
- Information about the ecliptic at a point in time
- Information about an Eclipse
- Management of data files
- Core calculations
- Utilities for coordinate transformation
- Utilities for sidereal information
- Utilities for display/splitting
- Planetary Phenomena
- Crossings over a longitude
- Eclipses
- Changes of direction
- Moon phases
Exposes types and functions that mirror the rich functionality of Swiss Ephemeris.
Currently only certain bodies are exposed as data constructors, same for the major house systems. This is for the sake of simplicity
only, if you need more, please refer to the bundled header files in csrc
.
You'll need to procure ephemeris files (see the official site, linked above) if you wish to obtain positions for planets outside of the main planetary bodies in the solar system, or before 3000 B.C or after 3000 A.D. For example, the test suite uses a small ephemeris that includes data for the asteroid Chiron, which is astrologically relevant in most modern practices.
Currently, only a few select functions that are useful for western horoscopy are exported. There's a wealth of other calculations possible with the underlying library, however, please refer to their documentation and thebundled sources for ideas!
Synopsis
- class Eq a => HasEclipticLongitude a where
- getEclipticLongitude :: a -> Double
- type HouseCusp = Double
- data SplitDegreesOption
- data Planet
- data HouseSystem
- data ZodiacSignName
- data NakshatraName
- data EventSearchDirection
- data PlanetMotion
- data LunarPhaseName
- data EclipticPosition = EclipticPosition {}
- data EquatorialPosition = EquatorialPosition {}
- data GeographicPosition = GeographicPosition {}
- data HousePosition = HousePosition {}
- data ObliquityInformation = ObliquityInformation {}
- data Angles = Angles {}
- data CuspsCalculation = CuspsCalculation {
- houseCusps :: [HouseCusp]
- angles :: Angles
- systemUsed :: HouseSystem
- data LongitudeComponents = LongitudeComponents {}
- data SolarEclipseInformation = SolarEclipseInformation {
- solarEclipseType :: SolarEclipseType
- solarEclipseMax :: JulianDayUT1
- solarEclipseNoon :: JulianDayUT1
- solarEclipseBegin :: JulianDayUT1
- solarEclipseEnd :: JulianDayUT1
- solarEclipseTotalityBegin :: JulianDayUT1
- solarEclipseTotalityEnd :: JulianDayUT1
- solarEclipseCenterLineBegin :: JulianDayUT1
- solarEclipseCenterLineEnd :: JulianDayUT1
- data SolarEclipseType
- data LunarEclipseInformation = LunarEclipseInformation {
- lunarEclipseType :: LunarEclipseType
- lunarEclipseMax :: JulianDayUT1
- lunarEclipsePartialPhaseBegin :: JulianDayUT1
- lunarEclipsePartialPhaseEnd :: JulianDayUT1
- lunarEclipseTotalityBegin :: JulianDayUT1
- lunarEclipseTotalityEnd :: JulianDayUT1
- lunarEclipsePenumbralPhaseBegin :: JulianDayUT1
- lunarEclipsePenumbralPhaseEnd :: JulianDayUT1
- data LunarEclipseType
- setEphemeridesPath :: FilePath -> IO ()
- setNoEphemeridesPath :: IO ()
- closeEphemerides :: IO ()
- withEphemerides :: FilePath -> IO a -> IO a
- withoutEphemerides :: IO a -> IO a
- calculateEclipticPosition :: JulianDayUT1 -> Planet -> IO (Either String EclipticPosition)
- calculateEquatorialPosition :: JulianDayUT1 -> Planet -> IO (Either String EquatorialPosition)
- calculateObliquity :: JulianDayUT1 -> IO (Either String ObliquityInformation)
- calculateCusps :: HouseSystem -> JulianDayUT1 -> GeographicPosition -> IO CuspsCalculation
- calculateCuspsLenient :: HouseSystem -> JulianDayUT1 -> GeographicPosition -> IO CuspsCalculation
- calculateCuspsStrict :: HouseSystem -> JulianDayUT1 -> GeographicPosition -> IO (Either String CuspsCalculation)
- equatorialToEcliptic :: ObliquityInformation -> EquatorialPosition -> EclipticPosition
- eclipticToEquatorial :: ObliquityInformation -> EclipticPosition -> EquatorialPosition
- calculateHousePosition :: HouseSystem -> Double -> GeographicPosition -> ObliquityInformation -> EclipticPosition -> IO (Either String HousePosition)
- calculateHousePositionSimple :: HouseSystem -> JulianDayUT1 -> GeographicPosition -> EclipticPosition -> IO (Either String HousePosition)
- defaultSplitDegreesOptions :: [SplitDegreesOption]
- splitDegrees :: [SplitDegreesOption] -> Double -> LongitudeComponents
- splitDegreesZodiac :: Double -> LongitudeComponents
- planetaryPhenomenon :: SingTSI ts => Planet -> JulianDay ts -> IO (Either String PlanetPhenomenon)
- planetaryPhenomenonRaw :: SingTSI ts => JulianDay ts -> PlanetNumber -> CalcFlag -> IO (Either String [Double])
- sunCrossing :: SingTSI ts => Double -> JulianDay ts -> IO (Either String (JulianDay ts))
- sunCrossingBetween :: SingTSI ts => Double -> JulianDay ts -> JulianDay ts -> IO (Either String (JulianDay ts))
- moonCrossing :: SingTSI ts => Double -> JulianDay ts -> IO (Either String (JulianDay ts))
- moonCrossingBetween :: SingTSI ts => Double -> JulianDay ts -> JulianDay ts -> IO (Either String (JulianDay ts))
- moonCrossingNode :: SingTSI ts => JulianDay ts -> IO (Either String (JulianDay ts, Double, Double))
- heliocentricCrossing :: SingTSI ts => EventSearchDirection -> Planet -> Double -> JulianDay ts -> IO (Either String (JulianDay ts))
- crossingBetween :: SingTSI ts => Planet -> Double -> JulianDay ts -> JulianDay ts -> IO (Either String (JulianDay ts))
- nextSolarEclipse :: [SolarEclipseType] -> EventSearchDirection -> JulianDayUT1 -> IO (Either String SolarEclipseInformation)
- nextSolarEclipseWhen :: [SolarEclipseType] -> EventSearchDirection -> JulianDayUT1 -> IO (Either String (SolarEclipseType, JulianDayUT1))
- nextSolarEclipseWhere :: JulianDayUT1 -> IO (Either String GeographicPosition)
- nextLunarEclipse :: [LunarEclipseType] -> EventSearchDirection -> JulianDayUT1 -> IO (Either String LunarEclipseInformation)
- nextLunarEclipseWhen :: [LunarEclipseType] -> EventSearchDirection -> JulianDayUT1 -> IO (Either String (LunarEclipseType, JulianDayUT1))
- directionChangeBetween :: SingTSI ts => Planet -> JulianDay ts -> JulianDay ts -> IO (Either String (JulianDay ts, PlanetMotion))
- nextDirectionChange :: SingTSI ts => Planet -> JulianDay ts -> IO (Either String (JulianDay ts, PlanetMotion))
- moonPhaseExactAt :: SingTSI ts => LunarPhaseName -> JulianDay ts -> JulianDay ts -> IO (Either String (JulianDay ts))
- module SwissEphemeris.Time
Classes for general concepts
class Eq a => HasEclipticLongitude a where Source #
For objects that can be placed along the ecliptic in a 1-dimensional "longitude-only" manner.
getEclipticLongitude :: a -> Double Source #
Instances
HasEclipticLongitude EclipticPosition Source # | |
Defined in SwissEphemeris.Internal | |
(Real a, Eq a) => HasEclipticLongitude (EphemerisPosition a) Source # | |
Defined in SwissEphemeris.Precalculated |
Fundamental aliases/newtypes
type HouseCusp = Double Source #
The cusp of a given "house" or "sector". It is an ecliptic longitude. see: 14.1 House cusp calculation and 6.2 Astrological house systems
Fundamental enumerations
data SplitDegreesOption Source #
Options to split a Double
representing degrees:
RoundSeconds -- round at the seconds granularity (omits seconds fraction.)
RoundMinutes -- round at the minutes granularity.
RoundDegrees -- round at the degrees granularity.
SplitZodiacal -- relative to zodiac signs.
SplitNakshatra -- relative to nakshatra.
KeepSign -- when rounding, don't round if it'll move it to the next zodiac/nakshatra sector.
KeepDegrees -- when rounding, don't round if it'll move it to the next degree.
Instances
All bodies for which a position can be calculated. Covers planets in the solar system, points between the Earth and the Moon, and astrologically significant asteroids (currently, only Chiron, but ephemerides data is available for others.) More at 2.1 Planetary and lunar ephemerides and 3.2 bodies
Sun | |
Moon | |
Mercury | |
Venus | |
Mars | |
Jupiter | |
Saturn | |
Uranus | |
Neptune | |
Pluto | |
MeanNode | |
TrueNode | |
MeanApog | |
OscuApog | |
Earth | |
Chiron |
Instances
data HouseSystem Source #
The major house systems. The underlying library supports many more, including the 36-cusp outlier Gauquelin. More info at 6.2 Astrological house systems and 14. House cusp calculation
Instances
data ZodiacSignName Source #
Represents western zodiac signs. Unless otherwise stated, they correspond to tropical divisions of the ecliptic, vs. the actual constellations.
Instances
data NakshatraName Source #
Nakshatras, provided for thoroughness, please excuse any misspellings! List from: https://en.wikipedia.org/wiki/List_of_Nakshatras note that the underlying library uses 27 nakshatras, so Abhijit is omitted.
Instances
data EventSearchDirection Source #
When looking for eclipses, occulations or crossings, determine the temporal direction to take from the provided start time.
Instances
Eq EventSearchDirection Source # | |
Defined in SwissEphemeris.Internal (==) :: EventSearchDirection -> EventSearchDirection -> Bool # (/=) :: EventSearchDirection -> EventSearchDirection -> Bool # | |
Show EventSearchDirection Source # | |
Defined in SwissEphemeris.Internal showsPrec :: Int -> EventSearchDirection -> ShowS # show :: EventSearchDirection -> String # showList :: [EventSearchDirection] -> ShowS # |
data PlanetMotion Source #
Apparent motion of a planet, from a geocentric observation.
Instances
Eq PlanetMotion Source # | |
Defined in SwissEphemeris.Internal (==) :: PlanetMotion -> PlanetMotion -> Bool # (/=) :: PlanetMotion -> PlanetMotion -> Bool # | |
Show PlanetMotion Source # | |
Defined in SwissEphemeris.Internal showsPrec :: Int -> PlanetMotion -> ShowS # show :: PlanetMotion -> String # showList :: [PlanetMotion] -> ShowS # |
data LunarPhaseName Source #
Traditional western moon phases.
Instances
Eq LunarPhaseName Source # | |
Defined in SwissEphemeris.Internal (==) :: LunarPhaseName -> LunarPhaseName -> Bool # (/=) :: LunarPhaseName -> LunarPhaseName -> Bool # | |
Ord LunarPhaseName Source # | |
Defined in SwissEphemeris.Internal compare :: LunarPhaseName -> LunarPhaseName -> Ordering # (<) :: LunarPhaseName -> LunarPhaseName -> Bool # (<=) :: LunarPhaseName -> LunarPhaseName -> Bool # (>) :: LunarPhaseName -> LunarPhaseName -> Bool # (>=) :: LunarPhaseName -> LunarPhaseName -> Bool # max :: LunarPhaseName -> LunarPhaseName -> LunarPhaseName # min :: LunarPhaseName -> LunarPhaseName -> LunarPhaseName # | |
Show LunarPhaseName Source # | |
Defined in SwissEphemeris.Internal showsPrec :: Int -> LunarPhaseName -> ShowS # show :: LunarPhaseName -> String # showList :: [LunarPhaseName] -> ShowS # |
Coordinate/position systems
data EclipticPosition Source #
Position data for a celestial body on the ecliptic, includes rotational speeds. see: 3.4 Position and speed
Instances
data EquatorialPosition Source #
Represents a position on the celestial sphere, with speed information included.
EquatorialPosition | |
|
Instances
data GeographicPosition Source #
Represents a point on Earth, with negative values for latitude meaning South, and negative values for longitude meaning West. No speed information is included (or needed,) because all calculations are geocentric.
Instances
data HousePosition Source #
The house a celestial body is in.
Instances
Information about the ecliptic at a point in time
data ObliquityInformation Source #
Includes the obliquity of the ecliptic, the Nutation as longitude as well as mean values.
Instances
Relevant angles: ascendant and MC, plus other "exotic" ones: 14. House cusp calculation
Angles | |
|
Instances
data CuspsCalculation Source #
Result of calculating the cusps for a given event; will include a list of cusps (most systems use 12 cusps, Gauquelin uses 36.)
CuspsCalculation | |
|
Instances
data LongitudeComponents Source #
A longitude expressed in its constituent parts.
Instances
Information about an Eclipse
data SolarEclipseInformation Source #
Various moments of note for a solar eclipse.
Instances
Eq SolarEclipseInformation Source # | |
Defined in SwissEphemeris | |
Show SolarEclipseInformation Source # | |
Defined in SwissEphemeris showsPrec :: Int -> SolarEclipseInformation -> ShowS # show :: SolarEclipseInformation -> String # showList :: [SolarEclipseInformation] -> ShowS # |
data SolarEclipseType Source #
All possible types of solar eclipses.
Instances
Eq SolarEclipseType Source # | |
Defined in SwissEphemeris.Internal (==) :: SolarEclipseType -> SolarEclipseType -> Bool # (/=) :: SolarEclipseType -> SolarEclipseType -> Bool # | |
Show SolarEclipseType Source # | |
Defined in SwissEphemeris.Internal showsPrec :: Int -> SolarEclipseType -> ShowS # show :: SolarEclipseType -> String # showList :: [SolarEclipseType] -> ShowS # |
data LunarEclipseInformation Source #
Various moments of note for a lunar eclipse.
Instances
Eq LunarEclipseInformation Source # | |
Defined in SwissEphemeris | |
Show LunarEclipseInformation Source # | |
Defined in SwissEphemeris showsPrec :: Int -> LunarEclipseInformation -> ShowS # show :: LunarEclipseInformation -> String # showList :: [LunarEclipseInformation] -> ShowS # |
data LunarEclipseType Source #
All possible types of lunar eclipses.
Instances
Eq LunarEclipseType Source # | |
Defined in SwissEphemeris.Internal (==) :: LunarEclipseType -> LunarEclipseType -> Bool # (/=) :: LunarEclipseType -> LunarEclipseType -> Bool # | |
Show LunarEclipseType Source # | |
Defined in SwissEphemeris.Internal showsPrec :: Int -> LunarEclipseType -> ShowS # show :: LunarEclipseType -> String # showList :: [LunarEclipseType] -> ShowS # |
Management of data files
setEphemeridesPath :: FilePath -> IO () Source #
Given a path to a directory, point the underlying ephemerides library to it.
You only need to call this function to provide an explicit ephemerides path,
if the environment variable SE_EPHE_PATH
is set, it overrides this function.
WARNING: this is provided for convenience, but in a multi-threaded
situation, it is relatively likely that a call to this function will
either be optimized away, or interleaved too late. Please consider
setting the SE_EPHE_PATH
environment variable instead: it will always
be found by the C code, vs. the sometimes of Haskell's inscrutable
optimizations. For a discussion about the thread-unsafety of
this function, see:
https://groups.io/g/swisseph/message/10064
and the related thread.
setNoEphemeridesPath :: IO () Source #
Explicitly state that we don't want to set an ephemeris path,
which will default to the built-in ephemeris, or use the directory
in the SE_EPHE_PATH
environment variable, if set.
WARNING: this is provided for convenience, but in a multi-threaded
situation, it is relatively likely that a call to this function will
either be optimized away, or interleaved too late. Please consider
setting the SE_EPHE_PATH
environment variable instead: it will always
be found by the C code, vs. the sometimes of Haskell's inscrutable
optimizations.
closeEphemerides :: IO () Source #
Explicitly release all "cache" pointers and open files obtained by the C
library. You don't need to call this if you always work with the same
ephemeris mode: just setEphemeridesPath
and walk away -- the OS will
clean up any file pointers or static data used by the library.
withEphemerides :: FilePath -> IO a -> IO a Source #
Run a computation with a given ephemerides path open, and then close it. Note that the computation does not receive the ephemerides, in keeping with the underlying library's side-effectful conventions.
You don't need to call this if you always work with the same
ephemeris mode: just setEphemeridesPath
and walk away -- the OS will
clean up any file pointers or static data used by the library. Preferably,
set the SE_EPHE_PATH
environment variable. See setEphemeridesPath
withoutEphemerides :: IO a -> IO a Source #
Run a computation with no explicit ephemerides set, if the SE_EPHE_PATH
environment variable is set, that will be used. If not, it'll fall back to
in-memory data.
Core calculations
calculateEquatorialPosition :: JulianDayUT1 -> Planet -> IO (Either String EquatorialPosition) Source #
Obtain equatorial position (includes declination) of a planet.
If you've called calculateEclipticPosition
in your code, this is a very cheap call, as the data
is already available to the C code.
calculateObliquity :: JulianDayUT1 -> IO (Either String ObliquityInformation) Source #
Given a time, calculate ecliptic obliquity and nutation
calculateCusps :: HouseSystem -> JulianDayUT1 -> GeographicPosition -> IO CuspsCalculation Source #
Alias for calculateCuspsLenient
calculateCuspsLenient :: HouseSystem -> JulianDayUT1 -> GeographicPosition -> IO CuspsCalculation Source #
Given a decimal representation of Julian Time (see julianDay
),
a GeographicPosition
and a HouseSystem
(most applications use Placidus
,) return a CuspsCalculation
with all
house cusps in that system, and other relevant Angles
.
Notice that certain systems,
like Placidus
and Koch
, are very likely to fail close to the polar circles; in this
and other edge cases, the calculation returns cusps in the Porphyrius
system.
The underlying library may do IO when consulting ephemerides data.
calculateCuspsStrict :: HouseSystem -> JulianDayUT1 -> GeographicPosition -> IO (Either String CuspsCalculation) Source #
Unlike calculateCuspsLenient
, return a Left
value if the required house system
couldn't be used to perform the calculations.
Utilities for coordinate transformation
equatorialToEcliptic :: ObliquityInformation -> EquatorialPosition -> EclipticPosition Source #
Convert from an equatorial position to an ecliptic position. Requires
knowledge of obliquity (see calculateObliquity
.)
eclipticToEquatorial :: ObliquityInformation -> EclipticPosition -> EquatorialPosition Source #
Convert from an ecliptic position to an equatorial position. Requires
knowledge of obliquity (see calculateObliquity
.)
Utilities for sidereal information
calculateHousePosition :: HouseSystem -> Double -> GeographicPosition -> ObliquityInformation -> EclipticPosition -> IO (Either String HousePosition) Source #
If you happen to have the correct ARMC for a time and place (obtained from calculateCusps)
and obliquity and nutation,
you can use this method to calculate a planet's house position.
Usually, what you have is just the time and place of the event, and positions of a planet,
in those cases, see calculateHousePositionSimple
.
calculateHousePositionSimple :: HouseSystem -> JulianDayUT1 -> GeographicPosition -> EclipticPosition -> IO (Either String HousePosition) Source #
Calculates the house position of a body in a house in the given system.
requires the geographic coordinates and time of the birth/event, and the
ecliptic coordinates of the planet/body. You only want this function if
you're working in the polar circle, or with objects that are way off the ecliptic;
for most objects in usual astrological charts, simply seeing which cusps
a planet falls between is sufficient, no need for this more complicated method.
see https://groups.io/g/swisseph/message/4052
NOTES: for the Koch system, this is likely to fail, or return counterintuitive
results. Also, we're doing a bit of a funky conversion between sidereal time and
ARMC, if you calculateCusps
, the correct armc
will be present in the returned Angles
Utilities for display/splitting
defaultSplitDegreesOptions :: [SplitDegreesOption] Source #
Convenient defaults when using splitDegrees
:
Omit rounding if it would bring it over the next sign or degree.
splitDegrees :: [SplitDegreesOption] -> Double -> LongitudeComponents Source #
Given a Double
representing an ecliptic longitude, split it according to any
options from SplitDegreesOption
:
if SplitZodiacal
or SplitNakshatra
are specified, they're returned
in longitudeZodiacSign
and longitudeNakshatra
, respectively.
If neither of those is specified, the raw signum
is then populated, in
longitudeSignum
(-1 for negative, 1, for positive.)
NOTE: this function can also be used for latitudes, speeds or quantities
from other positional systems (like declinations,) but the zodiacal or
nakshatra components would of course be nonsensical.
splitDegreesZodiac :: Double -> LongitudeComponents Source #
Given a longitude, return the degrees it's from its nearest sign,
minutes, and seconds; with seconds rounded. Convenience alias for splitDegrees
,
when wanting to display e.g. a table in a horoscope.
Planetary Phenomena
planetaryPhenomenon :: SingTSI ts => Planet -> JulianDay ts -> IO (Either String PlanetPhenomenon) Source #
Get a PlanetPhenomenon
for a given Planet
at a given JulianDay
See 8.13. swe_pheno_ut() and swe_pheno(), planetary phenomena
This function is not useful for calculating the phase of the moon, since the phase angle
is in the range 0-180 (i.e. can't distinguish between the first/last quarters,) instead,
find the angular difference between the positions of the Moon and the Sun at the given time.
planetaryPhenomenonRaw :: SingTSI ts => JulianDay ts -> PlanetNumber -> CalcFlag -> IO (Either String [Double]) Source #
Unprocessed vector of data of note for a planetary phenomenon (see planetaryPhenomenon
)
Crossings over a longitude
sunCrossing :: SingTSI ts => Double -> JulianDay ts -> IO (Either String (JulianDay ts)) Source #
Given an ecliptic longitude, and JulianDay
after which to search
try to find the next future date when the Sun will be crossing the
given longitude exactly (with a precision of 1 milliarcsecond,)
from a geocentric perspective.
sunCrossingBetween :: SingTSI ts => Double -> JulianDay ts -> JulianDay ts -> IO (Either String (JulianDay ts)) Source #
Given an ecliptic longitude, and two JulianDay
between which to search
try to find intervening time when the Sun will be crossing the
given longitude exactly (with a precision of 1 milliarcsecond,)
from a geocentric perspective.
moonCrossing :: SingTSI ts => Double -> JulianDay ts -> IO (Either String (JulianDay ts)) Source #
Given an ecliptic longitude, and JulianDay
after which to search
try to find the next future date when the Moon will be crossing the
given longitude exactly (with a precision of 1 milliarcsecond,)
from a geocentric perspective.
moonCrossingBetween :: SingTSI ts => Double -> JulianDay ts -> JulianDay ts -> IO (Either String (JulianDay ts)) Source #
Given an ecliptic longitude, and two JulianDay
s between which to search
try to find the intervening time when the Moon will be crossing the
given longitude exactly (with a precision of 1 milliarcsecond,)
from a geocentric perspective.
moonCrossingNode :: SingTSI ts => JulianDay ts -> IO (Either String (JulianDay ts, Double, Double)) Source #
Find the next JulianDay
the Moon will cross its True Node, from a geocentric
perspective.
returns the day, and the longitude and latitude of the Moon at that time.
heliocentricCrossing :: SingTSI ts => EventSearchDirection -> Planet -> Double -> JulianDay ts -> IO (Either String (JulianDay ts)) Source #
Find the next JulianDay
a given Planet
crosses a given ecliptic longitude,
notice that this finds heliocentric crossings: due to retrograde motion in most planets,
this function is not suitable for geocentric insights.
For example, Mars enters Libra on Sep 5, 2021 from a heliocentric perspective,
but won't do so until Sep 14, 2021 from a geocentric perspective.
Objects whose orbit is not heliocentric will fail.
crossingBetween :: SingTSI ts => Planet -> Double -> JulianDay ts -> JulianDay ts -> IO (Either String (JulianDay ts)) Source #
Given a Planet
, a longitude it crosses, and a start and end
JulianDay
s, find the exact moment the planet crosses the given longitude,
from a geocentric perspective (retrogrades are taken into account).
_NOTE_: works best when it is known beforehand that the planet crosses
the longitude in the given interval, and when the interval is short (e.g. 24 hours):
if the interval is too long the maximum number of iterations to approximate
the moment of exactitude may be exceeded. Additionally, if the planet changes
direction in the interval and crosses the longitude more than once, only one
of the crossings will be found (not necessarily the first one.) You may
use nextDirectionChange
or directionChangeBetween
to subdivide the interval
into sub-intervals that contain one crossing each.
Eclipses
nextSolarEclipse :: [SolarEclipseType] -> EventSearchDirection -> JulianDayUT1 -> IO (Either String SolarEclipseInformation) Source #
Given filters for a SolarEclipseType
(empty means any eclipse,)
an EventSearchDirection
and a starting JulianDay
in UT1
,
find the next (or previous, if searching backward) solar eclipse
of the specified type(s). Returns SolarEclipseInformation
with all
the relevant timestamps of the event.
nextSolarEclipseWhen :: [SolarEclipseType] -> EventSearchDirection -> JulianDayUT1 -> IO (Either String (SolarEclipseType, JulianDayUT1)) Source #
Find the type and maximum of the closest solar eclipse; useful if you're only interested in the date of the eclipse, and don't care about the more detailed timestamps around the event.
nextSolarEclipseWhere :: JulianDayUT1 -> IO (Either String GeographicPosition) Source #
Find the location of the solar eclipse that occurs at the provided
JulianDay
. You can use nextSolarEclipseWhen
to find that date,
and then use this function to find a location where it's maximally
visible.
nextLunarEclipse :: [LunarEclipseType] -> EventSearchDirection -> JulianDayUT1 -> IO (Either String LunarEclipseInformation) Source #
Given filters for a SolarEclipseType
(empty means any eclipse,)
an EventSearchDirection
and a starting JulianDay
in UT1
,
find the next (or previous, if searching backward) solar eclipse
of the specified type(s). Returns SolarEclipseInformation
with all
the relevant timestamps of the event.
nextLunarEclipseWhen :: [LunarEclipseType] -> EventSearchDirection -> JulianDayUT1 -> IO (Either String (LunarEclipseType, JulianDayUT1)) Source #
Find the type and maximum of the closest lunar eclipse
Changes of direction
directionChangeBetween :: SingTSI ts => Planet -> JulianDay ts -> JulianDay ts -> IO (Either String (JulianDay ts, PlanetMotion)) Source #
nextDirectionChange :: SingTSI ts => Planet -> JulianDay ts -> IO (Either String (JulianDay ts, PlanetMotion)) Source #
Given a Planet
and a JulianDay
to start searching, find the next time
the Planet changes direction. The search must start at least 30 minutes before
the change of direction, and will fail if ephemeris data is not available,
or if the body in question doesn't go retrograde within 700 days of the start
date (astronomically, this cannot happen for bodies that do present retrograde
motion, so it's a reasonable upper bound.)
Moon phases
moonPhaseExactAt :: SingTSI ts => LunarPhaseName -> JulianDay ts -> JulianDay ts -> IO (Either String (JulianDay ts)) Source #
Given start and end moments between which the moon is known to reach a
given LunarPhaseName
, determine the moment of exactitude.
module SwissEphemeris.Time