You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+26-26
Original file line number
Diff line number
Diff line change
@@ -13,32 +13,29 @@ import SwissEphemeris
13
13
main::IO
14
14
main =do
15
15
-- location of your ephemeris directory. We bundle a sample one in `swedist`.
16
-
setEphemeridesPath "./swedist/sweph_18"
17
-
18
-
let time = julianDay 1989160.0
19
-
place = mkCoordinates{lat =14.0839053, lng =-87.2750137}
20
-
21
-
-- locate all bodies between the Sun and Chiron (further asteroids currently not supported, but they're an enum entry away)
22
-
-- use the Placidus house system, which is the most traditional.
23
-
forM_ [Sun..Chiron] $\planet ->
24
-
-- if no ephemerides data is available for the given planetary body, a `Left` value
25
-
-- will be returned.
26
-
coord <- calculateCoordinates time planet
27
-
putStrLn$show planet <>": "<>show coord
28
-
-- Calculate cusps for the given time and place, preferring the `Placidus` system.
29
-
-- note that the underlying library may decide to use a different system if it can't
30
-
-- calculate cusps (happens for the Placidus and Koch systems in locations near the poles.)
31
-
cusps <- calculateCusps Placidus time place
32
-
putStrLn$"Cusps: "<>show cusps
33
-
34
-
-- the underlying library, sadly, allocates some in-memory "cache" and file descriptors, you can free it with:
35
-
closeEphemerides
16
+
withEphemerides "./swedist/sweph_18"$do
17
+
let time = julianDay 1989160.0
18
+
place =GeographicPosition {geoLat =14.0839053, geoLng =-87.2750137}
19
+
20
+
-- locate all bodies between the Sun and Chiron
21
+
forM_ [Sun..Chiron] $\planet ->do
22
+
-- if no ephemerides data is available for the given planetary body, a `Left` value
23
+
-- will be returned.
24
+
coord <- calculateEclipticPosition time planet
25
+
putStrLn$show planet <>": "<>show coord
26
+
27
+
-- Calculate cusps for the given time and place, preferring the `Placidus` system.
28
+
-- note that the underlying library may decide to use the `Porphyrius` system if it can't
29
+
-- calculate cusps (happens for the Placidus and Koch systems in locations near the poles.)
30
+
cusps <- calculateCusps Placidus time place
31
+
putStrLn$"Cusps: "<>show cusps
36
32
```
37
-
The above should print the latitude and longitude (plus some velocities) for all planets, and then the cusps and other major angles.
33
+
The above should print the ecliptic latitude and longitude (plus some velocities) for all planets, and then the cusps and other major angles (ascendant, mc, ARMC, alternative angles.)
38
34
39
-
There's also `withEphemerides` and `withoutEphemerides` bracket-style functions that take care of closing the files for you.
35
+
There's `withEphemerides` to run calculations using a particular ephemerides directory and then close any used
36
+
system resources, and `withoutEphemerides` to use the default ephemerides ("Moshier.")
40
37
41
-
To see actual results and more advanced usage, check out the tests. For some more advanced examples, see `swetest.c` and `swemini.c` in the `csrc` directory: they're the test/example programs provided by the original authors.
38
+
To see actual results and more advanced usage, check out the tests. For some more advanced examples, see `swetest.c` and `swemini.c` in the `csrc` directory: they're the test/example programs provided by the original authors. You can also play around with the C library via [the authors' test page](https://www.astro.com/swisseph/swetest.htm).
42
39
43
40
44
41
## Notes
@@ -57,12 +54,15 @@ acquainted with the functionality and implementation details.
57
54
58
55
### Ephemerides files
59
56
60
-
As noted in the [original documentation](https://www.astro.com/swisseph/swisseph.htm) you can omit the `setEphePath` call and calculations will use a built-in analytical
61
-
ephemeris which:
57
+
As noted in the [original documentation](https://www.astro.com/swisseph/swisseph.htm) you can omit the `setEphemerides` call (or use `setNoEphemerides`, or the `withoutEphemerides` bracket function) and calculations will use a built-in analytical
58
+
ephemeris ("Moshier") which:
62
59
63
60
> provides "only" a precision of 0.1 arc seconds for the planets and 3" for the Moon. No asteroids will be available, and no barycentric option can be used.
64
61
65
-
For convenience, we bundle a few files for the time range `1800 AD – 2399 AD`. If you were born before that, or plan to code e.g. transits for after that (!) or
62
+
63
+
Note that if you're interested in the asteroid `Chiron` (which is common in astrological practice these days,) you'll have to procure Ephemerides files and shouldn't use the default ephemerides.
64
+
65
+
For convenience, we bundle a few ephemerides files in this repository (see `swedist`) for the time range `1800 AD – 2399 AD`. If you were born before that, or plan to code e.g. transits for after that (!) or
66
66
you'd prefer even more precision, you can [download more ephemerides files from the astro.com downloads page](https://www.astro.com/ftp/swisseph/ephe/)
67
67
68
68
I chose the bundled files due to this comment in the official docs:
0 commit comments