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

Foreign.SweEphe4

Description

Exposes functions to interact with the "ephe4" format of pre-calculated ephemeris.

Synopsis

Documentation

newtype PlacalcPlanet Source #

"placalc" style enum of precalculate-able bodies. All are provided for convenience, but take note that only planets up to lastPlanet are guaranteed to be present via this FFI in any files produced via the bundled source.

Constructors

PlacalcPlanet 

pChiron :: PlacalcPlanet Source #

Options for requesting pre-calculated ephemeris; Unless the use case calls for it, it's cheap and fast to just includeAll (which should evaluate to 0.)

newtype PlanetListFlag Source #

Constructors

PlanetListFlag 

Instances

Instances details
Eq PlanetListFlag Source # 
Instance details

Defined in Foreign.SweEphe4

Show PlanetListFlag Source # 
Instance details

Defined in Foreign.SweEphe4

pHeliocentricEarth :: PlacalcPlanet Source #

Lengths and indices for pre-calculated ephemeris. They're only true for a file **created by the same code in use**. Memory corruption can occur if reading a file created with fewer or more planets/bodies, or in an incompatible architecture!

newtype EpheConst Source #

Constructors

EpheConst 

Fields

Instances

Instances details
Eq EpheConst Source # 
Instance details

Defined in Foreign.SweEphe4

Show EpheConst Source # 
Instance details

Defined in Foreign.SweEphe4

constToIndex :: EpheConst -> Int Source #

Convenience helper to turn an EpheConst into an int for indexed access.

lastPlanet :: PlacalcPlanet Source #

The last planet that the current pre-calculated files will contain, if produced with the same sources in csrc. You'll have to edit the C source and compile, then run the swegen target to re-produce files with more or fewer planets

newtype EpheCalcFlag Source #

Options for additional computations when reading. The authors recommend to always includeSpeed, since it's a negligible overhead and can be useful. If mustUseStoredEphe is not set, reading dates outside of the precalculated range won't fail, and instead fall back to the more expensive swecalc -- which can still fail if requesting a body that the current swiss ephemeris mode is unable to calculate (e.g. requesting Chiron when no asteroid data is present.)

Constructors

EpheCalcFlag 

Fields

Instances

Instances details
Eq EpheCalcFlag Source # 
Instance details

Defined in Foreign.SweEphe4

Show EpheCalcFlag Source # 
Instance details

Defined in Foreign.SweEphe4

c_ephe4_set_ephe_path :: CString -> IO () Source #

Set the base pre-calculated ephemeris path. This function is called automatically by the read functions and will either default to the environment variable EP4_PATH, or the library's current hardcoded path; if unable to set environment variables reliably, use this function. Otherwise it's an unnecessary complication outside of testing.

c_dephread2 Source #

Arguments

:: CDouble

jd (julian date)

-> PlanetListFlag

plalist -- bitwise flag for the position data to include

-> EpheCalcFlag

flag -- bitwise flag for the additional options

-> CString

char* errtext -- at least 256 characters for error message

-> IO (Ptr CDouble)

array of the calculated data

Obtain an array of doubles containing all requested planets, ecliptic, nutation, and their speeds.

c_ephe4_write_file Source #

Arguments

:: CInt

fnr: three-digit prefix of the starting day

-> CString

errtext: error/warning message

-> IO CInt

error code.

Write one block of 10,000 day ephemeris to disk. Both valid base paths for ephe4 stored ephemeris, and base ephemeris, should be set.