swiss-ephemeris-1.4.0.0: Haskell bindings for the Swiss Ephemeris C library
LicenseAGPL-3
Maintainerswiss-ephemeris@lfborjas.com
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

SwissEphemeris

Description

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

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.

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

Instances details
Enum SplitDegreesOption Source # 
Instance details

Defined in SwissEphemeris.Internal

Eq SplitDegreesOption Source # 
Instance details

Defined in SwissEphemeris.Internal

Show SplitDegreesOption Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic SplitDegreesOption Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep SplitDegreesOption :: Type -> Type #

type Rep SplitDegreesOption Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep SplitDegreesOption = D1 ('MetaData "SplitDegreesOption" "SwissEphemeris.Internal" "swiss-ephemeris-1.4.0.0-4yP55cKKPuSDh3BxO5EEXV" 'False) ((C1 ('MetaCons "RoundSeconds" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "RoundMinutes" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "RoundDegrees" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "SplitZodiacal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SplitNakshatra" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "KeepSign" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "KeepDegrees" 'PrefixI 'False) (U1 :: Type -> Type))))

data Planet Source #

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

Instances

Instances details
Enum Planet Source # 
Instance details

Defined in SwissEphemeris.Internal

Eq Planet Source # 
Instance details

Defined in SwissEphemeris.Internal

Methods

(==) :: Planet -> Planet -> Bool #

(/=) :: Planet -> Planet -> Bool #

Ord Planet Source # 
Instance details

Defined in SwissEphemeris.Internal

Show Planet Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic Planet Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep Planet :: Type -> Type #

Methods

from :: Planet -> Rep Planet x #

to :: Rep Planet x -> Planet #

Storable Planet Source #

When marshaling a Planet to/from C, use the underlying integer PlanetNumber.

Instance details

Defined in SwissEphemeris.Internal

type Rep Planet Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep Planet = D1 ('MetaData "Planet" "SwissEphemeris.Internal" "swiss-ephemeris-1.4.0.0-4yP55cKKPuSDh3BxO5EEXV" 'False) ((((C1 ('MetaCons "Sun" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Moon" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Mercury" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Venus" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Mars" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Jupiter" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Saturn" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Uranus" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: (((C1 ('MetaCons "Neptune" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Pluto" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "MeanNode" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TrueNode" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "MeanApog" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OscuApog" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Earth" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Chiron" 'PrefixI 'False) (U1 :: Type -> Type)))))

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

Instances details
Enum HouseSystem Source # 
Instance details

Defined in SwissEphemeris.Internal

Eq HouseSystem Source # 
Instance details

Defined in SwissEphemeris.Internal

Ord HouseSystem Source # 
Instance details

Defined in SwissEphemeris.Internal

Show HouseSystem Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic HouseSystem Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep HouseSystem :: Type -> Type #

type Rep HouseSystem Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep HouseSystem = D1 ('MetaData "HouseSystem" "SwissEphemeris.Internal" "swiss-ephemeris-1.4.0.0-4yP55cKKPuSDh3BxO5EEXV" 'False) ((C1 ('MetaCons "Placidus" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Koch" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Porphyrius" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Regiomontanus" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Campanus" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Equal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WholeSign" 'PrefixI 'False) (U1 :: Type -> Type))))

data ZodiacSignName Source #

Represents western zodiac signs. Unless otherwise stated, they correspond to tropical divisions of the ecliptic, vs. the actual constellations.

Instances

Instances details
Enum ZodiacSignName Source # 
Instance details

Defined in SwissEphemeris.Internal

Eq ZodiacSignName Source # 
Instance details

Defined in SwissEphemeris.Internal

Show ZodiacSignName Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic ZodiacSignName Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep ZodiacSignName :: Type -> Type #

type Rep ZodiacSignName Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep ZodiacSignName = D1 ('MetaData "ZodiacSignName" "SwissEphemeris.Internal" "swiss-ephemeris-1.4.0.0-4yP55cKKPuSDh3BxO5EEXV" 'False) (((C1 ('MetaCons "Aries" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Taurus" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Gemini" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Cancer" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Leo" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Virgo" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Libra" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Scorpio" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Sagittarius" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Capricorn" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Aquarius" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Pisces" 'PrefixI 'False) (U1 :: Type -> Type)))))

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

Instances details
Enum NakshatraName Source # 
Instance details

Defined in SwissEphemeris.Internal

Eq NakshatraName Source # 
Instance details

Defined in SwissEphemeris.Internal

Show NakshatraName Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic NakshatraName Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep NakshatraName :: Type -> Type #

type Rep NakshatraName Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep NakshatraName = D1 ('MetaData "NakshatraName" "SwissEphemeris.Internal" "swiss-ephemeris-1.4.0.0-4yP55cKKPuSDh3BxO5EEXV" 'False) ((((C1 ('MetaCons "Ashvini" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Bharani" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Krittika" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Rohini" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Mrigashirsha" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Ardra" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "Punarvasu" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Pushya" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Ashlesha" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Magha" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PurvaPhalghuni" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "UttaraPhalguni" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Hasta" 'PrefixI 'False) (U1 :: Type -> Type))))) :+: (((C1 ('MetaCons "Chitra" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Swati" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Vishakha" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Anuradha" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Jyeshtha" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Mula" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PurvaAshadha" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "UttaraAshadha" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Sravana" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Dhanishta" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Shatabhisha" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PurvaBhadrapada" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "UttaraBhadrapada" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Revati" 'PrefixI 'False) (U1 :: Type -> Type))))))

data EventSearchDirection Source #

When looking for eclipses, occulations or crossings, determine the temporal direction to take from the provided start time.

data PlanetMotion Source #

Apparent motion of a planet, from a geocentric observation.

Instances

Instances details
Eq PlanetMotion Source # 
Instance details

Defined in SwissEphemeris.Internal

Show PlanetMotion Source # 
Instance details

Defined in SwissEphemeris.Internal

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

Instances details
Eq EclipticPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Show EclipticPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic EclipticPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep EclipticPosition :: Type -> Type #

HasEclipticLongitude EclipticPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep EclipticPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

data EquatorialPosition Source #

Represents a position on the celestial sphere, with speed information included.

Instances

Instances details
Eq EquatorialPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Show EquatorialPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic EquatorialPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep EquatorialPosition :: Type -> Type #

type Rep EquatorialPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep EquatorialPosition = D1 ('MetaData "EquatorialPosition" "SwissEphemeris.Internal" "swiss-ephemeris-1.4.0.0-4yP55cKKPuSDh3BxO5EEXV" 'False) (C1 ('MetaCons "EquatorialPosition" 'PrefixI 'True) ((S1 ('MetaSel ('Just "rightAscension") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Just "declination") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "eqDistance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))) :*: (S1 ('MetaSel ('Just "ascensionSpeed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: (S1 ('MetaSel ('Just "declinationSpeed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "eqDistanceSpeed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))))

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.

Constructors

GeographicPosition 

Fields

Instances

Instances details
Eq GeographicPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Show GeographicPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic GeographicPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep GeographicPosition :: Type -> Type #

type Rep GeographicPosition Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep GeographicPosition = D1 ('MetaData "GeographicPosition" "SwissEphemeris.Internal" "swiss-ephemeris-1.4.0.0-4yP55cKKPuSDh3BxO5EEXV" 'False) (C1 ('MetaCons "GeographicPosition" 'PrefixI 'True) (S1 ('MetaSel ('Just "geoLat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "geoLng") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))

data HousePosition Source #

The house a celestial body is in.

Instances

Instances details
Eq HousePosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Show HousePosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic HousePosition Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep HousePosition :: Type -> Type #

type Rep HousePosition Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep HousePosition = D1 ('MetaData "HousePosition" "SwissEphemeris.Internal" "swiss-ephemeris-1.4.0.0-4yP55cKKPuSDh3BxO5EEXV" 'False) (C1 ('MetaCons "HousePosition" 'PrefixI 'True) (S1 ('MetaSel ('Just "houseNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "houseCuspDistance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)))

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

Instances details
Eq ObliquityInformation Source # 
Instance details

Defined in SwissEphemeris.Internal

Show ObliquityInformation Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic ObliquityInformation Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep ObliquityInformation :: Type -> Type #

type Rep ObliquityInformation Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep ObliquityInformation = D1 ('MetaData "ObliquityInformation" "SwissEphemeris.Internal" "swiss-ephemeris-1.4.0.0-4yP55cKKPuSDh3BxO5EEXV" 'False) (C1 ('MetaCons "ObliquityInformation" 'PrefixI 'True) ((S1 ('MetaSel ('Just "eclipticObliquity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "eclipticMeanObliquity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :*: (S1 ('MetaSel ('Just "nutationLongitude") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double) :*: S1 ('MetaSel ('Just "nutationObliquity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double))))

data Angles Source #

Relevant angles: ascendant and MC, plus other "exotic" ones: 14. House cusp calculation

Instances

Instances details
Eq Angles Source # 
Instance details

Defined in SwissEphemeris.Internal

Methods

(==) :: Angles -> Angles -> Bool #

(/=) :: Angles -> Angles -> Bool #

Show Angles Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic Angles Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep Angles :: Type -> Type #

Methods

from :: Angles -> Rep Angles x #

to :: Rep Angles x -> Angles #

type Rep Angles Source # 
Instance details

Defined in SwissEphemeris.Internal

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.)

Instances

Instances details
Eq CuspsCalculation Source # 
Instance details

Defined in SwissEphemeris.Internal

Show CuspsCalculation Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic CuspsCalculation Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep CuspsCalculation :: Type -> Type #

type Rep CuspsCalculation Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep CuspsCalculation = D1 ('MetaData "CuspsCalculation" "SwissEphemeris.Internal" "swiss-ephemeris-1.4.0.0-4yP55cKKPuSDh3BxO5EEXV" 'False) (C1 ('MetaCons "CuspsCalculation" 'PrefixI 'True) (S1 ('MetaSel ('Just "houseCusps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [HouseCusp]) :*: (S1 ('MetaSel ('Just "angles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Angles) :*: S1 ('MetaSel ('Just "systemUsed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HouseSystem))))

data LongitudeComponents Source #

A longitude expressed in its constituent parts.

Instances

Instances details
Eq LongitudeComponents Source # 
Instance details

Defined in SwissEphemeris.Internal

Show LongitudeComponents Source # 
Instance details

Defined in SwissEphemeris.Internal

Generic LongitudeComponents Source # 
Instance details

Defined in SwissEphemeris.Internal

Associated Types

type Rep LongitudeComponents :: Type -> Type #

type Rep LongitudeComponents Source # 
Instance details

Defined in SwissEphemeris.Internal

type Rep LongitudeComponents = D1 ('MetaData "LongitudeComponents" "SwissEphemeris.Internal" "swiss-ephemeris-1.4.0.0-4yP55cKKPuSDh3BxO5EEXV" 'False) (C1 ('MetaCons "LongitudeComponents" 'PrefixI 'True) ((S1 ('MetaSel ('Just "longitudeZodiacSign") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ZodiacSignName)) :*: (S1 ('MetaSel ('Just "longitudeDegrees") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just "longitudeMinutes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer))) :*: ((S1 ('MetaSel ('Just "longitudeSeconds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just "longitudeSecondsFraction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :*: (S1 ('MetaSel ('Just "longitudeSignum") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "longitudeNakshatra") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe NakshatraName))))))

Information about an Eclipse

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

calculateEclipticPosition :: JulianDayUT1 -> Planet -> IO (Either String EclipticPosition) Source #

Given a JulianDay in UT1, and a Planet, returns either the position of that planet at the given time, if available in the ephemeris, or an error. The underlying library may do IO when reading ephemerides data.

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

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 JulianDays 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 JulianDays, 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 #

Given two JulianDay moments, determine if a change of direction for a given Planet occurs; and if so, when exactly and what direction it changes to.

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.