swiss-ephemeris-1.4.0.0: Haskell bindings for the Swiss Ephemeris C library
Safe HaskellNone
LanguageHaskell2010

Foreign.SwissEphemeris

Description

Exposes very low-level FFI bindings to the C library. Use the SwissEphemeris module and its more Haskell-friendly exports.

Synopsis

Documentation

newtype EpheFlag Source #

Constructors

EpheFlag 

Fields

Instances

Instances details
Eq EpheFlag Source # 
Instance details

Defined in Foreign.SwissEphemeris

Show EpheFlag Source # 
Instance details

Defined in Foreign.SwissEphemeris

newtype GregFlag Source #

Constructors

GregFlag 

Fields

Instances

Instances details
Eq GregFlag Source # 
Instance details

Defined in Foreign.SwissEphemeris

Show GregFlag Source # 
Instance details

Defined in Foreign.SwissEphemeris

newtype CalcFlag Source #

Constructors

CalcFlag 

Fields

Instances

Instances details
Eq CalcFlag Source # 
Instance details

Defined in Foreign.SwissEphemeris

Show CalcFlag Source # 
Instance details

Defined in Foreign.SwissEphemeris

newtype SplitDegFlag Source #

Constructors

SplitDegFlag 

Fields

Instances

Instances details
Eq SplitDegFlag Source # 
Instance details

Defined in Foreign.SwissEphemeris

Show SplitDegFlag Source # 
Instance details

Defined in Foreign.SwissEphemeris

newtype EclipseFlag Source #

Constructors

EclipseFlag 

Fields

Instances

Instances details
Eq EclipseFlag Source # 
Instance details

Defined in Foreign.SwissEphemeris

Show EclipseFlag Source # 
Instance details

Defined in Foreign.SwissEphemeris

c_swe_revjul :: CDouble -> GregFlag -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CDouble -> IO () Source #

Reverse of c_swe_julday: produce a gregorian date

c_swe_calc_ut :: CDouble -> PlanetNumber -> CalcFlag -> Ptr CDouble -> CString -> IO CalcFlag Source #

Calculate the position of a body, given a time in Universal Time. Note that this is marginally more expensive than swe_calc, but I use this one to keep consistency with swe_houses.

c_swe_houses :: CDouble -> CDouble -> CDouble -> CInt -> Ptr CDouble -> Ptr CDouble -> IO CInt Source #

Get the house cusps and other relevant angles for a given time and place. Note that there's also a swe_houses_armc if one happens to have the ARMC and the ecliptic obliquity handy from other calculations.

c_swe_house_pos :: CDouble -> CDouble -> CDouble -> CInt -> Ptr CDouble -> CString -> IO CDouble Source #

Calculate the house a planet is in. Takes into account obliquity of the ecliptic. Works for all house systems, except Koch.

c_swe_cotrans_sp :: Ptr CDouble -> Ptr CDouble -> CDouble -> IO () Source #

Low-level function to translate between coordinate systems, with speed position included.

c_swe_split_deg :: CDouble -> SplitDegFlag -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CDouble -> Ptr CInt -> IO () Source #

Split a given ecliptic longitude into sign (number) degrees, minutes and seconds.

c_swe_deltat :: CDouble -> IO CDouble Source #

Calculate the delta time for a given julian time, delta time + julian time = ephemeris time NOTE: there's also swe_deltat_ex which takes an ephemeris flag explicitly, vs. the current global value. my calculations work in one ephemeris, so this one is suitable.

c_swe_sidtime :: CDouble -> IO CDouble Source #

Calculate the sidereal time for a given julian time. NOTE: there's also swe_sidtime0 which requires obliquity and nutation, this one computes them internally.

c_swe_sidtime0 :: CDouble -> CDouble -> CDouble -> IO CDouble Source #

Calculate the sidereal time for a given julian time, obliquity and nutation.

c_swe_deltat_ex Source #

Arguments

:: CDouble

JulianTime, in a UT scale.

-> EpheFlag

