commit
92f3b7e957
12
.travis.yml
12
.travis.yml
|
@ -1,7 +1,13 @@
|
|||
sudo: false
|
||||
language: c
|
||||
before-install: sudo apt-get update
|
||||
install: sudo apt-get install libglib2.0-dev gobject-introspection gnome-common
|
||||
before-script: ./autogen.sh
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libglib2.0-dev
|
||||
- gobject-introspection
|
||||
- gnome-common
|
||||
- autopoint
|
||||
before_script: ./autogen.sh
|
||||
script:
|
||||
- make
|
||||
- make check
|
||||
|
|
80
README.md
80
README.md
|
@ -1,22 +1,36 @@
|
|||
# SWE-GLib
|
||||
|
||||
SWE-GLib is a GLib style wrapper library around Astrodienst's [Swiss Ephemeris library](http://www.astro.com/swisseph/).
|
||||
[](https://travis-ci.org/gergelypolonkai/swe-glib)
|
||||
|
||||
The source tree contains Astrodienst's ephemeride files, as requested by Alois Treindl of Astrodienst in a mail written to me on 24 July, 2013.
|
||||
SWE-GLib is a GLib style wrapper library around Astrodienst's
|
||||
[Swiss Ephemeris library](http://www.astro.com/swisseph/).
|
||||
|
||||
The source tree contains Astrodienst's ephemeride files, as requested
|
||||
by Alois Treindl of Astrodienst in a mail written to me on 24 July,
|
||||
2013.
|
||||
|
||||
## GTK-Doc
|
||||
|
||||
The project utilizes [GTK-Doc](http://www.gtk.org/gtk-doc/), requiring version 1.19 or later. Although the generated documentation is a bit messy (not everything is documented, and there are some unresolved variables, like [SERVER] on the generated index page.
|
||||
The project utilizes [GTK-Doc](http://www.gtk.org/gtk-doc/), requiring
|
||||
version 1.19 or later. Although the generated documentation is a bit
|
||||
messy (not everything is documented, and there are some unresolved
|
||||
variables, like [SERVER] on the generated index page.
|
||||
|
||||
Still, the documentation generates well, and at least gives a clue about object usage.
|
||||
Still, the documentation generates well, and at least gives a clue
|
||||
about object usage.
|
||||
|
||||
## Bindings
|
||||
|
||||
SWE-GLib utilizes [GObject Introspection](https://wiki.gnome.org/GObjectIntrospection), which means it is available for many languages. Check out the [examples](examples) directory for some sample code!
|
||||
SWE-GLib utilizes
|
||||
[GObject Introspection](https://wiki.gnome.org/GObjectIntrospection),
|
||||
which means it is available for many languages. Check out the
|
||||
[examples](examples) directory for some sample code!
|
||||
|
||||
## Usage
|
||||
|
||||
Many functions return non-opaque C structs; their documentation can be found inline, and in the generated GTK-Doc. Unless otherwise stated, the returned values should never be freed.
|
||||
Many functions return non-opaque C structs; their documentation can be
|
||||
found inline, and in the generated GTK-Doc. Unless otherwise stated,
|
||||
the returned values should never be freed.
|
||||
|
||||
### Creating the required objects
|
||||
|
||||
|
@ -67,11 +81,13 @@ GList *sun_aspects = gswe_moment_get_planet_aspects(moment, GSWE_PLANET_SUN);
|
|||
GList *sun_antiscia = gswe_moment_get_planet_antiscia(moment, GSWE_PLANET_SUN);
|
||||
```
|
||||
|
||||
The returned GList objects hold zero or more `GsweAspectData` or `GsweAntiscionData` objects, respectively.
|
||||
The returned GList objects hold zero or more `GsweAspectData` or
|
||||
`GsweAntiscionData` objects, respectively.
|
||||
|
||||
### Getting the Moon phase
|
||||
|
||||
Last, but not least, SWE-GLib can calculate Moon's phase at the given moment. For that, you have to call `gswe_moment_get_moon_phase()`:
|
||||
Last, but not least, SWE-GLib can calculate Moon's phase at the given
|
||||
moment. For that, you have to call `gswe_moment_get_moon_phase()`:
|
||||
|
||||
```c
|
||||
GsweMoonPhaseData *moon_phase = gswe_moment_get_moon_phase(moment);
|
||||
|
@ -79,34 +95,60 @@ GsweMoonPhaseData *moon_phase = gswe_moment_get_moon_phase(moment);
|
|||
|
||||
### About altitude
|
||||
|
||||
The Swiss Ephemeris library requires the altitude value to be specified for several calculations. It also notifies how important it is:
|
||||
The Swiss Ephemeris library requires the altitude value to be
|
||||
specified for several calculations. It also notifies how important it
|
||||
is:
|
||||
|
||||
> the altitude above sea must be in meters. Neglecting the altitude can result in an error of about 2 arc seconds with the moon and at an altitude 3000m.
|
||||
> the altitude above sea must be in meters. Neglecting the altitude
|
||||
> can result in an error of about 2 arc seconds with the moon and at
|
||||
> an altitude 3000m.
|
||||
|
||||
2 arc seconds is about 0.000555 degrees of error, which is, well, kind of small. Of course, if you need very precise horoscopes or need planetary positions for a totally different thing, you should really provide a (close to) exact value; otherwise, it is safe to pass any value (well, which seems logical: the average level of all dry lands is about 840 meters; the average level of the whole planet Earth (including oceans and seas) is around 280 meters. Providing a value of ~400 should be OK most of the time).
|
||||
2 arc seconds is about 0.000555 degrees of error, which is, well, kind
|
||||
of small. Of course, if you need very precise horoscopes or need
|
||||
planetary positions for a totally different thing, you should really
|
||||
provide a (close to) exact value; otherwise, it is safe to pass any
|
||||
value (well, which seems logical: the average level of all dry lands
|
||||
is about 840 meters; the average level of the whole planet Earth
|
||||
(including oceans and seas) is around 280 meters. Providing a value of
|
||||
~400 should be OK most of the time).
|
||||
|
||||
## API stability
|
||||
|
||||
The project is currently transitioning to 2.0. master is a bit fragile at the moment, 1.x versions are considered to be stable (although see commit 8f52aba about a huge typo-bug).
|
||||
The project is currently transitioning to 2.0. master is a bit fragile
|
||||
at the moment, 1.x versions are considered to be stable (although see
|
||||
commit 8f52aba about a huge typo-bug).
|
||||
|
||||
## Limitations
|
||||
|
||||
### Topocentric calculations only
|
||||
|
||||
Although the original Swiss Ephemeris library supports it, SWE-GLib can't do Heliocentric, nor Geocentric (as seen from the center of Earth) calculations, only Topocentric (as seen from a given point on Earth"s surface) calculations yet.
|
||||
Although the original Swiss Ephemeris library supports it, SWE-GLib
|
||||
can't do Heliocentric, nor Geocentric (as seen from the center of
|
||||
Earth) calculations, only Topocentric (as seen from a given point on
|
||||
Earth’s surface) calculations yet.
|
||||
|
||||
### Database size
|
||||
|
||||
The size of all data files provided by Astrodienst is around 40MB. Although it should not be a problem with today's home hardware, it can be a hard requirement on embedded systems. For basic calculations, keeping the following files under $(datadir)/swe-glib is usually enough:
|
||||
The size of all data files provided by Astrodienst is around
|
||||
40MB. Although it should not be a problem with today's home hardware,
|
||||
it can be a hard requirement on embedded systems. For basic
|
||||
calculations, keeping the following files under $(datadir)/swe-glib is
|
||||
usually enough:
|
||||
|
||||
* seas_18.se1
|
||||
* semo_18.se1
|
||||
* sepl_18.se1
|
||||
* `seas_18.se1`
|
||||
* `semo_18.se1`
|
||||
* `sepl_18.se1`
|
||||
|
||||
### Fixed stars are not known yet
|
||||
|
||||
Although Swiss Ephemeris has the functionality to calculate the position of fixed stars, SWE-GLib doesn't provide such functionality. This, however, is a planned feature for the close future.
|
||||
Although Swiss Ephemeris has the functionality to calculate the
|
||||
position of fixed stars, SWE-GLib doesn't provide such
|
||||
functionality. This, however, is a planned feature for the close
|
||||
future.
|
||||
|
||||
## Licencing
|
||||
|
||||
As the underlying Swiss Ephemeris is published under GPL (or a commercial license I can not afford), SWE-GLib is also uses that. This means that you can currently use SWE-GLib in software published under the GNU GPL v3.
|
||||
As the underlying Swiss Ephemeris is published under GPL (or a
|
||||
commercial license I can not afford), SWE-GLib is also uses that. This
|
||||
means that you can currently use SWE-GLib in software published under
|
||||
the GNU GPL v3 (or, at your option, any later version).
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -7,6 +7,7 @@ EXTRA_DIST = \
|
|||
LICENSE \
|
||||
README \
|
||||
swemptab.c \
|
||||
swemptab.h \
|
||||
swedate.h \
|
||||
swedll.h \
|
||||
swehouse.h \
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
Aldebaran ,alTau,ICRS,04,35,55.2387,+16,30,33.485,62.78,-189.35,54.26,50.09,0.985, 16, 629
|
||||
Rohini ,alTau,ICRS,04,35,55.2387,+16,30,33.485,62.78,-189.35,54.26,50.09,0.985, 16, 629
|
||||
Algol ,bePer,ICRS,03,08,10.1315,+40,57,20.332,2.39,-1.44,4.0,35.14,2.12, 40, 673
|
||||
Antares ,alSco,ICRS,16,29,24.4609,-26,25,55.209,-10.16,-23.21,-3.4,5.40,1.09,-26,11359
|
||||
Regulus ,alLeo,ICRS,10,08,22.4593,+11,58,01.9027,-248.73,5.59,5.9,42.09,1.35, 12, 2149
|
||||
|
@ -21,6 +22,7 @@ Praesepe Cluster,M44,2000,08,40,6.000,19,59,0.00,0.000, 0.00, 0.0,0.0000,3.7,
|
|||
Praesepe Cluster,M44,2000,08,40,6.000,19,59,0.00,0.000, 0.00, 0.0,0.0000,3.7, 0, 0
|
||||
# moved this to top of file, otherwise Polaris Australis will be found
|
||||
Polaris ,alUMi,ICRS,02,31,49.0837,+89,15,50.794,44.22,-11.75,-17.4,7.56,2.005, 88, 8
|
||||
Sanduleak ,SN1987A,ICRS,05,35,28.020,-69,16,11.07,0.0,0.0,0.0,0.0,4.81, 0, 0
|
||||
#
|
||||
# Fixed stars brighter than Magnitude 5
|
||||
# This file is based on data provided by S. Moshier.
|
||||
|
@ -66,6 +68,7 @@ Deneb Adige ,alCyg,ICRS,20,41,25.9147,+45,16,49.217,1.56,1.55,-4.5,1.01,1.25, 44
|
|||
Rigel ,beOri,ICRS,05,14,32.2723,-08,12,05.906,1.87,-0.56,20.7,4.22,0.12,-08, 1063
|
||||
Mira ,omiCet,ICRS,02,19,20.7927,-02,58,39.513,10.33,-239.48,63.8,7.79,3.04,-03, 353
|
||||
Ain ,epTau,ICRS,04,28,36.9995,+19,10,49.554,107.23,-36.77,38.15,21.04,3.540, 18, 640
|
||||
Segin ,epCas,ICRS,01,54,23.7255,+63,40,12.365,31.98,-18.66,-8.1,7.38,3.342, 62, 320
|
||||
#
|
||||
# Andromeda
|
||||
Alpheratz ,alAnd,ICRS,00,08,23.2586,+29,05,25.555,135.68,-162.95,-11.7,33.60,2.06, 28, 4
|
||||
|
@ -106,6 +109,7 @@ Andromeda Galaxy,M31,ICRS,00,42,44.330,+41,16,07.50,-35.99,-12.92,-301,,3.44, 0
|
|||
,ka-1Aps,ICRS,15,31,30.8214,-73,23,22.527,0.38,-18.28,62,3.20,5.49,-72, 1802
|
||||
# Aquila
|
||||
Altair ,alAql,ICRS,19,50,46.9990,+08,52,05.959,536.87,385.57,-26.1,194.45,0.77, 08, 4236
|
||||
Shravana ,alAql,ICRS,19,50,46.9990,+08,52,05.959,536.87,385.57,-26.1,194.45,0.77, 08, 4236
|
||||
Alshain ,beAql,ICRS,19,55,18.7934,+06,24,24.348,46.35,-481.35,-39.8,72.95,3.710, 06, 4357
|
||||
Tarazed ,gaAql,ICRS,19,46,15.5795,+10,36,47.740,15.72,-3.08,-2.79,7.08,2.724, 10, 4043
|
||||
Al Mizan ,deAql,ICRS,19,25,29.9005,+03,06,53.191,253.07,80.67,-30.1,65.05,3.40, 02, 3879
|
||||
|
@ -138,6 +142,7 @@ Ancha ,thAqr,ICRS,22,16,50.0364,-07,46,59.845,118.95,-21.91,-14.7,17.04,4
|
|||
Situla ,kaAqr,ICRS,22,37,45.3810,-04,13,41.001,-68.36,-120.47,8.2,13.92,5.040,-04, 5716
|
||||
Hydor ,laAqr,ICRS,22,52,36.8759,-07,34,46.557,19.51,32.71,-8.8,8.33,3.766,-08, 5968
|
||||
Ekkhysis ,laAqr,ICRS,22,52,36.8759,-07,34,46.557,19.51,32.71,-8.8,8.33,3.766,-08, 5968
|
||||
Shatabhishaj ,laAqr,ICRS,22,52,36.8759,-07,34,46.557,19.51,32.71,-8.8,8.33,3.766,-08, 5968
|
||||
,muAqr,ICRS,20,52,39.2336,-08,58,59.944,47.06,-32.91,-9.1,21.01,4.723,-09, 5598
|
||||
Albulaan ,nuAqr,ICRS,21,09,35.6477,-11,22,18.095,92.31,-15.76,-11.8,19.93,4.519,-11, 5538
|
||||
Seat ,piAqr,ICRS,22,25,16.6232,+01,22,38.642,18.38,3.35,4,2.96,4.794, 00, 4872
|
||||
|
@ -164,6 +169,7 @@ Ara ,alAra,ICRS,17,31,50.4933,-49,52,34.121,-31.27,-67.15,0,13.46,2.836
|
|||
# Aries
|
||||
Hamal ,alAri,ICRS,02,07,10.4071,+23,27,44.723,190.73,-145.77,-14.64,49.48,2.00, 22, 306
|
||||
Sheratan ,beAri,ICRS,01,54,38.4091,+20,48,28.926,96.32,-108.80,-1.9,54.74,2.64, 20, 306
|
||||
Ashvini ,beAri,ICRS,01,54,38.4091,+20,48,28.926,96.32,-108.80,-1.9,54.74,2.64, 20, 306
|
||||
Mesarthim ,gaAri,ICRS,01,53,31.8143,+19,17,37.866,79.43,-99.10,,15.96,3.88, 18, 243
|
||||
Botein ,deAri,ICRS,03,11,37.7655,+19,43,36.039,154.61,-8.39,23.05,19.44,4.350, 19, 477
|
||||
,zeAri,ICRS,03,14,54.0961,+21,02,39.988,-29.83,-77.15,7,9.59,4.880, 20, 527
|
||||
|
@ -172,6 +178,7 @@ Botein ,deAri,ICRS,03,11,37.7655,+19,43,36.039,154.61,-8.39,23.05,19.44,4.
|
|||
,siAri,ICRS,02,51,29.5869,+15,04,55.454,31.26,-23.29,17.0,6.80,5.514, 14, 480
|
||||
,ta-1Ari,ICRS,03,21,13.6245,+21,08,49.510,21.68,-22.41,13.9,7.06,5.301, 20, 543
|
||||
,41Ari,ICRS,02,49,59.0323,+27,15,37.825,65.47,-116.59,4,20.45,3.606, 20, 543
|
||||
Bharani ,41Ari,ICRS,02,49,59.0323,+27,15,37.825,65.47,-116.59,4,20.45,3.606, 20, 543
|
||||
# Auriga
|
||||
Capella ,alAur,ICRS,05,16,41.3591,+45,59,52.768,75.52,-427.11,30.2,77.29,0.08, 45, 1077
|
||||
Menkalinan ,beAur,ICRS,05,59,31.7229,+44,56,50.758,-56.41,-0.88,-18.2,39.72,1.896, 44, 1328
|
||||
|
@ -199,6 +206,7 @@ Al Khabdhilinan,ioAur,ICRS,04,56,59.6187,+33,09,57.925,3.63,-18.54,17.78,6.37,2.
|
|||
,ps-6Aur,ICRS,06,47,39.5761,+48,47,22.115,-5.25,6.40,-7.7,7.69,5.222, 48, 1436
|
||||
# Bootes
|
||||
Arcturus ,alBoo,ICRS,14,15,39.6720,+19,10,56.677,-1093.43,-1999.43,-5.2,88.85,-0.04, 19, 2777
|
||||
Svati ,alBoo,ICRS,14,15,39.6720,+19,10,56.677,-1093.43,-1999.43,-5.2,88.85,-0.04, 19, 2777
|
||||
Nekkar ,beBoo,ICRS,15,01,56.7623,+40,23,26.036,-40.20,-29.22,-19.9,14.91,3.488, 40, 2840
|
||||
Seginus ,gaBoo,ICRS,14,32,04.6719,+38,18,29.709,-115.55,151.87,-36.5,38.29,3.00, 38, 2565
|
||||
Haris ,gaBoo,ICRS,14,32,04.6719,+38,18,29.709,-115.55,151.87,-36.5,38.29,3.00, 38, 2565
|
||||
|
@ -392,6 +400,7 @@ Acubens ,alCnc,ICRS,08,58,29.2217,+11,51,27.723,41.45,-29.22,-13.8,18.79,4.
|
|||
Al Tarf ,beCnc,ICRS,08,16,30.9206,+09,11,07.961,-46.80,-48.65,22.94,11.23,3.520, 09, 1917
|
||||
Asellus Borealis ,gaCnc,ICRS,08,43,17.1461,+21,28,06.602,-106.94,-39.25,28.7,20.58,4.668, 21, 1895
|
||||
Asellus Australis,deCnc,ICRS,08,44,41.0996,+18,09,15.511,-17.10,-228.46,17.14,23.97,3.94, 18, 2027
|
||||
Pushya ,deCnc,ICRS,08,44,41.0996,+18,09,15.511,-17.10,-228.46,17.14,23.97,3.94, 18, 2027
|
||||
Tegmen ,zeCnc,ICRS,08,12,12.851,+17,38,52.75,74.3,-119.0,-5.7,,5.05, 18, 1867
|
||||
Tegmine ,zeCnc,ICRS,08,12,12.851,+17,38,52.75,74.3,-119.0,-5.7,,5.05, 18, 1867
|
||||
,etCnc,ICRS,08,32,42.4969,+20,26,28.183,-44.65,-44.71,22.46,10.46,5.343, 20, 2109
|
||||
|
@ -449,6 +458,8 @@ Alchita ,alCrv,ICRS,12,08,24.8170,-24,43,43.952,100.18,-39.33,4.4,67.71,4.0
|
|||
Kraz ,beCrv,ICRS,12,34,23.2346,-23,23,48.333,0.86,-56.00,-7.6,23.34,2.65,-22, 3401
|
||||
Gienah Corvi ,gaCrv,ICRS,12,15,48.3702,-17,32,30.946,-159.58,22.31,-4.2,19.78,2.59,-16, 3424
|
||||
Algorab ,deCrv,ICRS,12,29,51.8554,-16,30,55.557,-209.97,-139.30,9,37.11,2.95,-15, 3482
|
||||
Algorab ,deCrv,ICRS,12,29,51.8554,-16,30,55.557,-209.97,-139.30,9,37.11,2.95,-15, 3482
|
||||
Hasta ,deCrv,ICRS,12,29,51.8554,-16,30,55.557,-209.97,-139.30,9,37.11,2.95,-15, 3482
|
||||
Minkar ,epCrv,ICRS,12,10,07.4807,-22,37,11.159,-71.52,10.55,4.9,10.75,3.017,-21, 3487
|
||||
Avis Satyra ,etCrv,ICRS,12,32,04.2270,-16,11,45.627,-424.37,-58.41,-3.5,54.92,4.31,0, 0
|
||||
# Canes Venatici
|
||||
|
@ -485,6 +496,8 @@ Ruchbah II ,ome-2Cyg,ICRS,20,31,18.8163,+49,13,13.070,8.79,-31.28,-64.15,8.07,5.
|
|||
# Delphinus
|
||||
Sualocin ,alDel,ICRS,20,39,38.2874,+15,54,43.459,54.14,7.91,-3.4,13.55,3.800, 15, 4222
|
||||
Rotanev ,beDel,ICRS,20,37,32.9411,+14,35,42.313,118.28,-47.65,-22.7,33.49,3.632, 14, 4369
|
||||
Dhanishtha ,beDel,ICRS,20,37,32.9411,+14,35,42.313,118.28,-47.65,-22.7,33.49,3.632, 14, 4369
|
||||
Shravishtha ,beDel,ICRS,20,37,32.9411,+14,35,42.313,118.28,-47.65,-22.7,33.49,3.632, 14, 4369
|
||||
,ga-2Del,ICRS,20,46,39.5023,+16,07,27.466,-25.88,-196.27,-6.41,32.14,4.27, 15, 4255
|
||||
,deDel,ICRS,20,43,27.5339,+15,04,28.491,-19.61,-41.74,9.3,16.03,4.434, 14, 4403
|
||||
Deneb Dulphim,epDel,ICRS,20,33,12.7712,+11,18,11.746,10.75,-28.54,-19.3,9.09,4.032, 10, 4321
|
||||
|
@ -569,6 +582,7 @@ Fornacis ,alFor,ICRS,03,12,04.5277,-28,59,15.425,371.49,612.28,-20.5,70.86,3
|
|||
# Gemini
|
||||
Castor ,alGem,ICRS,07,34,35.8628,+31,53,17.795,-206.33,-148.18,,63.27,1.59, 32, 1581
|
||||
Pollux ,beGem,ICRS,07,45,18.9503,+28,01,34.315,-625.69,-45.96,3.23,96.74,1.15, 28, 1463
|
||||
Pushya ,beGem,ICRS,07,45,18.9503,+28,01,34.315,-625.69,-45.96,3.23,96.74,1.15, 28, 1463
|
||||
Alhena ,gaGem,ICRS,06,37,42.7011,+16,23,57.308,-2.04,-66.92,-12.5,31.12,1.90, 16, 1223
|
||||
Almeisan ,gaGem,ICRS,06,37,42.7011,+16,23,57.308,-2.04,-66.92,-12.5,31.12,1.90, 16, 1223
|
||||
Wasat ,deGem,ICRS,07,20,07.3775,+21,58,56.354,-18.72,-7.76,4.1,55.45,3.53, 22, 1645
|
||||
|
@ -686,10 +700,13 @@ Ukdah ,ta-2Hya,ICRS,09,31,58.9281,-01,11,04.790,-11.42,-3.87,5.6,7.11,4.555
|
|||
,beLac,ICRS,22,23,33.6235,+52,13,44.567,-13.56,-186.37,-10.4,19.21,4.43, 51, 3358
|
||||
# Leo
|
||||
Regulus ,alLeo,ICRS,10,08,22.4593,+11,58,01.9027,-248.73,5.59,5.9,42.09,1.35, 12, 2149
|
||||
Magha ,alLeo,ICRS,10,08,22.4593,+11,58,01.9027,-248.73,5.59,5.9,42.09,1.35, 12, 2149
|
||||
Denebola ,beLeo,ICRS,11,49,03.5776,+14,34,19.417,-499.02,-113.78,-0.2,90.16,2.14, 15, 2383
|
||||
Uttaraphalguni,beLeo,ICRS,11,49,03.5776,+14,34,19.417,-499.02,-113.78,-0.2,90.16,2.14, 15, 2383
|
||||
Algieba ,ga-1Leo,ICRS,10,19,58.427,+19,50,28.53,294.9,-154.0,-36.7,25.96,2.12, 20, 2467
|
||||
Dhur ,deLeo,ICRS,11,14,06.5013,+20,31,25.381,143.31,-130.43,-20.2,56.52,2.56, 21, 2298
|
||||
Zosma ,deLeo,ICRS,11,14,06.5013,+20,31,25.381,143.31,-130.43,-20.2,56.52,2.56, 21, 2298
|
||||
Purvaphalguni,deLeo,ICRS,11,14,06.5013,+20,31,25.381,143.31,-130.43,-20.2,56.52,2.56, 21, 2298
|
||||
Ras Elased Australis,epLeo,ICRS,09,45,51.0730,+23,46,27.317,-46.09,-9.57,4.3,13.01,2.975, 24, 2129
|
||||
Adhafera ,zeLeo,ICRS,10,16,41.4169,+23,25,02.318,19.84,-7.30,-15.6,12.56,3.443, 24, 2209
|
||||
Algieba ,etLeo,ICRS,10,07,19.9523,+16,45,45.592,-1.94,-0.53,3.3,1.53,3.511, 17, 2171
|
||||
|
@ -737,6 +754,7 @@ Zubenelakribi,deLib,ICRS,15,00,58.3486,-08,31,08.195,-66.20,-3.40,-38.7,10.72,4.
|
|||
Zuben Elakribi,deLib,ICRS,15,00,58.3486,-08,31,08.195,-66.20,-3.40,-38.7,10.72,4.95,-07, 3938
|
||||
,ze-1Lib,ICRS,15,28,15.4082,-16,42,59.343,16.66,-33.36,-21.4,3.59,5.656,-16, 4089
|
||||
,io-1Lib,ICRS,15,12,13.2901,-19,47,30.158,-35.59,-32.55,-11.6,8.66,4.54,-19, 4047
|
||||
Vishakha ,io-1Lib,ICRS,15,12,13.2901,-19,47,30.158,-35.59,-32.55,-11.6,8.66,4.54,-19, 4047
|
||||
,kaLib,ICRS,15,41,56.7981,-19,40,43.781,-33.21,-104.33,-3.8,8.16,4.765,-19, 4188
|
||||
,laLib,ICRS,15,53,20.0586,-20,10,01.345,-3.61,-19.00,6,9.15,5.029,-19, 4249
|
||||
Zubenhakrabi ,nuLib,ICRS,15,06,37.5962,-16,15,24.544,-36.41,-23.28,-15.1,4.26,5.202,-15, 4026
|
||||
|
@ -771,6 +789,7 @@ Maculosa ,38Lyn,ICRS,09,18,50.6436,+36,48,09.348,-32.61,-123.78,4.0,26.75,3.
|
|||
Maculata ,38Lyn,ICRS,09,18,50.6436,+36,48,09.348,-32.61,-123.78,4.0,26.75,3.82, 0, 0
|
||||
# Lyra
|
||||
Vega ,alLyr,ICRS,18,36,56.3364,+38,47,01.291,201.03,287.47,-13.9,128.93,0.03, 38, 3238
|
||||
Abhijit ,alLyr,ICRS,18,36,56.3364,+38,47,01.291,201.03,287.47,-13.9,128.93,0.03, 38, 3238
|
||||
Sheliak ,beLyr,ICRS,18,50,04.7947,+33,21,45.601,1.10,-4.46,-19.2,3.70,3.52, 33, 3223
|
||||
Sulaphat ,gaLyr,ICRS,18,58,56.6227,+32,41,22.407,-2.76,1.77,-21.1,5.14,3.250, 32, 3286
|
||||
Sulafat ,gaLyr,ICRS,18,58,56.6227,+32,41,22.407,-2.76,1.77,-21.1,5.14,3.250, 32, 3286
|
||||
|
@ -845,6 +864,7 @@ Barnard's star,V2500 Oph,ICRS,17,57,48.96543,+04,40,05.8361,-798.58,10328.12,-10
|
|||
# Orion
|
||||
Betelgeuse ,alOri,ICRS,05,55,10.3053,+07,24,25.426,27.33,10.86,21.91,7.63,0.42, 07, 1055
|
||||
Beteigeuse ,alOri,ICRS,05,55,10.3053,+07,24,25.426,27.33,10.86,21.91,7.63,0.42, 07, 1055
|
||||
Punarvasu ,alOri,ICRS,05,55,10.3053,+07,24,25.426,27.33,10.86,21.91,7.63,0.42, 07, 1055
|
||||
Rigel ,beOri,ICRS,05,14,32.2723,-08,12,05.906,1.87,-0.56,20.7,4.22,0.12,-08, 1063
|
||||
Bellatrix ,gaOri,ICRS,05,25,07.8631,+06,20,58.928,-8.75,-13.28,18.2,13.42,1.64, 06, 919
|
||||
Mintaka ,deOri,ICRS,05,32, 0.4007,-00,17,56.731,1.67,-0.56,16.0,3.56,2.23,-00, 983
|
||||
|
@ -856,6 +876,7 @@ Nair al Saif ,ioOri,ICRS,05,35,25.9825,-05,54,35.645,2.27,-0.62,21.5,2.46,2.77,-
|
|||
Saiph ,kaOri,ICRS,05,47,45.3889,-09,40,10.577,1.55,-1.20,20.5,4.52,2.049,-09, 1235
|
||||
Heka ,laOri,ICRS,05,35,08.2771,+09,56,02.970,-1.03,-1.86,,3.09,3.39, 09, 879
|
||||
Meissa ,laOri,ICRS,05,35,08.2771,+09,56,02.970,-1.03,-1.86,,3.09,3.39, 09, 879
|
||||
Mrgashirsha ,laOri,ICRS,05,35,08.2771,+09,56,02.970,-1.03,-1.86,,3.09,3.39, 09, 879
|
||||
,muOri,ICRS,06,02,22.9988,+09,38,50.196,14.19,-37.44,45,21.49,4.130, 14, 1152
|
||||
,nuOri,ICRS,06,07,34.3249,+14,46,06.498,4.95,-21.18,24.1,6.10,4.403, 0, 0
|
||||
,xiOri,ICRS,06,11,56.3958,+14,12,31.554,-1.59,-20.23,24,5.14,4.442, 0, 0
|
||||
|
@ -900,8 +921,10 @@ Ankaa ,alPhe,ICRS,00,26,17.0509,-42,18,21.533,232.75,-353.62,74.6,42.14,2
|
|||
,omePhe,ICRS,01,02, 1.8208,-57,00, 8.601, 0.0442667, 1.653, 13.0,0.00886, 6.109,-57, 220
|
||||
# Pegasus
|
||||
Markab ,alPeg,ICRS,23,04,45.6538,+15,12,18.952,61.10,-42.56,-3.5,23.36,2.49, 14, 4926
|
||||
Purvabhadra ,alPeg,ICRS,23,04,45.6538,+15,12,18.952,61.10,-42.56,-3.5,23.36,2.49, 14, 4926
|
||||
Scheat ,bePeg,ICRS,23,03,46.4575,+28,04,58.041,187.76,137.61,8.01,16.37,2.42, 27, 4480
|
||||
Algenib ,gaPeg,ICRS,00,13,14.1528,+15,11,00.945,4.70,-8.24,4.1,9.79,2.83, 14, 14
|
||||
Uttarabhadra ,gaPeg,ICRS,00,13,14.1528,+15,11,00.945,4.70,-8.24,4.1,9.79,2.83, 14, 14
|
||||
Enif ,epPeg,ICRS,21,44,11.1581,+09,52,30.041,30.02,1.38,3.39,4.85,2.404, 09, 4891
|
||||
Homam ,zePeg,ICRS,22,41,27.7208,+10,49,52.912,77.38,-10.98,7,15.64,3.40, 10, 4797
|
||||
Matar ,etPeg,ICRS,22,43,00.1374,+30,13,16.483,13.11,-26.11,4.3,15.18,2.948, 29, 4741
|
||||
|
@ -969,6 +992,7 @@ Simmah ,gaPsc,ICRS,23,17,09.9379,+03,16,56.240,760.35,17.96,-13.6,24.92,3.
|
|||
Linteum ,dePsc,ICRS,00,48,40.9443,+07,35,06.285,83.14,-50.48,32.40,10.69,4.439, 06, 107
|
||||
Kaht ,epPsc,ICRS,01,02,56.6084,+07,53,24.488,-80.57,25.88,7.47,17.14,4.28, 07, 153
|
||||
,zePsc,ICRS,01,13,43.8857, 07,34,31.274,141.66,-55.62,0.0,22.09, 5.204, 06, 174
|
||||
Revati ,zePsc,ICRS,01,13,43.8857, 07,34,31.274,141.66,-55.62,0.0,22.09, 5.204, 06, 174
|
||||
Al Pherg ,etPsc,ICRS,01,31,29.0094,+15,20,44.963,25.73,-3.29,14.8,11.09,3.620, 14, 231
|
||||
,thPsc,ICRS,23,27,58.0951,+06,22,44.372,-123.83,-43.26,6.05,20.54,4.280, 05, 5173
|
||||
,ioPsc,ICRS,23,39,57.0409,+05,37,34.650,376.32,-437.00,5.0,72.51,4.120, 04, 5035
|
||||
|
@ -1022,6 +1046,7 @@ Anazitisi ,taPup,ICRS,06,49,56.1683,-50,36,52.415,34.23,-65.85,36.4,17.85,2.9
|
|||
,siScl,ICRS,01,02,26.4332,-31,33,07.218,81.00,15.25,-8,14.39,5.509,-32, 410
|
||||
# Scorpius
|
||||
Antares ,alSco,ICRS,16,29,24.4609,-26,25,55.209,-10.16,-23.21,-3.4,5.40,1.09,-26,11359
|
||||
Jyeshtha ,alSco,ICRS,16,29,24.4609,-26,25,55.209,-10.16,-23.21,-3.4,5.40,1.09,-26,11359
|
||||
Graffias ,be-1Sco,ICRS,16,05,26.5538,-19,48,06.696,-34.59,-7.47,-3.6,2.88,4.89,-19, 4307
|
||||
Akrab ,be-1Sco,ICRS,16,05,26.5538,-19,48,06.696,-34.59,-7.47,-3.6,2.88,4.89,-19, 4307
|
||||
Acrab ,be-1Sco,ICRS,16,05,26.5538,-19,48,06.696,-34.59,-7.47,-3.6,2.88,4.89,-19, 4307
|
||||
|
@ -1032,6 +1057,7 @@ Aculeus ,M6,ICRS,17,40,18.0,-32,12,0.0,-2.38,-07.19,-11.50,0.0, 4.2,0, 0 #
|
|||
#Acumen ,M7,2000,17,53,54.0,-34,49,0.0,2.58,-4.54,-14.21,0.0, 3.3,0, 0 # NGC 6475, from Starlight
|
||||
Acumen ,M7,ICRS,17,53,48.0,-34,47,0.0,2.58,-4.54,-14.21,0.0, 3.3,0, 0 # NGC 6475
|
||||
Dschubba ,deSco,ICRS,16,00,20.0063,-22,37,18.156,-8.67,-36.90,-7,8.12,2.291,-22, 4068
|
||||
Anuradha ,deSco,ICRS,16,00,20.0063,-22,37,18.156,-8.67,-36.90,-7,8.12,2.291,-22, 4068
|
||||
Wei ,epSco,ICRS,16,50,09.8130,-34,17,35.634,-611.84,-255.86,-2.5,49.85,2.29,-34,11285
|
||||
,ze-2Sco,ICRS,16,54,35.0053,-42,21,40.726,-126.55,-227.77,-18.7,21.67,3.62,0, 0
|
||||
,etSco,ICRS,17,12,09.1935,-43,14,21.080,22.01,-287.42,-27.0,45.56,3.33,-43,11485
|
||||
|
@ -1039,6 +1065,7 @@ Sargas ,thSco,ICRS,17,37,19.1306,-42,59,52.166,6.06,-0.95,1.4,11.99,1.862,
|
|||
,io-1Sco,ICRS,17,47,35.0815,-40,07,37.191,0.44,-6.40,-27.6,1.82,3.020,-40,11838
|
||||
Girtab ,kaSco,ICRS,17,42,29.2749,-39,01,47.939,-6.49,-25.55,-14.0,7.03,2.375,-38,12137
|
||||
Shaula ,laSco,ICRS,17,33,36.520,-37,06,13.76,-8.90,-29.95,-3,4.64,1.62,-37,11673
|
||||
Mula ,laSco,ICRS,17,33,36.520,-37,06,13.76,-8.90,-29.95,-3,4.64,1.62,-37,11673
|
||||
,mu-1Sco,ICRS,16,51,52.2323,-38,02,50.567,-8.84,-21.60,-25,3.97,2.98,-37,11033
|
||||
Jabbah ,nuSco,ICRS,16,11,59.7345,-19,27,38.550, -9.70,-25.25,2.4,7.47, 4.00,-19, 4333
|
||||
Grafias ,xiSco,ICRS,16,04,22.191,-11,22,22.60,-63.2,-27.0,-36.33,,4.17,-10, 4237
|
||||
|
@ -1089,6 +1116,7 @@ Alnasl ,ga-2Sgr,ICRS,18,05,48.4869,-30,25,26.729,-55.75,-181.53,22.0,33.94,2
|
|||
Nash ,ga-2Sgr,ICRS,18,05,48.4869,-30,25,26.729,-55.75,-181.53,22.0,33.94,2.99,-30,15215
|
||||
Kaus Medis ,deSgr,ICRS,18,20,59.6417,-29,49,41.172,29.96,-26.38,-19.9,10.67,2.710,-29,14834
|
||||
Kaus Meridionalis,deSgr,ICRS,18,20,59.6417,-29,49,41.172,29.96,-26.38,-19.9,10.67,2.710,-29,14834
|
||||
Purvashadha ,deSgr,ICRS,18,20,59.6417,-29,49,41.172,29.96,-26.38,-19.9,10.67,2.710,-29,14834
|
||||
Kaus Australis,epSgr,ICRS,18,24,10.3183,-34,23,04.618,-39.61,-124.05,-15,22.55,1.80,-34, 12784
|
||||
Ascella ,zeSgr,ICRS,19,02,36.7139,-29,52,48.379,-14.10,3.66,22,36.61,2.607,-30,16575
|
||||
Sephdar ,etSgr,ICRS,18,17,37.6351,-36,45,42.070,-129.27,-166.61,0.5,21.87,3.11,-36,12423
|
||||
|
@ -1104,6 +1132,7 @@ Ain al Rami,nu-1Sgr,ICRS,18,54,10.1771,-22,44,41.403,2.95,-5.70,-12.1,1.76,4.859
|
|||
Manubrium ,omiSgr,ICRS,19,04,40.9817,-21,44,29.384,76.26,-58.08,25.2,23.49,3.771,-21, 5237
|
||||
Albaldah ,piSgr,ICRS,19,09,45.8331,-21,01,25.013,-1.17,-36.83,-9.8,7.41,2.89,-21, 5275
|
||||
Nunki ,siSgr,ICRS,18,55,15.9257,-26,17,48.200,13.87,-52.65,-11.2,14.54,2.058,-26,13595
|
||||
Uttarashadha ,siSgr,ICRS,18,55,15.9257,-26,17,48.200,13.87,-52.65,-11.2,14.54,2.058,-26,13595
|
||||
Hecatebolus ,taSgr,ICRS,19,06,56.4089,-27,40,13.523,-50.79,-250.50,45.4,27.09,3.32,-27,13564
|
||||
Nanto ,phSgr,ICRS,18,45,39.3865,-26,59,26.802,51.15,0.45,21.5,14.14,3.161,-27,13170
|
||||
,upSgr,ICRS,19,21,43.615,-15,57,17.76,1.79,-6.27,8.9,1.95,4.578,-16, 5283
|
||||
|
@ -1126,6 +1155,7 @@ Hyadum II ,de-1Tau,ICRS,04,22,56.0933,+17,32,33.051,107.75,-28.84,38.8,21.29,3.
|
|||
Ain ,epTau,ICRS,04,28,36.9995,+19,10,49.554,107.23,-36.77,38.15,21.04,3.540, 18, 640
|
||||
Al Hecka ,zeTau,ICRS,05,37,38.6858,+21,08,33.177,2.39,-18.04,20,7.82,3.03, 21, 908
|
||||
Alcyone ,etTau,ICRS,03,47,29.0765,+24,06,18.494,19.35,-43.11,10.1,8.87,2.873, 23, 541
|
||||
Krttika ,etTau,ICRS,03,47,29.0765,+24,06,18.494,19.35,-43.11,10.1,8.87,2.873, 23, 541
|
||||
Phaeo ,th-1Tau,ICRS,04,28,34.4959,+15,57,43.851,104.76,-15.01,39.8,20.66,3.840, 0, 0
|
||||
Phaesula ,th-2Tau,ICRS,04,28,39.7408,+15,52,15.178,108.66,-26.39,39.5,21.89,3.410, 21, 751
|
||||
,ioTau,ICRS,05,03,05.7473,+21,35,23.865,68.94,-40.85,40.6,20.01,4.626, 21, 751
|
||||
|
@ -1221,6 +1251,7 @@ Xestus ,omiVel,ICRS,08,40,17.5854,-52,55,18.794,-24.62,35.09,16.1,6.59,3.63
|
|||
Tseen Ke ,phVel,ICRS,09,56,51.7417,-54,34,04.046,-13.13,2.83,13.9,1.69,3.50,-53, 3075
|
||||
# Virgo
|
||||
Spica ,alVir,ICRS,13,25,11.5793,-11,09,40.759,-42.50,-31.73,1.0,12.44,1.04,-10, 3672
|
||||
Citra ,alVir,ICRS,13,25,11.5793,-11,09,40.759,-42.50,-31.73,1.0,12.44,1.04,-10, 3672
|
||||
Zavijava ,beVir,ICRS,11,50,41.7185,+01,45,52.985,740.95,-271.18,4.6,91.74,3.61, 02, 2489
|
||||
Alaraph ,beVir,ICRS,11,50,41.7185,+01,45,52.985,740.95,-271.18,4.6,91.74,3.61, 02, 2489
|
||||
Porrima ,gaVir,ICRS,12,41,39.642,-01,26,57.75,-616.66,60.66, 0.0,84.53, 2.74,-00, 2601
|
||||
|
@ -1256,3 +1287,4 @@ Anser ,alVul,ICRS,19,28,42.3299,+24,39,53.657,-126.45,-106.99,-85.53,11.0
|
|||
#
|
||||
# test star from Astronomica Almanac 2011
|
||||
AA11_page_B73, ,ICRS,14,39,36.4958,-60,50, 2.309,-3678.06, 482.87, -21.6,742,0 , 0, 0
|
||||
GCRS00, ,ICRS,0,0,0.0,0,0, 0.0,0.0, 0.0, 0.0,0,0 , 0, 0
|
||||
|
|
|
@ -25,11 +25,10 @@
|
|||
# e.g. number of Kronos is ipl = 39 + 4 = 43
|
||||
#
|
||||
# Witte/Sieggruen planets, refined by James Neely
|
||||
#2456200.5, J2000, 143.49291, 1.4579341, 0.2225740, 178.78899, 304.33810, 10.82816, Eros # 1
|
||||
J1900, J1900, 163.7409, 40.99837, 0.00460, 171.4333, 129.8325, 1.0833, Cupido # 1
|
||||
J1900, J1900, 27.6496, 50.66744, 0.00245, 148.1796, 161.3339, 1.0500, Hades # 2
|
||||
J1900, J1900, 165.1232, 59.21436, 0.00120, 299.0440, 0.0000, 0.0000, Zeus # 3
|
||||
J1900, J1900, 169.0193, 64.81960, 0.00305, 208.8801, 0.0000, 0.0000, Kronos # 4
|
||||
J1900, J1900, 169.0193, 64.81690, 0.00305, 208.8801, 0.0000, 0.0000, Kronos # 4
|
||||
J1900, J1900, 138.0533, 70.29949, 0.00000, 0.0000, 0.0000, 0.0000, Apollon # 5
|
||||
J1900, J1900, 351.3350, 73.62765, 0.00000, 0.0000, 0.0000, 0.0000, Admetos # 6
|
||||
J1900, J1900, 55.8983, 77.25568, 0.00000, 0.0000, 0.0000, 0.0000, Vulcanus # 7
|
||||
|
@ -67,10 +66,9 @@ J1900,JDATE, 170.73, 79.225630, 0, 0, 0, 0, Proserpina #18
|
|||
# Neither Swisseph nor Solar fire elements agree with Delphine Jay's ephemeris,
|
||||
# which is obviously wrong.
|
||||
2414290.95827875,2414290.95827875, 70.3407215 + 109023.2634989 * T, 0.0068400705250028, 0.1587, 8.14049594 + 2393.47417444 * T, 136.24878256 - 1131.71719709 * T, 2.5, Waldemath, geo # 19
|
||||
##############################################
|
||||
#
|
||||
# The following elements are for test only
|
||||
# (Selena without T)
|
||||
2454000.5,J2000,268.05505,57.3693459,0.1104221,284.48762,252.36907,46.75377,2004XR190
|
||||
J2000,JDATE, 242.2205555, 0.05279142865925, 0.0, 0.0, 0.0, 0.0, Selena/White Moon, geo # 17
|
||||
# (Selena with T, gives exactly the same position)
|
||||
J2000,JDATE, 242.2205555 + 5143.5418158 * T, 0.05279142865925, 0.0, 0.0, 0.0, 0.0, Selena/White Moon with T Terms, geo # 17
|
||||
|
|
529
swe/src/swecl.c
529
swe/src/swecl.c
File diff suppressed because it is too large
Load Diff
|
@ -276,7 +276,7 @@ void FAR PASCAL_CONV swe_utc_time_zone(
|
|||
*/
|
||||
|
||||
/* Leap seconds were inserted at the end of the following days:*/
|
||||
#define NLEAP_SECONDS 24
|
||||
#define NLEAP_SECONDS 26
|
||||
#define NLEAP_SECONDS_SPACE 100
|
||||
static int leap_seconds[NLEAP_SECONDS_SPACE] = {
|
||||
19720630,
|
||||
|
@ -303,6 +303,8 @@ static int leap_seconds[NLEAP_SECONDS_SPACE] = {
|
|||
19981231,
|
||||
20051231,
|
||||
20081231,
|
||||
20120630,
|
||||
20150630,
|
||||
0 /* keep this 0 as end mark */
|
||||
};
|
||||
#define J1972 2441317.5
|
||||
|
@ -403,7 +405,7 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
|||
*/
|
||||
if (tjd_ut1 < J1972) {
|
||||
dret[1] = swe_julday(iyear, imonth, iday, dhour, gregflag);
|
||||
dret[0] = dret[1] + swe_deltat(dret[1]);
|
||||
dret[0] = dret[1] + swe_deltat_ex(dret[1], -1, NULL);
|
||||
return OK;
|
||||
}
|
||||
/*
|
||||
|
@ -430,10 +432,10 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
|||
* input time as UT1, not as UTC. How do we find out?
|
||||
* Check, if delta_t - nleap - 32.184 > 0.9
|
||||
*/
|
||||
d = swe_deltat(tjd_ut1) * 86400.0;
|
||||
d = swe_deltat_ex(tjd_ut1, -1, NULL) * 86400.0;
|
||||
if (d - (double) nleap - 32.184 >= 1.0) {
|
||||
dret[1] = tjd_ut1 + dhour / 24.0;
|
||||
dret[0] = dret[1] + swe_deltat(dret[1]);
|
||||
dret[0] = dret[1] + swe_deltat_ex(dret[1], -1, NULL);
|
||||
return OK;
|
||||
}
|
||||
/*
|
||||
|
@ -463,8 +465,9 @@ int32 FAR PASCAL_CONV swe_utc_to_jd(int32 iyear, int32 imonth, int32 iday, int32
|
|||
/* ET (TT) */
|
||||
tjd_et_1972 = J1972 + (32.184 + NLEAP_INIT) / 86400.0;
|
||||
tjd_et = tjd_et_1972 + d + ((double) (nleap - NLEAP_INIT)) / 86400.0;
|
||||
d = swe_deltat(tjd_et);
|
||||
tjd_ut1 = tjd_et - swe_deltat(tjd_et - d);
|
||||
d = swe_deltat_ex(tjd_et, -1, NULL);
|
||||
tjd_ut1 = tjd_et - swe_deltat_ex(tjd_et - d, -1, NULL);
|
||||
tjd_ut1 = tjd_et - swe_deltat_ex(tjd_ut1, -1, NULL);
|
||||
dret[0] = tjd_et;
|
||||
dret[1] = tjd_ut1;
|
||||
return OK;
|
||||
|
@ -494,8 +497,9 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
|
|||
* if tjd_et is before 1 jan 1972 UTC, return UT1
|
||||
*/
|
||||
tjd_et_1972 = J1972 + (32.184 + NLEAP_INIT) / 86400.0;
|
||||
d = swe_deltat(tjd_et);
|
||||
tjd_ut = tjd_et - swe_deltat(tjd_et - d);
|
||||
d = swe_deltat_ex(tjd_et, -1, NULL);
|
||||
tjd_ut = tjd_et - swe_deltat_ex(tjd_et - d, -1, NULL);
|
||||
tjd_ut = tjd_et - swe_deltat_ex(tjd_ut, -1, NULL);
|
||||
if (tjd_et < tjd_et_1972) {
|
||||
swe_revjul(tjd_ut, gregflag, iyear, imonth, iday, &d);
|
||||
*ihour = (int32) d;
|
||||
|
@ -550,8 +554,8 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
|
|||
* input time as UT1, not as UTC. How do we find out?
|
||||
* Check, if delta_t - nleap - 32.184 > 0.9
|
||||
*/
|
||||
d = swe_deltat(tjd_et);
|
||||
d = swe_deltat(tjd_et - d);
|
||||
d = swe_deltat_ex(tjd_et, -1, NULL);
|
||||
d = swe_deltat_ex(tjd_et - d, -1, NULL);
|
||||
if (d * 86400.0 - (double) (nleap + NLEAP_INIT) - 32.184 >= 1.0) {
|
||||
swe_revjul(tjd_et - d, SE_GREG_CAL, iyear, imonth, iday, &d);
|
||||
*ihour = (int32) d;
|
||||
|
@ -582,6 +586,7 @@ void FAR PASCAL_CONV swe_jdet_to_utc(double tjd_et, int32 gregflag, int32 *iyear
|
|||
*/
|
||||
void FAR PASCAL_CONV swe_jdut1_to_utc(double tjd_ut, int32 gregflag, int32 *iyear, int32 *imonth, int32 *iday, int32 *ihour, int32 *imin, double *dsec)
|
||||
{
|
||||
double tjd_et = tjd_ut + swe_deltat(tjd_ut);
|
||||
double tjd_et = tjd_ut + swe_deltat_ex(tjd_ut, -1, NULL);
|
||||
swe_jdet_to_utc(tjd_et, gregflag, iyear, imonth, iday, ihour, imin, dsec);
|
||||
}
|
||||
|
||||
|
|
|
@ -118,6 +118,7 @@ DllImport int32 FAR PASCAL swe_fixstar_mag(
|
|||
DllImport double FAR PASCAL swe_sidtime0(double tjd_ut, double ecl, double nut);
|
||||
DllImport double FAR PASCAL swe_sidtime(double tjd_ut);
|
||||
|
||||
DllImport double FAR PASCAL swe_deltat_ex(double tjd, int32 iflag, char *serr);
|
||||
DllImport double FAR PASCAL swe_deltat(double tjd);
|
||||
|
||||
DllImport int FAR PASCAL swe_houses(
|
||||
|
@ -143,8 +144,10 @@ DllImport int32 FAR PASCAL swe_gauquelin_sector(
|
|||
DllImport void FAR PASCAL swe_set_sid_mode(
|
||||
int32 sid_mode, double t0, double ayan_t0);
|
||||
|
||||
DllImport double FAR PASCAL swe_get_ayanamsa(double tjd_et);
|
||||
DllImport int32 FAR PASCAL swe_get_ayanamsa_ex(double tjd_et, int32 iflag, double *daya, char *serr);
|
||||
DllImport int32 FAR PASCAL swe_get_ayanamsa_ex_ut(double tjd_ut, int32 iflag, double *daya, char *serr);
|
||||
|
||||
DllImport double FAR PASCAL swe_get_ayanamsa(double tjd_et);
|
||||
DllImport double FAR PASCAL swe_get_ayanamsa_ut(double tjd_ut);
|
||||
|
||||
DllImport char *FAR PASCAL swe_get_ayanamsa_name(int32 isidmode);
|
||||
|
@ -203,6 +206,8 @@ DllImport void FAR PASCAL swe_cotrans_sp(double *xpo, double *xpn, double eps);
|
|||
|
||||
DllImport void FAR PASCAL swe_set_topo(double geolon, double geolat, double height);
|
||||
|
||||
DllImport void FAR PASCAL swe_set_astro_models(int32 *imodel);
|
||||
|
||||
/****************************
|
||||
* from swecl.c
|
||||
****************************/
|
||||
|
|
194
swe/src/swehel.c
194
swe/src/swehel.c
|
@ -93,7 +93,6 @@
|
|||
#define M2S 60.0 /*[sec]*/
|
||||
|
||||
/* Determines which algorimths are used*/
|
||||
#define USE_DELTA_T_VR 0
|
||||
#define REFR_SINCLAIR 0
|
||||
#define REFR_BENNETTH 1
|
||||
#define FormAstroRefrac REFR_SINCLAIR /*for Astronomical refraction can be "bennetth" or "sinclair"*/
|
||||
|
@ -402,6 +401,7 @@ static int32 calc_rise_and_set(double tjd_start, int32 ipl, double *dgeo, double
|
|||
double tjd0 = tjd_start, tjdrise;
|
||||
double tjdnoon = (int) tjd0 - dgeo[0] / 15.0 / 24.0;
|
||||
int32 iflag = helflag & (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH);
|
||||
int32 epheflag = iflag;
|
||||
iflag |= SEFLG_EQUATORIAL;
|
||||
if (!(helflag & SE_HELFLAG_HIGH_PRECISION))
|
||||
iflag |= SEFLG_NONUT|SEFLG_TRUEPOS;
|
||||
|
@ -460,14 +460,16 @@ else
|
|||
/* now calculate more accurate rising and setting times.
|
||||
* use vertical speed in order to determine crossing of the horizon
|
||||
* refraction of 34' and solar disk diameter of 16' = 50' = 0.84 deg */
|
||||
iflag = SEFLG_SPEED|SEFLG_EQUATORIAL;
|
||||
iflag = epheflag|SEFLG_SPEED|SEFLG_EQUATORIAL;
|
||||
if (ipl == SE_MOON)
|
||||
iflag |= SEFLG_TOPOCTR;
|
||||
if (!(helflag & SE_HELFLAG_HIGH_PRECISION))
|
||||
iflag |= SEFLG_NONUT|SEFLG_TRUEPOS;
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (swe_calc_ut(tjdrise, ipl, iflag, xx, serr) == ERR)
|
||||
if (swe_calc_ut(tjdrise, ipl, iflag, xx, serr) == ERR) {
|
||||
/*fprintf(stderr, "hev4 tjd=%f, ipl=%d, iflag=%d\n", tjdrise, ipl, iflag);*/
|
||||
return ERR;
|
||||
}
|
||||
swe_azalt(tjdrise, SE_EQU2HOR, dgeo, datm[0], datm[1], xx, xaz);
|
||||
xx[0] -= xx[3] * dfac;
|
||||
xx[1] -= xx[4] * dfac;
|
||||
|
@ -539,7 +541,7 @@ static double SunRA(double JDNDaysUT, int32 helflag, char *serr)
|
|||
int32 epheflag = helflag & (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH);
|
||||
int32 iflag = epheflag | SEFLG_EQUATORIAL;
|
||||
iflag |= SEFLG_NONUT | SEFLG_TRUEPOS;
|
||||
tjd_tt = JDNDaysUT + swe_deltat(JDNDaysUT);
|
||||
tjd_tt = JDNDaysUT + swe_deltat_ex(JDNDaysUT, epheflag, serr);
|
||||
if (swe_calc(tjd_tt, SE_SUN, iflag, x, serr) != ERR) {
|
||||
ralast = x[0];
|
||||
tjdlast = JDNDaysUT;
|
||||
|
@ -643,60 +645,6 @@ static double HourAngle(double TopoAlt, double TopoDecl, double Lat)
|
|||
return acos(ha) / DEGTORAD / 15.0;
|
||||
}
|
||||
|
||||
/*###################################################################
|
||||
' JDNDays [Days]
|
||||
' COD [msec/cy]
|
||||
' DeltaTSE [Sec]
|
||||
*/
|
||||
static double DeltaTSE(double JDNDays, int COD)
|
||||
{
|
||||
double OffSetYear;
|
||||
int gregflag = SE_GREG_CAL;
|
||||
if (StartYear < 1583)
|
||||
gregflag = SE_JUL_CAL;
|
||||
/* from Swiss Emphemeris */
|
||||
if (COD != 0) {
|
||||
/* Determined by V. Reijs*/
|
||||
OffSetYear = (swe_julday((int) StartYear, 1, 1, 0, gregflag) - JDNDays) / 365.25;
|
||||
return (OffSetYear * OffSetYear / 100.0 / 2.0 * COD * Y2D) / 1000.0;
|
||||
}
|
||||
return swe_deltat(JDNDays) * D2S;
|
||||
}
|
||||
|
||||
/*###################################################################
|
||||
' JDNDays [Day]
|
||||
' COD [msec/cy]
|
||||
' DeltaTVR [Sec]
|
||||
*/
|
||||
static double DeltaTVR(double JDNDays, int COD)
|
||||
{
|
||||
/* Determined by V. Reijs */
|
||||
double DeltaTVR;
|
||||
int gregflag = SE_GREG_CAL;
|
||||
double OffSetYear;
|
||||
if (StartYear < 1583)
|
||||
gregflag = SE_JUL_CAL;
|
||||
OffSetYear = (swe_julday((int) StartYear, 1, 1, 0, gregflag) - JDNDays) / 365.25;
|
||||
if (COD == 0) {
|
||||
DeltaTVR = (OffSetYear * OffSetYear / 100.0 / 2.0 * Average + Periodicy / 2.0 / PI * Amplitude * (cos((2 * PI * OffSetYear / Periodicy)) - 1)) * Y2D;
|
||||
} else {
|
||||
DeltaTVR = OffSetYear * OffSetYear / 100.0 / 2.0 * COD * Y2D;
|
||||
}
|
||||
return DeltaTVR / 1000.0;
|
||||
}
|
||||
|
||||
/*###################################################################
|
||||
' JDNDays [Days]
|
||||
' COD [msec/cy]
|
||||
' DeltaT [Sec]
|
||||
*/
|
||||
static double DeltaT(double JDNDays, int COD)
|
||||
{
|
||||
if (USE_DELTA_T_VR)
|
||||
return DeltaTVR(JDNDays, COD);
|
||||
return DeltaTSE(JDNDays, COD);
|
||||
}
|
||||
|
||||
/*###################################################################
|
||||
' JDNDaysUT [Days]
|
||||
' dgeo [array: longitude, latitude, eye height above sea m]
|
||||
|
@ -718,7 +666,7 @@ static int32 ObjectLoc(double JDNDaysUT, double *dgeo, double *datm, char *Objec
|
|||
iflag |= SEFLG_NONUT | SEFLG_TRUEPOS;
|
||||
if (Angle < 5) iflag = iflag | SEFLG_TOPOCTR;
|
||||
if (Angle == 7) Angle = 0;
|
||||
tjd_tt = JDNDaysUT + DeltaT(JDNDaysUT, 0) / D2S;
|
||||
tjd_tt = JDNDaysUT + swe_deltat_ex(JDNDaysUT, epheflag, serr);
|
||||
Planet = DeterObject(ObjectName);
|
||||
if (Planet != -1) {
|
||||
if (swe_calc(tjd_tt, Planet, iflag, x, serr) == ERR)
|
||||
|
@ -771,7 +719,7 @@ static int32 azalt_cart(double JDNDaysUT, double *dgeo, double *datm, char *Obje
|
|||
if (!(helflag & SE_HELFLAG_HIGH_PRECISION))
|
||||
iflag |= SEFLG_NONUT | SEFLG_TRUEPOS;
|
||||
iflag = iflag | SEFLG_TOPOCTR;
|
||||
tjd_tt = JDNDaysUT + DeltaT(JDNDaysUT, 0) / D2S;
|
||||
tjd_tt = JDNDaysUT + swe_deltat_ex(JDNDaysUT, epheflag, serr);
|
||||
Planet = DeterObject(ObjectName);
|
||||
if (Planet != -1) {
|
||||
if (swe_calc(tjd_tt, Planet, iflag, x, serr) == ERR)
|
||||
|
@ -1432,15 +1380,24 @@ int32 FAR PASCAL_CONV swe_vis_limit_mag(double tjdut, double *dgeo, double *datm
|
|||
{
|
||||
int32 retval = OK, i, scotopic_flag = 0;
|
||||
double AltO, AziO, AltM, AziM, AltS, AziS;
|
||||
double sunra = SunRA(tjdut, helflag, serr);
|
||||
default_heliacal_parameters(datm, dgeo, dobs, helflag);
|
||||
swe_set_topo(dgeo[0], dgeo[1], dgeo[2]);
|
||||
double sunra;
|
||||
for (i = 0; i < 7; i++)
|
||||
dret[i] = 0;
|
||||
if (DeterObject(ObjectName) == SE_SUN) {
|
||||
if (serr != NULL) {
|
||||
strcpy(serr, "it makes no sense to call swe_vis_limit_mag() for the Sun");
|
||||
}
|
||||
return ERR;
|
||||
}
|
||||
swi_set_tid_acc(tjdut, helflag, 0, serr);
|
||||
sunra = SunRA(tjdut, helflag, serr);
|
||||
default_heliacal_parameters(datm, dgeo, dobs, helflag);
|
||||
swe_set_topo(dgeo[0], dgeo[1], dgeo[2]);
|
||||
if (ObjectLoc(tjdut, dgeo, datm, ObjectName, 0, helflag, &AltO, serr) == ERR)
|
||||
return ERR;
|
||||
if (AltO < 0 && serr != NULL) {
|
||||
strcpy(serr, "object is below local horizon");
|
||||
if (AltO < 0) {
|
||||
if (serr != NULL)
|
||||
strcpy(serr, "object is below local horizon");
|
||||
*dret = -100;
|
||||
return -2;
|
||||
}
|
||||
|
@ -1557,7 +1514,9 @@ static int32 TopoArcVisionis(double Magn, double *dobs, double AltO, double AziO
|
|||
|
||||
int32 FAR PASCAL_CONV swe_topo_arcus_visionis(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double alt_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr)
|
||||
{
|
||||
double sunra = SunRA(tjdut, helflag, serr);
|
||||
double sunra;
|
||||
swi_set_tid_acc(tjdut, helflag, 0, serr);
|
||||
sunra = SunRA(tjdut, helflag, serr);
|
||||
if (serr != NULL && *serr != '\0')
|
||||
return ERR;
|
||||
return TopoArcVisionis(mag, dobs, alt_obj, azi_obj, alt_moon, azi_moon, tjdut, azi_sun, sunra, dgeo[1], dgeo[2], datm, helflag, dret, serr);
|
||||
|
@ -1648,6 +1607,12 @@ static int32 HeliacalAngle(double Magn, double *dobs, double AziO, double AltM,
|
|||
|
||||
int32 FAR PASCAL_CONV swe_heliacal_angle(double tjdut, double *dgeo, double *datm, double *dobs, int32 helflag, double mag, double azi_obj, double azi_sun, double azi_moon, double alt_moon, double *dret, char *serr)
|
||||
{
|
||||
if (dgeo[2] < SEI_ECL_GEOALT_MIN || dgeo[2] > SEI_ECL_GEOALT_MAX) {
|
||||
if (serr != NULL)
|
||||
sprintf(serr, "location for heliacal events must be between %.0f and %.0f m above sea", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
|
||||
return ERR;
|
||||
}
|
||||
swi_set_tid_acc(tjdut, helflag, 0, serr);
|
||||
return HeliacalAngle(mag, dobs, azi_obj, alt_moon, azi_moon, tjdut, azi_sun, dgeo, datm, helflag, dret, serr);
|
||||
}
|
||||
|
||||
|
@ -1815,8 +1780,15 @@ int32 FAR PASCAL_CONV swe_heliacal_pheno_ut(double JDNDaysUT, double *dgeo, doub
|
|||
int32 retval = OK, RS, Planet;
|
||||
AS_BOOL noriseO = FALSE;
|
||||
char ObjectName[AS_MAXCH];
|
||||
double sunra = SunRA(JDNDaysUT, helflag, serr);
|
||||
double sunra;
|
||||
int32 iflag = helflag & (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH);
|
||||
if (dgeo[2] < SEI_ECL_GEOALT_MIN || dgeo[2] > SEI_ECL_GEOALT_MAX) {
|
||||
if (serr != NULL)
|
||||
sprintf(serr, "location for heliacal events must be between %.0f and %.0f m above sea", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
|
||||
return ERR;
|
||||
}
|
||||
swi_set_tid_acc(JDNDaysUT, helflag, 0, serr);
|
||||
sunra = SunRA(JDNDaysUT, helflag, serr);
|
||||
/* note, the fixed stars functions rewrite the star name. The input string
|
||||
may be too short, so we have to make sure we have enough space */
|
||||
strcpy_VBsafe(ObjectName, ObjectNameIn);
|
||||
|
@ -2230,7 +2202,7 @@ static int32 heliacal_ut_arc_vis(double JDNDaysUTStart, double *dgeo, double *da
|
|||
if ((retval = my_rise_trans(JDNDaysUTstep, SE_SUN, "", eventtype, helflag, dgeo, datm, &tret, serr)) == ERR)
|
||||
goto swe_heliacal_err;
|
||||
/* determine time compensation to get Sun's altitude at heliacal rise */
|
||||
tjd_tt = tret + DeltaT(tret, 0) / D2S;
|
||||
tjd_tt = tret + swe_deltat_ex(tret, epheflag, serr);
|
||||
if ((retval = swe_calc(tjd_tt, SE_SUN, iflag, x, serr)) == ERR)
|
||||
goto swe_heliacal_err;
|
||||
xin[0] = x[0];
|
||||
|
@ -2245,7 +2217,7 @@ static int32 heliacal_ut_arc_vis(double JDNDaysUTStart, double *dgeo, double *da
|
|||
if (TypeEvent == 2 || TypeEvent== 3) Tdelta = -Tdelta;
|
||||
/* determine appr.time when sun is at the wanted Sun's altitude */
|
||||
JDNarcvisUT = tret - Tdelta / 24;
|
||||
tjd_tt = JDNarcvisUT + DeltaT(JDNarcvisUT, 0) / D2S;
|
||||
tjd_tt = JDNarcvisUT + swe_deltat_ex(JDNarcvisUT, epheflag, serr);
|
||||
/* determine Sun's position */
|
||||
if ((retval = swe_calc(tjd_tt, SE_SUN, iflag, x, serr)) == ERR)
|
||||
goto swe_heliacal_err;
|
||||
|
@ -2357,7 +2329,7 @@ static int32 heliacal_ut_arc_vis(double JDNDaysUTStart, double *dgeo, double *da
|
|||
do {
|
||||
OudeDatum = JDNarcvisUT;
|
||||
JDNarcvisUT = JDNarcvisUT - direct;
|
||||
tjd_tt = JDNarcvisUT + DeltaT(JDNarcvisUT, 0) / D2S;
|
||||
tjd_tt = JDNarcvisUT + swe_deltat_ex(JDNarcvisUT, epheflag, serr);
|
||||
if (Planet != -1) {
|
||||
if ((retval = swe_calc(tjd_tt, Planet, iflag, x, serr)) == ERR)
|
||||
goto swe_heliacal_err;
|
||||
|
@ -2753,8 +2725,9 @@ static int32 get_heliacal_day(double tjd, double *dgeo, double *datm, double *do
|
|||
break;
|
||||
case -1:
|
||||
ndays = 300;
|
||||
if (call_swe_fixstar_mag(ObjectName, &dmag, serr) == ERR)
|
||||
if (call_swe_fixstar_mag(ObjectName, &dmag, serr) == ERR) {
|
||||
return ERR;
|
||||
}
|
||||
daystep = 15;
|
||||
tfac = 10;
|
||||
if (dmag > 2) {
|
||||
|
@ -2776,8 +2749,9 @@ static int32 get_heliacal_day(double tjd, double *dgeo, double *datm, double *do
|
|||
(direct_day > 0 && tday < tend) || (direct_day < 0 && tday > tend);
|
||||
tday += daystep * direct_day) {
|
||||
vdelta = -100;
|
||||
if ((retval = my_rise_trans(tday, SE_SUN, "", is_rise_or_set, helflag, dgeo, datm, &tret, serr)) == ERR)
|
||||
if ((retval = my_rise_trans(tday, SE_SUN, "", is_rise_or_set, helflag, dgeo, datm, &tret, serr)) == ERR) {
|
||||
return ERR;
|
||||
}
|
||||
/* sun does not rise: try next day */
|
||||
if (retval == -2) {
|
||||
retval_old = retval;
|
||||
|
@ -2835,65 +2809,6 @@ static int32 get_heliacal_day(double tjd, double *dgeo, double *datm, double *do
|
|||
return -2;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int32 get_acronychal_day_new(double tjd, double *dgeo, double *datm, double *dobs, char *ObjectName, int32 helflag, int32 TypeEvent, double *thel, char *serr) {
|
||||
double tjdc = tjd, tret, x[6], xaz[6], AltO = -10;
|
||||
int32 retval, is_rise_or_set, iter_day;
|
||||
int32 ipl = DeterObject(ObjectName);
|
||||
int32 epheflag = helflag & (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH);
|
||||
int32 iflag = epheflag | SEFLG_EQUATORIAL | SEFLG_TOPOCTR;
|
||||
if ((retval = my_rise_trans(tret, 0, ObjectName, SE_CALC_RISE, helflag, dgeo, datm, &tret, serr)) == ERR) return ERR;
|
||||
trise = tret;
|
||||
tret += 0.01
|
||||
if ((retval = my_rise_trans(tret, 0, ObjectName, SE_CALC_SET, helflag, dgeo, datm, &tret, serr)) == ERR) return ERR;
|
||||
trise = tset;
|
||||
|
||||
*thel = tret;
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static int32 get_acronychal_day_old(double tjd, double *dgeo, double *datm, double *dobs, char *ObjectName, int32 helflag, int32 TypeEvent, double *thel, char *serr) {
|
||||
double tjdc = tjd, tret, x[6], xaz[6], AltO = -10;
|
||||
int32 retval, is_rise_or_set, iter_day;
|
||||
int32 ipl = DeterObject(ObjectName);
|
||||
int32 epheflag = helflag & (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH);
|
||||
int32 iflag = epheflag | SEFLG_EQUATORIAL | SEFLG_TOPOCTR;
|
||||
if (TypeEvent == 3) {
|
||||
is_rise_or_set = SE_CALC_SET;
|
||||
tret = tjdc - 3;
|
||||
if (ipl >= SE_MARS)
|
||||
tret = tjdc - 3;
|
||||
iter_day = 1;
|
||||
} else {
|
||||
is_rise_or_set = SE_CALC_RISE;
|
||||
tret = tjdc + 3;
|
||||
if (ipl >= SE_MARS)
|
||||
tret = tjdc + 3;
|
||||
iter_day = -1;
|
||||
}
|
||||
while (AltO < 0) {
|
||||
tret += 0.3 * iter_day;
|
||||
if (iter_day == -1)
|
||||
tret -= 1;
|
||||
retval = my_rise_trans(tret, SE_SUN, "", is_rise_or_set, helflag, dgeo, datm, &tret, serr);
|
||||
if (retval != OK)
|
||||
return retval;
|
||||
/* determine object's position */
|
||||
if (ipl == -1)
|
||||
retval = call_swe_fixstar(ObjectName, tret+swe_deltat(tret), iflag, x, serr);
|
||||
else
|
||||
retval = swe_calc(tret+swe_deltat(tret), ipl, iflag, x, serr);
|
||||
if (retval == ERR) return ERR;
|
||||
swe_azalt(tret, SE_EQU2HOR, dgeo, datm[0], datm[1], x, xaz);
|
||||
AltO = xaz[2];
|
||||
}
|
||||
*thel = tret;
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int32 time_optimum_visibility(double tjd, double *dgeo, double *datm, double *dobs, char *ObjectName, int32 helflag, double *tret, char *serr)
|
||||
{
|
||||
int32 retval, retval_sv, i;
|
||||
|
@ -3016,9 +2931,11 @@ static int32 get_acronychal_day(double tjd, double *dgeo, double *datm, double *
|
|||
retval = my_rise_trans(tjd, ipl, ObjectName, is_rise_or_set, helflag, dgeo, datm, &tjd, serr);
|
||||
if (retval == ERR) return ERR;
|
||||
retval = swe_vis_limit_mag(tjd, dgeo, datm, dobs, ObjectName, helflag, darr, serr);
|
||||
if (retval == ERR) return ERR;
|
||||
while(darr[0] < darr[7]) {
|
||||
tjd += 10.0 / 1440.0 * -direct;
|
||||
retval = swe_vis_limit_mag(tjd, dgeo, datm, dobs, ObjectName, helflag, darr, serr);
|
||||
if (retval == ERR) return ERR;
|
||||
}
|
||||
retval = time_limit_invisible(tjd, dgeo, datm, dobs, ObjectName, helflag | SE_HELFLAG_VISLIM_DARK, direct, &tret_dark, serr);
|
||||
if (retval == ERR) return ERR;
|
||||
|
@ -3137,8 +3054,9 @@ static int32 heliacal_ut_vis_lim(double tjd_start, double *dgeo, double *datm, d
|
|||
goto swe_heliacal_err; /* retval may be -2 or ERR */
|
||||
} else {
|
||||
/* find date of conjunction of object with sun */
|
||||
if ((retval = find_conjunct_sun(tjd, ipl, helflag, TypeEvent, &tjd, serr)) == ERR)
|
||||
if ((retval = find_conjunct_sun(tjd, ipl, helflag, TypeEvent, &tjd, serr)) == ERR) {
|
||||
goto swe_heliacal_err;
|
||||
}
|
||||
}
|
||||
/* find the day and minute on which the object becomes visible */
|
||||
retval = get_heliacal_day(tjd, dgeo, datm, dobs, ObjectName, helflag2, TypeEvent, &tday, serr);
|
||||
|
@ -3326,6 +3244,12 @@ int32 FAR PASCAL_CONV swe_heliacal_ut(double JDNDaysUTStart, double *dgeo, doubl
|
|||
double tjd0 = JDNDaysUTStart, tjd, dsynperiod, tjdmax, tadd;
|
||||
int32 MaxCountSynodicPeriod = MAX_COUNT_SYNPER;
|
||||
char *sevent[7] = {"", "morning first", "evening last", "evening first", "morning last", "acronychal rising", "acronychal setting"};
|
||||
if (dgeo[2] < SEI_ECL_GEOALT_MIN || dgeo[2] > SEI_ECL_GEOALT_MAX) {
|
||||
if (serr_ret != NULL)
|
||||
sprintf(serr_ret, "location for heliacal events must be between %.0f and %.0f m above sea\n", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
|
||||
return ERR;
|
||||
}
|
||||
swi_set_tid_acc(JDNDaysUTStart, helflag, 0, serr);
|
||||
if (helflag & SE_HELFLAG_LONG_SEARCH)
|
||||
MaxCountSynodicPeriod = MAX_COUNT_SYNPER_MAX;
|
||||
/* if (helflag & SE_HELFLAG_SEARCH_1_PERIOD)
|
||||
|
@ -3339,6 +3263,12 @@ int32 FAR PASCAL_CONV swe_heliacal_ut(double JDNDaysUTStart, double *dgeo, doubl
|
|||
default_heliacal_parameters(datm, dgeo, dobs, helflag);
|
||||
swe_set_topo(dgeo[0], dgeo[1], dgeo[2]);
|
||||
Planet = DeterObject(ObjectName);
|
||||
if (Planet == SE_SUN) {
|
||||
if (serr_ret != NULL) {
|
||||
strcpy(serr_ret, "the sun has no heliacal rising or setting\n");
|
||||
}
|
||||
return ERR;
|
||||
}
|
||||
/*
|
||||
* Moon events
|
||||
*/
|
||||
|
|
|
@ -121,7 +121,7 @@ int FAR PASCAL_CONV swe_houses(double tjd_ut,
|
|||
{
|
||||
int i, retc = 0;
|
||||
double armc, eps, nutlo[2];
|
||||
double tjde = tjd_ut + swe_deltat(tjd_ut);
|
||||
double tjde = tjd_ut + swe_deltat_ex(tjd_ut, -1, NULL);
|
||||
eps = swi_epsiln(tjde, 0) * RADTODEG;
|
||||
swi_nutation(tjde, 0, nutlo);
|
||||
for (i = 0; i < 2; i++)
|
||||
|
@ -172,7 +172,7 @@ int FAR PASCAL_CONV swe_houses_ex(double tjd_ut,
|
|||
{
|
||||
int i, retc = 0;
|
||||
double armc, eps_mean, nutlo[2];
|
||||
double tjde = tjd_ut + swe_deltat(tjd_ut);
|
||||
double tjde = tjd_ut + swe_deltat_ex(tjd_ut, iflag, NULL);
|
||||
struct sid_data *sip = &swed.sidd;
|
||||
int ito;
|
||||
if (toupper(hsys) == 'G')
|
||||
|
|
|
@ -4,10 +4,8 @@
|
|||
|
|
||||
| Subroutines for reading JPL ephemerides.
|
||||
| derived from testeph.f as contained in DE403 distribution July 1995.
|
||||
| works with DE200, DE102, DE403, DE404, DE405, DE406.
|
||||
| (attention, DE102 has 1950 reference frame and also DE4* has slightly
|
||||
| different reference frame from DE200. With DE4*, use routine
|
||||
| IERS_FK5().)
|
||||
| works with DE200, DE102, DE403, DE404, DE405, DE406, DE431
|
||||
| (attention, these ephemerides do not have exactly the same reference frame)
|
||||
|
||||
Authors: Dieter Koch and Alois Treindl, Astrodienst Zurich
|
||||
|
||||
|
@ -66,6 +64,10 @@
|
|||
for promoting such software, products or services.
|
||||
*/
|
||||
|
||||
#if MSDOS
|
||||
#else
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include "swephexp.h"
|
||||
|
@ -79,14 +81,12 @@
|
|||
#define FSEEK _fseeki64
|
||||
#define FTELL _ftelli64
|
||||
#else
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#define FSEEK fseeko
|
||||
#define FTELL ftello
|
||||
#endif
|
||||
|
||||
#define DEBUG_DO_SHOW FALSE
|
||||
|
||||
#ifndef NO_JPL
|
||||
/*
|
||||
* local globals
|
||||
*/
|
||||
|
@ -723,10 +723,6 @@ static int state(double et, int32 *list, int do_bary,
|
|||
nb *= 8;
|
||||
/* add size of header and constants section */
|
||||
nb += 2 * ksize * nrecl;
|
||||
#if 0
|
||||
printf("hallo %d %d\n", nb, flen);
|
||||
printf("hallo %d %d\n", nb-flen, ksize);
|
||||
#endif
|
||||
if (flen != nb
|
||||
/* some of our files are one record too long */
|
||||
&& flen - nb != ksize * nrecl
|
||||
|
@ -932,5 +928,4 @@ int32 swi_get_jpl_denum()
|
|||
{
|
||||
return js->eh_denum;
|
||||
}
|
||||
#endif /* NO_JPL */
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
#include "swephexp.h"
|
||||
#include "sweph.h"
|
||||
#include "swephlib.h"
|
||||
#include "swemptab.c"
|
||||
#include "swemptab.h"
|
||||
|
||||
#define TIMESCALE 3652500.0
|
||||
|
||||
|
@ -759,7 +759,7 @@ static int read_elements_file(int32 ipl, double tjd,
|
|||
if (serr != NULL) {
|
||||
sprintf(serr, "%s nine elements required", serri);
|
||||
}
|
||||
return ERR;
|
||||
goto return_err;
|
||||
}
|
||||
iplan++;
|
||||
if (iplan != ipl)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1433,7 +1433,7 @@ static int32 cls[] = {
|
|||
-3, 0, 0, 2, 0, 0,
|
||||
};
|
||||
|
||||
#if NUT_IAU_2000A
|
||||
/*#if NUT_IAU_2000A*/
|
||||
/* Planetary argument multipliers
|
||||
* L L' F D Om Me Ve E Ma Ju Sa Ur Ne pre */
|
||||
static int16 npl[] = {
|
||||
|
@ -2817,4 +2817,4 @@ static int16 icpl[] = {
|
|||
3, 0, 0, -1,
|
||||
3, 0, 0, -1,
|
||||
};
|
||||
#endif /* NUT_IAU_2000A */
|
||||
/*#endif * NUT_IAU_2000A */
|
||||
|
|
|
@ -251,7 +251,7 @@ typedef unsigned char UCHAR;
|
|||
# define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
#define forward static
|
||||
/* #define forward static obsolete */
|
||||
|
||||
#define AS_MAXCH 256 /* used for string declarations, allowing 255 char+\0 */
|
||||
|
||||
|
|
576
swe/src/sweph.c
576
swe/src/sweph.c
File diff suppressed because it is too large
Load Diff
|
@ -63,7 +63,7 @@
|
|||
* move over from swephexp.h
|
||||
*/
|
||||
|
||||
#define SE_VERSION "2.00.00"
|
||||
#define SE_VERSION "2.02.01"
|
||||
|
||||
#define J2000 2451545.0 /* 2000 January 1.5 */
|
||||
#define B1950 2433282.42345905 /* 1950 January 0.923 */
|
||||
|
@ -119,23 +119,6 @@
|
|||
#define SE_NAME_VULCAN "Vulcan"
|
||||
#define SE_NAME_WHITE_MOON "White Moon"
|
||||
|
||||
/* for delta t: intrinsic tidal acceleration in the mean motion of the moon,
|
||||
* not given in the parameters list of the ephemeris files but computed
|
||||
* by Chapront/Chapront-Touzé/Francou A&A 387 (2002), p. 705.
|
||||
*/
|
||||
#define SE_TIDAL_DE200 (-23.8946)
|
||||
#define SE_TIDAL_DE403 (-25.580) /* was (-25.8) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE404 (-25.580) /* was (-25.8) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE405 (-25.826) /* was (-25.7376) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE406 (-25.826) /* was (-25.7376) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE421 (-25.85) /* JPL Interoffice Memorandum 14-mar-2008 on DE421 Lunar Orbit */
|
||||
#define SE_TIDAL_DE430 (-25.82) /* JPL Interoffice Memorandum 9-jul-2013 on DE430 Lunar Orbit */
|
||||
#define SE_TIDAL_DE431 (-25.82) /* waiting for information */
|
||||
|
||||
#define SE_TIDAL_26 (-26.0)
|
||||
|
||||
#define SE_TIDAL_DEFAULT SE_TIDAL_DE431
|
||||
|
||||
/*
|
||||
* earlier content
|
||||
*/
|
||||
|
@ -209,13 +192,18 @@
|
|||
|
||||
#define SEI_NEPHFILES 7
|
||||
#define SEI_CURR_FPOS -1
|
||||
#define SEI_NMODELS 20
|
||||
|
||||
#define SEI_ECL_GEOALT_MAX 25000.0
|
||||
#define SEI_ECL_GEOALT_MIN (-500.0)
|
||||
|
||||
/* Chiron's orbit becomes chaotic
|
||||
* before 720 AD and after 4606 AD, because of close encounters
|
||||
* with Saturn. Accepting a maximum error of 5 degrees,
|
||||
* the ephemeris is good between the following dates:
|
||||
*/
|
||||
#define CHIRON_START 1958470.5 /* 1.1.650 */
|
||||
/*#define CHIRON_START 1958470.5 * 1.1.650 old limit until v. 2.00 */
|
||||
#define CHIRON_START 1967601.5 /* 1.1.675 */
|
||||
#define CHIRON_END 3419437.5 /* 1.1.4650 */
|
||||
|
||||
/* Pholus's orbit is unstable as well, because he sometimes
|
||||
|
@ -223,7 +211,9 @@
|
|||
* Accepting a maximum error of 5 degrees,
|
||||
* the ephemeris is good after the following date:
|
||||
*/
|
||||
#define PHOLUS_START 314845.5 /* 1.1.-3850 */
|
||||
/* #define PHOLUS_START 314845.5 * 1.1.-3850 old limit until v. 2.00 */
|
||||
#define PHOLUS_START 640648.5 /* 1.1.-2958 jul */
|
||||
#define PHOLUS_END 4390617.5 /* 1.1.7309 */
|
||||
|
||||
#define MOSHPLEPH_START 625000.5
|
||||
#define MOSHPLEPH_END 2818000.5
|
||||
|
@ -273,6 +263,9 @@
|
|||
#define SUN_EARTH_MRAT 332946.050895 /* Su / (Ea only) AA 2006 K7 */
|
||||
#define EARTH_MOON_MRAT (1 / 0.0123000383) /* AA 2006, K7 */
|
||||
#if 0
|
||||
#define EARTH_MOON_MRAT 81.30056907419062 /* de431 */
|
||||
#endif
|
||||
#if 0
|
||||
#define EARTH_MOON_MRAT 81.30056 /* de406 */
|
||||
#endif
|
||||
#define AUNIT 1.49597870691e+11 /* au in meters, AA 2006 K6 */
|
||||
|
@ -384,9 +377,9 @@ static const struct aya_init ayanamsa[] = {
|
|||
{1903396.7895321,-0.23763238},/*24: Aryabhata, analogous 22 */
|
||||
{1903396.8128654,-0.79167046},/*25: SS, Revati/zePsc at polar long. 359°50'*/
|
||||
{1903396.8128654, 2.11070444},/*26: SS, Citra/Spica at polar long. 180° */
|
||||
{0, 0}, /*27: True Citra (Spica always exactly at 0 Libra) */
|
||||
{0, 0}, /*28: True Revati (zeta Psc always exactly at 0 Aries) */
|
||||
{0, 0}, /*29: - */
|
||||
{0, 0}, /*27: True Citra (Spica exactly at 0 Libra) */
|
||||
{0, 0}, /*28: True Revati (zeta Psc exactly at 0 Aries) */
|
||||
{0, 0}, /*29: True Pushya (delta Cnc exactly a 16 Cancer */
|
||||
{0, 0}, /*30: - */
|
||||
};
|
||||
|
||||
|
@ -469,6 +462,9 @@ extern int swi_moshplan(double tjd, int ipli, AS_BOOL do_save, double *xpret, do
|
|||
extern int swi_moshplan2(double J, int iplm, double *pobj);
|
||||
extern int swi_osc_el_plan(double tjd, double *xp, int ipl, int ipli, double *xearth, double *xsun, char *serr);
|
||||
extern FILE *swi_fopen(int ifno, char *fname, char *ephepath, char *serr);
|
||||
extern int32 swi_init_swed_if_start(void);
|
||||
extern int32 swi_set_tid_acc(double tjd_ut, int32 iflag, int32 denum, char *serr);
|
||||
extern int32 swi_get_tid_acc(double tjd_ut, int32 iflag, int32 denum, int32 *denumret, double *tid_acc, char *serr);
|
||||
|
||||
/* nutation */
|
||||
struct nut {
|
||||
|
@ -551,21 +547,29 @@ struct sid_data {
|
|||
double t0;
|
||||
};
|
||||
|
||||
/* dpsi and deps loaded for 100 years after 1962 */
|
||||
#define SWE_DATA_DPSI_DEPS 36525
|
||||
|
||||
/* if this is changed, then also update initialisation in sweph.c */
|
||||
struct swe_data {
|
||||
AS_BOOL ephe_path_is_set;
|
||||
short jpl_file_is_open;
|
||||
FILE *fixfp; /* fixed stars file pointer */
|
||||
char ephepath[AS_MAXCH];
|
||||
char jplfnam[AS_MAXCH];
|
||||
short jpldenum;
|
||||
int32 jpldenum;
|
||||
int32 last_epheflag;
|
||||
AS_BOOL geopos_is_set;
|
||||
AS_BOOL ayana_is_set;
|
||||
AS_BOOL is_old_starfile;
|
||||
double eop_tjd_beg;
|
||||
double eop_tjd_beg_horizons;
|
||||
double eop_tjd_end;
|
||||
double eop_tjd_end_add;
|
||||
int eop_dpsi_loaded;
|
||||
AS_BOOL geopos_is_set;
|
||||
AS_BOOL ayana_is_set;
|
||||
AS_BOOL is_old_starfile;
|
||||
double tid_acc;
|
||||
AS_BOOL is_tid_acc_manual;
|
||||
AS_BOOL init_dt_done;
|
||||
struct file_data fidat[SEI_NEPHFILES];
|
||||
struct gen_const gcdat;
|
||||
struct plan_data pldat[SEI_NPLANETS];
|
||||
|
@ -588,8 +592,12 @@ struct swe_data {
|
|||
double ast_diam;
|
||||
int i_saved_planet_name;
|
||||
char saved_planet_name[80];
|
||||
double dpsi[36525]; /* works for 100 years after 1962 */
|
||||
double deps[36525];
|
||||
//double dpsi[36525]; /* works for 100 years after 1962 */
|
||||
//double deps[36525];
|
||||
double *dpsi;
|
||||
double *deps;
|
||||
int32 astro_models[SEI_NMODELS];
|
||||
int32 timeout;
|
||||
};
|
||||
|
||||
extern struct swe_data FAR swed;
|
||||
|
|
|
@ -240,9 +240,10 @@ extern "C" {
|
|||
#define SE_SIDM_SS_CITRA 26
|
||||
#define SE_SIDM_TRUE_CITRA 27
|
||||
#define SE_SIDM_TRUE_REVATI 28
|
||||
#define SE_SIDM_TRUE_PUSHYA 29
|
||||
#define SE_SIDM_USER 255
|
||||
|
||||
#define SE_NSIDM_PREDEF 29
|
||||
#define SE_NSIDM_PREDEF 30
|
||||
|
||||
/* used for swe_nod_aps(): */
|
||||
#define SE_NODBIT_MEAN 1 /* mean nodes/apsides */
|
||||
|
@ -347,11 +348,7 @@ extern "C" {
|
|||
|
||||
#ifndef SE_EPHE_PATH
|
||||
#if MSDOS
|
||||
#ifdef PAIR_SWEPH
|
||||
# define SE_EPHE_PATH "\\pair\\ephe\\"
|
||||
#else
|
||||
# define SE_EPHE_PATH "\\sweph\\ephe\\"
|
||||
#endif
|
||||
#else
|
||||
# ifdef MACOS
|
||||
# define SE_EPHE_PATH ":ephe:"
|
||||
|
@ -423,19 +420,119 @@ extern "C" {
|
|||
#define SE_SCOTOPIC_FLAG 1
|
||||
#define SE_MIXEDOPIC_FLAG 2
|
||||
|
||||
/*
|
||||
* by compiling with -DPAIR_SWEPH in the compiler options it
|
||||
* is possible to create a more compact version of SwissEph which
|
||||
* contains no code for the JPL ephemeris file and for the builtin
|
||||
* Moshier ephemeris.
|
||||
* This is quite useful for MSDOS real mode applications which need to
|
||||
* run within 640 kb.
|
||||
* The option is called PAIR_SWEPH because it was introduced for
|
||||
* Astrodienst's partner software PAIR.
|
||||
/* for swe_set_tid_acc() and ephemeris-dependent delta t:
|
||||
* intrinsic tidal acceleration in the mean motion of the moon,
|
||||
* not given in the parameters list of the ephemeris files but computed
|
||||
* by Chapront/Chapront-Touzé/Francou A&A 387 (2002), p. 705.
|
||||
*/
|
||||
#ifdef PAIR_SWEPH
|
||||
# define NO_JPL
|
||||
#endif
|
||||
#define SE_TIDAL_DE200 (-23.8946)
|
||||
#define SE_TIDAL_DE403 (-25.580) /* was (-25.8) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE404 (-25.580) /* was (-25.8) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE405 (-25.826) /* was (-25.7376) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE406 (-25.826) /* was (-25.7376) until V. 1.76.2 */
|
||||
#define SE_TIDAL_DE421 (-25.85) /* JPL Interoffice Memorandum 14-mar-2008 on DE421 Lunar Orbit */
|
||||
#define SE_TIDAL_DE422 (-25.85) /* JPL Interoffice Memorandum 14-mar-2008 on DE421 (sic!) Lunar Orbit */
|
||||
#define SE_TIDAL_DE430 (-25.82) /* JPL Interoffice Memorandum 9-jul-2013 on DE430 Lunar Orbit */
|
||||
#define SE_TIDAL_DE431 (-25.80) /* IPN Progress Report 42-196 • February 15, 2014, p. 15; was (-25.82) in V. 2.00.00 */
|
||||
#define SE_TIDAL_26 (-26.0)
|
||||