Skip to content

Commit 3388e85

Browse files
committed
Update README
1 parent 800305f commit 3388e85

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

README.md

+26-26
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,29 @@ import SwissEphemeris
1313
main :: IO
1414
main = do
1515
-- location of your ephemeris directory. We bundle a sample one in `swedist`.
16-
setEphemeridesPath "./swedist/sweph_18"
17-
18-
let time = julianDay 1989 1 6 0.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 1989 1 6 0.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
3632
```
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.)
3834

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

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

4340

4441
## Notes
@@ -57,12 +54,15 @@ acquainted with the functionality and implementation details.
5754

5855
### Ephemerides files
5956

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:
6259

6360
> 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.
6461
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
6666
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/)
6767

6868
I chose the bundled files due to this comment in the official docs:

0 commit comments

Comments
 (0)