Ephemeris to use (for tidal acceleration data)

-> CString

For warning/error message

-> IO CDouble

Delta T, if the correct ephemeris is being used.

Same as c_swe_deltat, but expects one to have explicitly selected an ephemeris mode, and returns a warning if not.

c_swe_utc_to_jd Source #

Arguments

:: CInt

year

-> CInt

month

-> CInt

day

-> CInt

hour

-> CInt

min

-> CDouble

sec

-> GregFlag

gregorian/julian

-> Ptr CDouble

dret[2], where pos 0 is the Julian Day in TT (née ET) and pos 1 is the Julian Day in UT1

-> CString

error string

-> IO CInt 

Given a Universal Time input (UTC, but it's considered to be UT1 if before 1971, or if the leap is too great.)

c_swe_jdet_to_utc Source #

Arguments

:: CDouble

JD

-> GregFlag

julian/gregorian

-> Ptr CInt

year

-> Ptr CInt

month

-> Ptr CInt

day

-> Ptr CInt

hour

-> Ptr CInt

min

-> Ptr CDouble

sec

-> IO () 

c_swe_jdut1_to_utc Source #

Arguments

:: CDouble

JD

-> GregFlag

julian/gregorian

-> Ptr CInt

year

-> Ptr CInt

month

-> Ptr CInt

day

-> Ptr CInt

hour

-> Ptr CInt

min

-> Ptr CDouble

sec

-> IO () 

c_swe_pheno Source #

Arguments

:: CDouble

JD (TT)

-> PlanetNumber

ipl

-> CalcFlag

iflag

-> Ptr CDouble
  • attr
-> CString
  • serr
-> IO CInt

retval

c_swe_pheno_ut Source #

Arguments

:: CDouble

JD (UT)

-> PlanetNumber

ipl

-> CalcFlag

iflag

-> Ptr CDouble
  • attr
-> CString
  • serr
-> IO CInt

retval

c_swe_solcross Source #

Arguments

:: CDouble

x2cross -- longitude to cross

-> CDouble

JD (TT)

-> CalcFlag

flag

-> CString

serr

-> IO CDouble

JD (time of next crossing; if in the past, we failed.)

c_swe_solcross_between Source #

Arguments

:: CDouble

x2cross -- longitude to cross

-> CDouble

JD (TT) -- start

-> CDouble

JD (TT) -- end

-> CalcFlag

flag

-> CString

serr

-> IO CDouble

JD (time of next crossing; if in the past, we failed.)

c_swe_solcross_ut Source #

Arguments

:: CDouble

x2cross -- longitude to cross

-> CDouble

JD (UT1/UT)

-> CalcFlag

flag

-> CString

serr

-> IO CDouble

JD (time of next crossing; if in the past, we failed.)

c_swe_solcross_ut_between Source #

Arguments

:: CDouble

x2cross -- longitude to cross

-> CDouble

JD (UT1/UT) -- start

-> CDouble

JD (UT1/UT) -- end

-> CalcFlag

flag

-> CString

serr

-> IO CDouble

JD (time of next crossing; if in the past, we failed.)

c_swe_mooncross Source #

Arguments

:: CDouble

x2cross -- longitude to cross

-> CDouble

JD (TT)

-> CalcFlag

flag

-> CString

serr

-> IO CDouble

JD (time of next crossing; if in the past, we failed.)

c_swe_mooncross_between Source #

Arguments

:: CDouble

x2cross -- longitude to cross

-> CDouble

JD (TT) -- start

-> CDouble

JD (TT) -- end

-> CalcFlag

flag

-> CString

serr

-> IO CDouble

JD (time of next crossing; if in the past, we failed.)

c_swe_mooncross_ut Source #

Arguments

:: CDouble

x2cross -- longitude to cross

-> CDouble

JD (UT1/UT)

-> CalcFlag

flag

-> CString

serr

-> IO CDouble

JD (time of next crossing; if in the past, we failed.)

c_swe_mooncross_ut_between Source #

Arguments

:: CDouble

x2cross -- longitude to cross

-> CDouble

JD (UT1/UT) -- start

-> CDouble

JD (UT1/UT) -- end

-> CalcFlag

flag

-> CString

serr

-> IO CDouble

JD (time of next crossing; if in the past, we failed.)

c_swe_mooncross_node Source #

Arguments

:: CDouble

JD (TT)

-> CalcFlag

flag

-> Ptr CDouble
return
xlon
-> Ptr CDouble
return
xlat
-> CString

serr

-> IO CDouble

JD (time of next crossing)

c_swe_mooncross_node_ut Source #

Arguments

:: CDouble

JD (TT)

-> CalcFlag

flag

-> Ptr CDouble
return
xlon
-> Ptr CDouble
return
xlat
-> CString

serr

-> IO CDouble

JD (time of next crossing)

c_swe_helio_cross Source #

Arguments

:: PlanetNumber

planet

-> CDouble

x2cross

-> CDouble

JD (TT)

-> CalcFlag

iflag

-> CInt

dir (back,0 forward)

-> Ptr CDouble

JD

-> CString

serr

-> IO CInt

retval (OK/ERR)

c_swe_helio_cross_ut Source #

Arguments

:: PlanetNumber

planet

-> CDouble

x2cross

-> CDouble

JD (TT)

-> CalcFlag

iflag

-> CInt

dir (back,0 forward)

-> Ptr CDouble

JD

-> CString

serr

-> IO CInt

retval (OK/ERR)

c_swe_sol_eclipse_when_glob Source #

Arguments

:: CDouble

JD(UT)

-> CalcFlag

iflag

-> EclipseFlag

ifltype

-> Ptr CDouble

ret[10] eclipse time highlights

-> CInt

BOOL: search backward?

-> CString

serr

-> IO CInt

retval (ERR/Eclipse type)

c_swe_sol_eclipse_where Source #

Arguments

:: CDouble

JD(UT), must be known time of maximum eclipse

-> CalcFlag

iflag

-> Ptr CDouble
return
geopos
-> Ptr CDouble
return
attr
-> CString

serr

-> IO CInt

ret (ERR/eclipse type)

c_swe_sol_eclipse_when_loc Source #

Arguments

:: CDouble

JD(UT), time to start searching

-> CalcFlag

iflag

-> Ptr CDouble

geopos of a known locale

-> Ptr CDouble
return
tret (contacts)
-> Ptr CDouble
return
other attributes
-> CInt

BOOL: search backward?

-> CString

serr

-> IO CInt

ret (ERR/eclipse type)

Given a search date, latlngheight of a geographic vantage point, return an eclipse's maximum, four contacts and other important events, and various attributes. See: 8.2. swe_sol_eclipse_when_loc. NOTE(luis) only providing the C binding right now, as I have no current use for all this data, and don't want to provide an opinionated Haskell equivalent until I do.

c_swe_lun_eclipse_when Source #

Arguments

:: CDouble

JD(UT)

-> CalcFlag

iflag

-> EclipseFlag

ifltype

-> Ptr CDouble

ret[10] eclipse time highlights

-> CInt

BOOL: forward/backward

-> CString

serr

-> IO CInt

retval (OK/ERR)

c_swe_lun_eclipse_when_loc Source #

Arguments

:: CDouble

JD(UT), time to start searching

-> CalcFlag

iflag

-> Ptr CDouble

geopos of a known locale

-> Ptr CDouble
return
tret (contacts)
-> Ptr CDouble
return
other attributes
-> CInt

BOOL: search backward?

-> CString

serr

-> IO CInt

ret (ERR/eclipse type)

Given a search date, latlngheight of a geographic vantage point, return an eclipse's maximum, four contacts and other important events, and various attributes. See: 8.9. swe_lun_eclipse_when_loc. NOTE(luis) only providing the C binding right now, as I have no current use for all this data, and don't want to provide an opinionated Haskell equivalent until I do.