Safe Haskell | None |
---|---|
Language | Haskell2010 |
Exposes functions to interact with the "ephe4" format of pre-calculated ephemeris.
Synopsis
- newtype PlacalcPlanet = PlacalcPlanet {}
- pSun :: PlacalcPlanet
- pMoon :: PlacalcPlanet
- pMercury :: PlacalcPlanet
- pVenus :: PlacalcPlanet
- pMars :: PlacalcPlanet
- pJupiter :: PlacalcPlanet
- pSaturn :: PlacalcPlanet
- pUranus :: PlacalcPlanet
- pNeptune :: PlacalcPlanet
- pPluto :: PlacalcPlanet
- pMeanNode :: PlacalcPlanet
- pTrueNode :: PlacalcPlanet
- pChiron :: PlacalcPlanet
- pLilith :: PlacalcPlanet
- newtype PlanetListFlag = PlanetListFlag {}
- pCeres :: PlacalcPlanet
- includeAllPlanets :: PlanetListFlag
- pPallas :: PlacalcPlanet
- includeEcliptic :: PlanetListFlag
- pJuno :: PlacalcPlanet
- includeNutation :: PlanetListFlag
- pVesta :: PlacalcPlanet
- includeAll :: PlanetListFlag
- pHeliocentricEarth :: PlacalcPlanet
- pParsFortunae :: PlacalcPlanet
- newtype EpheConst = EpheConst {
- unEpheConst :: CInt
- numberOfFactors :: EpheConst
- numberOfPlanets :: EpheConst
- eclipticIndex :: EpheConst
- nutationIndex :: EpheConst
- constToIndex :: EpheConst -> Int
- lastPlanet :: PlacalcPlanet
- newtype EpheCalcFlag = EpheCalcFlag {}
- includeSpeed :: EpheCalcFlag
- mustUseStoredEphe :: EpheCalcFlag
- c_ephe4_set_ephe_path :: CString -> IO ()
- c_dephread2 :: CDouble -> PlanetListFlag -> EpheCalcFlag -> CString -> IO (Ptr CDouble)
- c_ephe4_write_file :: CInt -> CString -> IO CInt
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.
Instances
Enum PlacalcPlanet Source # | |
Defined in Foreign.SweEphe4 succ :: PlacalcPlanet -> PlacalcPlanet # pred :: PlacalcPlanet -> PlacalcPlanet # toEnum :: Int -> PlacalcPlanet # fromEnum :: PlacalcPlanet -> Int # enumFrom :: PlacalcPlanet -> [PlacalcPlanet] # enumFromThen :: PlacalcPlanet -> PlacalcPlanet -> [PlacalcPlanet] # enumFromTo :: PlacalcPlanet -> PlacalcPlanet -> [PlacalcPlanet] # enumFromThenTo :: PlacalcPlanet -> PlacalcPlanet -> PlacalcPlanet -> [PlacalcPlanet] # | |
Eq PlacalcPlanet Source # | |
Defined in Foreign.SweEphe4 (==) :: PlacalcPlanet -> PlacalcPlanet -> Bool # (/=) :: PlacalcPlanet -> PlacalcPlanet -> Bool # | |
Show PlacalcPlanet Source # | |
Defined in Foreign.SweEphe4 showsPrec :: Int -> PlacalcPlanet -> ShowS # show :: PlacalcPlanet -> String # showList :: [PlacalcPlanet] -> ShowS # |
pSun :: PlacalcPlanet Source #
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 #
Instances
Eq PlanetListFlag Source # | |
Defined in Foreign.SweEphe4 (==) :: PlanetListFlag -> PlanetListFlag -> Bool # (/=) :: PlanetListFlag -> PlanetListFlag -> Bool # | |
Show PlanetListFlag Source # | |
Defined in Foreign.SweEphe4 showsPrec :: Int -> PlanetListFlag -> ShowS # show :: PlanetListFlag -> String # showList :: [PlanetListFlag] -> ShowS # |
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!
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.)
Instances
Eq EpheCalcFlag Source # | |
Defined in Foreign.SweEphe4 (==) :: EpheCalcFlag -> EpheCalcFlag -> Bool # (/=) :: EpheCalcFlag -> EpheCalcFlag -> Bool # | |
Show EpheCalcFlag Source # | |
Defined in Foreign.SweEphe4 showsPrec :: Int -> EpheCalcFlag -> ShowS # show :: EpheCalcFlag -> String # showList :: [EpheCalcFlag] -> ShowS # |
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.
:: CDouble |
|
-> PlanetListFlag |
|
-> EpheCalcFlag |
|
-> CString |
|
-> IO (Ptr CDouble) | array of the calculated data |
Obtain an array of doubles containing all requested planets, ecliptic, nutation, and their speeds.