Upgrade to Swiss Ephemeris 2.02.01

This commit is contained in:
Gergely Polonkai 2015-09-13 15:35:46 +02:00
parent dbfb734b1f
commit e394ffa15e
21 changed files with 12475 additions and 1015 deletions

Binary file not shown.

Binary file not shown.

View File

@ -7,6 +7,7 @@ EXTRA_DIST = \
LICENSE \
README \
swemptab.c \
swemptab.h \
swedate.h \
swedll.h \
swehouse.h \

View File

@ -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

View File

@ -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

View File

@ -63,6 +63,7 @@
#include "swephexp.h"
#include "sweph.h"
#include "swephlib.h"
#include <time.h>
#define SEFLG_EPHMASK (SEFLG_JPLEPH|SEFLG_SWIEPH|SEFLG_MOSEPH)
static int find_maximum(double y00, double y11, double y2, double dx,
@ -558,6 +559,7 @@ int32 FAR PASCAL_CONV swe_sol_eclipse_where(
int32 retflag, retflag2;
double dcore[10];
ifl &= SEFLG_EPHMASK;
swi_set_tid_acc(tjd_ut, ifl, 0, serr);
if ((retflag = eclipse_where(tjd_ut, SE_SUN, NULL, ifl, geopos, dcore, serr)) < 0)
return retflag;
if ((retflag2 = eclipse_how(tjd_ut, SE_SUN, NULL, ifl, geopos[0], geopos[1], 0, attr, serr)) == ERR)
@ -577,7 +579,9 @@ int32 FAR PASCAL_CONV swe_lun_occult_where(
{
int32 retflag, retflag2;
double dcore[10];
if (ipl < 0) ipl = 0;
ifl &= SEFLG_EPHMASK;
swi_set_tid_acc(tjd_ut, ifl, 0, serr);
/* function calls for Pluto with asteroid number 134340
* are treated as calls for Pluto as main body SE_PLUTO */
if (ipl == SE_AST_OFFSET + 134340)
@ -628,7 +632,7 @@ static int32 eclipse_where( double tjd_ut, int32 ipl, char *starname, int32 ifl,
iflag = SEFLG_SPEED | SEFLG_EQUATORIAL | ifl;
iflag2 = iflag | SEFLG_RADIANS;
iflag = iflag | SEFLG_XYZ;
deltat = swe_deltat(tjd_ut);
deltat = swe_deltat_ex(tjd_ut, ifl, serr);
tjd = tjd_ut + deltat;
/* moon in cartesian coordinates */
if ((retc = swe_calc(tjd, SE_MOON, iflag, rm, serr)) == ERR)
@ -902,7 +906,13 @@ int32 FAR PASCAL_CONV swe_sol_eclipse_how(
int32 retflag, retflag2;
double dcore[10], ls[6], xaz[6];
double geopos2[20];
if (geopos[2] < SEI_ECL_GEOALT_MIN || geopos[2] > SEI_ECL_GEOALT_MAX) {
if (serr != NULL)
sprintf(serr, "location for eclipses must be between %.0f and %.0f m above sea", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
return ERR;
}
ifl &= SEFLG_EPHMASK;
swi_set_tid_acc(tjd_ut, ifl, 0, serr);
if ((retflag = eclipse_how(tjd_ut, SE_SUN, NULL, ifl, geopos[0], geopos[1], geopos[2], attr, serr)) == ERR)
return retflag;
if ((retflag2 = eclipse_where(tjd_ut, SE_SUN, NULL, ifl, geopos2, dcore, serr)) == ERR)
@ -947,7 +957,7 @@ static int32 eclipse_how( double tjd_ut, int32 ipl, char *starname, int32 ifl,
geopos[0] = geolon;
geopos[1] = geolat;
geopos[2] = geohgt;
te = tjd_ut + swe_deltat(tjd_ut);
te = tjd_ut + swe_deltat_ex(tjd_ut, ifl, serr);
swe_set_topo(geolon, geolat, geohgt);
if (calc_planet_star(te, ipl, starname, iflag, ls, serr) == ERR)
return ERR;
@ -1160,6 +1170,7 @@ int32 FAR PASCAL_CONV swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int
AS_BOOL dont_times = FALSE;
int32 iflag, iflagcart;
ifl &= SEFLG_EPHMASK;
swi_set_tid_acc(tjd_start, ifl, 0, serr);
iflag = SEFLG_EQUATORIAL | ifl;
iflagcart = iflag | SEFLG_XYZ;
if (ifltype == (SE_ECL_PARTIAL | SE_ECL_CENTRAL)) {
@ -1167,9 +1178,18 @@ int32 FAR PASCAL_CONV swe_sol_eclipse_when_glob(double tjd_start, int32 ifl, int
strcpy(serr, "central partial eclipses do not exist");
return ERR;
}
if (ifltype == (SE_ECL_ANNULAR_TOTAL | SE_ECL_NONCENTRAL)) {
if (serr != NULL)
strcpy(serr, "non-central hybrid (annular-total) eclipses do not exist");
return ERR;
}
if (ifltype == 0)
ifltype = SE_ECL_TOTAL | SE_ECL_ANNULAR | SE_ECL_PARTIAL
| SE_ECL_ANNULAR_TOTAL | SE_ECL_NONCENTRAL | SE_ECL_CENTRAL;
if (ifltype == SE_ECL_TOTAL || ifltype == SE_ECL_ANNULAR || ifltype == SE_ECL_ANNULAR_TOTAL)
ifltype |= (SE_ECL_NONCENTRAL | SE_ECL_CENTRAL);
if (ifltype == SE_ECL_PARTIAL)
ifltype |= SE_ECL_NONCENTRAL;
if (backward)
direction = -1;
K = (int) ((tjd_start - J2000) / 365.2425 * 12.3685);
@ -1217,7 +1237,7 @@ next_try:
* the functions eclipse_where() and _how().
*/
dtstart = 1;
if (tjd < 2000000)
if (tjd < 2000000 || tjd > 2500000)
dtstart = 5;
dtdiv = 4;
for (dt = dtstart;
@ -1244,7 +1264,9 @@ next_try:
find_maximum(dc[0], dc[1], dc[2], dt, &dtint, &dctr);
tjd += dtint + dt;
}
tjds = tjd = tjd - swe_deltat(tjd);
tjds = tjd - swe_deltat_ex(tjd, ifl, serr);
tjds = tjd - swe_deltat_ex(tjds, ifl, serr);
tjds = tjd = tjd - swe_deltat_ex(tjds, ifl, serr);
if ((retflag = eclipse_where(tjd, SE_SUN, NULL, ifl, geopos, dcore, serr)) == ERR)
return retflag;
retflag2 = retflag;
@ -1400,7 +1422,7 @@ next_try:
k = 2;
for (i = 0; i < 2; i++) {
j = i + k;
tt = tret[j] + swe_deltat(tret[j]);
tt = tret[j] + swe_deltat_ex(tret[j], ifl, serr);
if (swe_calc(tt, SE_SUN, iflag, ls, serr) == ERR)
return ERR;
if (swe_calc(tt, SE_MOON, iflag, lm, serr) == ERR)
@ -1421,7 +1443,7 @@ next_try:
dt > 0.01;
j++, dt /= 3) {
for (i = 0, t = tjd; i <= 1; i++, t -= dt) {
tt = t + swe_deltat(t);
tt = t + swe_deltat_ex(t, ifl, serr);
if (swe_calc(tt, SE_SUN, iflag, ls, serr) == ERR)
return ERR;
if (swe_calc(tt, SE_MOON, iflag, lm, serr) == ERR)
@ -1521,21 +1543,21 @@ int32 FAR PASCAL_CONV swe_lun_occult_when_glob(
int32 retflag = 0, retflag2 = 0;
double de = 6378.140, a;
double t, tt, tjd = 0, tjds, dt, dtint, dta, dtb;
double drad;
double drad, dl;
double xs[6], xm[6], ls[6], lm[6];
double rmoon, rsun, dcore[10];
double dc[20], dctr;
double twohr = 2.0 / 24.0;
double tenmin = 10.0 / 24.0 / 60.0;
double dt1 = 0, dt2 = 0, dadd2 = 6;
int nstartpos = 10;
double dt1 = 0, dt2 = 0, dadd2 = 1;
double geopos[20];
double dtstart, dtdiv;
int direction = 1;
char s[AS_MAXCH];
int32 ifltype2;
int32 iflag, iflagcart;
AS_BOOL dont_times = FALSE;
int32 one_try = backward & SE_ECL_ONE_TRY;
if (ipl < 0) ipl = 0;
/*if (backward & SEI_OCC_FAST)
dont_times = TRUE; */
/* function calls for Pluto with asteroid number 134340
@ -1543,6 +1565,7 @@ int32 FAR PASCAL_CONV swe_lun_occult_when_glob(
if (ipl == SE_AST_OFFSET + 134340)
ipl = SE_PLUTO;
ifl &= SEFLG_EPHMASK;
swi_set_tid_acc(tjd_start, ifl, 0, serr);
iflag = SEFLG_EQUATORIAL | ifl;
iflagcart = iflag | SEFLG_XYZ;
backward &= 1L;
@ -1554,44 +1577,69 @@ int32 FAR PASCAL_CONV swe_lun_occult_when_glob(
strcpy(serr, "central partial eclipses do not exist");
return ERR;
}
if (ifltype == 0)
ifltype = SE_ECL_TOTAL | SE_ECL_ANNULAR | SE_ECL_PARTIAL
| SE_ECL_ANNULAR_TOTAL | SE_ECL_NONCENTRAL | SE_ECL_CENTRAL;
if (ipl != SE_SUN) {
ifltype2 = (ifltype & ~(SE_ECL_NONCENTRAL | SE_ECL_CENTRAL));
if (ifltype2 == SE_ECL_ANNULAR || ifltype == SE_ECL_ANNULAR_TOTAL) {
if (serr != NULL)
sprintf(serr, "annular occulation do not exist for object %d %s\n", ipl, starname);
return ERR;
}
}
if (ipl != SE_SUN && (ifltype & (SE_ECL_ANNULAR | SE_ECL_ANNULAR_TOTAL)))
ifltype &= ~(SE_ECL_ANNULAR|SE_ECL_ANNULAR_TOTAL);
if (ifltype == 0) {
ifltype = SE_ECL_TOTAL | SE_ECL_PARTIAL | SE_ECL_NONCENTRAL | SE_ECL_CENTRAL;
if (ipl == SE_SUN)
ifltype |= (SE_ECL_ANNULAR | SE_ECL_ANNULAR_TOTAL);
}
if (ifltype & (SE_ECL_TOTAL | SE_ECL_ANNULAR | SE_ECL_ANNULAR_TOTAL))
ifltype |= (SE_ECL_NONCENTRAL | SE_ECL_CENTRAL);
if (ifltype & SE_ECL_PARTIAL)
ifltype |= SE_ECL_NONCENTRAL;
retflag = 0;
for (i = 0; i <= 9; i++)
tret[i] = 0;
if (backward)
direction = -1;
t = tjd_start - direction * 0.001;
tjd_start = t;
t = tjd_start;
tjd = t;
next_try:
for (i = 0; i < nstartpos; i++, t += direction * dadd2) {
if (calc_planet_star(t, ipl, starname, iflagcart, xs, serr) == ERR)
if (calc_planet_star(t, ipl, starname, ifl, ls, serr) == ERR)
return ERR;
if (swe_calc(t, SE_MOON, iflagcart, xm, serr) == ERR)
return ERR;
dc[i] = acos(swi_dot_prod_unit(xs, xm)) * RADTODEG;
if (i > 1 && dc[i] > dc[i-1] && dc[i-2] > dc[i-1]) {
tjd = t - direction * dadd2;
t = tjd;
break;
} else if (fabs(tjd - t) > (30 - dadd2 * 0.8)) {
t = tjd;
} else if (i == nstartpos-1) {
/*for (j = 0; j < nstartpos; j++)
printf("%f ", dc[j]);*/
if (serr != NULL) {
if (starname != NULL && *starname != '\0') {
*s = '\0';
strncat(s, starname, 80);
} else {
swe_get_planet_name(ipl , s);
}
sprintf(serr, "error in swe_lun_occult_when_glob(): conjunction of moon with planet %s not found\n", s);
}
/* fixed stars with an ecliptic latitude > 7 or < -7 cannot have
* an occultation. Even lunar parallax andd proper motion of star
* will never allow it. */
if (fabs(ls[1]) > 7 && starname != NULL && *starname != '\0') {
if (serr != NULL)
sprintf(serr, "occultation never occurs: star %s has ecl. lat. %.1f", starname, ls[1]);
return ERR;
}
if (swe_calc(t, SE_MOON, ifl, lm, serr) == ERR)
return ERR;
dl = swe_degnorm(ls[0] - lm[0]);
if (direction < 0)
dl -= 360;
/* get rough conjunction in ecliptic longitude */
while (fabs(dl) > 0.1) {
t += dl / 13;
if (calc_planet_star(t, ipl, starname, ifl, ls, serr) == ERR)
return ERR;
if (swe_calc(t, SE_MOON, ifl, lm, serr) == ERR)
return ERR;
dl = swe_degnorm(ls[0] - lm[0]);
if (dl > 180) dl -= 360;
}
tjd = t;
/* difference in latitude too big for an occultation */
drad = fabs(ls[1] - lm[1]);
if (drad > 2) {
if (one_try) {
tret[0] = t + direction; /* return a date suitable for next try */
return 0;
}
t += direction * 20;
tjd = t;
goto next_try;
}
/*
* radius of planet disk in AU
@ -1633,7 +1681,7 @@ next_try:
find_maximum(dc[0], dc[1], dc[2], dt, &dtint, &dctr);
tjd += dtint + dt;
}
tjd -= swe_deltat(tjd);
tjd -= swe_deltat_ex(tjd, ifl, serr);
tjds = tjd;
if ((retflag = eclipse_where(tjd, ipl, starname, ifl, geopos, dcore, serr)) == ERR)
return retflag;
@ -1645,6 +1693,7 @@ next_try:
return retflag2; */
if (retflag2 == 0) {
/* only one try! */
/* if (one_try && ((direction == 1 && tjd > tjd_start) || (direction == -1 && tjd < tjd_start))) {*/
if (one_try) {
tret[0] = tjd;
return 0;
@ -1655,6 +1704,7 @@ next_try:
goto next_try;
}
tret[0] = tjd;
/* should not happen anymore Version 2.01 */
if ((backward && tret[0] >= tjd_start - 0.0001)
|| (!backward && tret[0] <= tjd_start + 0.0001)) {
/*t= tjd + direction * dadd;*/
@ -1680,6 +1730,10 @@ next_try:
if (!(ifltype & SE_ECL_NONCENTRAL) && (retflag & SE_ECL_NONCENTRAL)) {
/*t= tjd + direction * dadd;*/
t = tjd + direction * 20;
if (one_try) {
tret[0] = tjd;
return 0;
}
tjd = t;
goto next_try;
}
@ -1687,6 +1741,10 @@ next_try:
if (!(ifltype & SE_ECL_CENTRAL) && (retflag & SE_ECL_CENTRAL)) {
/*t= tjd + direction * dadd;*/
t = tjd + direction * 20;
if (one_try) {
tret[0] = tjd;
return 0;
}
tjd = t;
goto next_try;
}
@ -1694,6 +1752,10 @@ next_try:
if (!(ifltype & SE_ECL_ANNULAR) && (retflag & SE_ECL_ANNULAR)) {
/*t= tjd + direction * dadd;*/
t = tjd + direction * 20;
if (one_try) {
tret[0] = tjd;
return 0;
}
tjd = t;
goto next_try;
}
@ -1701,6 +1763,10 @@ next_try:
if (!(ifltype & SE_ECL_PARTIAL) && (retflag & SE_ECL_PARTIAL)) {
/*t= tjd + direction * dadd;*/
t = tjd + direction * 20;
if (one_try) {
tret[0] = tjd;
return 0;
}
tjd = t;
goto next_try;
}
@ -1708,6 +1774,10 @@ next_try:
if (!(ifltype & (SE_ECL_TOTAL | SE_ECL_ANNULAR_TOTAL)) && (retflag & SE_ECL_TOTAL)) {
/*t= tjd + direction * dadd;*/
t = tjd + direction * 20;
if (one_try) {
tret[0] = tjd;
return 0;
}
tjd = t;
goto next_try;
}
@ -1795,6 +1865,10 @@ next_try:
if (!(ifltype & SE_ECL_TOTAL) && (retflag & SE_ECL_TOTAL)) {
/*t= tjd + direction * dadd;*/
t = tjd + direction * 20;
if (one_try) {
tret[0] = tjd;
return 0;
}
tjd = t;
goto next_try;
}
@ -1802,6 +1876,10 @@ next_try:
if (!(ifltype & SE_ECL_ANNULAR_TOTAL) && (retflag & SE_ECL_ANNULAR_TOTAL)) {
/*t= tjd + direction * dadd;*/
t = tjd + direction * 20;
if (one_try) {
tret[0] = tjd;
return 0;
}
tjd = t;
goto next_try;
}
@ -1813,7 +1891,7 @@ next_try:
k = 2;
for (i = 0; i < 2; i++) {
j = i + k;
tt = tret[j] + swe_deltat(tret[j]);
tt = tret[j] + swe_deltat_ex(tret[j], ifl, serr);
if (calc_planet_star(tt, ipl, starname, iflag, ls, serr) == ERR)
return ERR;
if (swe_calc(tt, SE_MOON, iflag, lm, serr) == ERR)
@ -1834,7 +1912,7 @@ next_try:
dt > 0.01;
j++, dt /= 3) {
for (i = 0, t = tjd; i <= 1; i++, t -= dt) {
tt = t + swe_deltat(t);
tt = t + swe_deltat_ex(t, ifl, serr);
if (calc_planet_star(tt, ipl, starname, iflag, ls, serr) == ERR)
return ERR;
if (swe_calc(tt, SE_MOON, iflag, lm, serr) == ERR)
@ -1909,7 +1987,13 @@ int32 FAR PASCAL_CONV swe_sol_eclipse_when_loc(double tjd_start, int32 ifl,
{
int32 retflag = 0, retflag2 = 0;
double geopos2[20], dcore[10];
if (geopos[2] < SEI_ECL_GEOALT_MIN || geopos[2] > SEI_ECL_GEOALT_MAX) {
if (serr != NULL)
sprintf(serr, "location for eclipses must be between %.0f and %.0f m above sea", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
return ERR;
}
ifl &= SEFLG_EPHMASK;
swi_set_tid_acc(tjd_start, ifl, 0, serr);
if ((retflag = eclipse_when_loc(tjd_start, ifl, geopos, tret, attr, backward, serr)) <= 0)
return retflag;
/*
@ -1957,9 +2041,16 @@ int32 FAR PASCAL_CONV swe_lun_occult_when_loc(double tjd_start, int32 ipl, char
double geopos2[20], dcore[10];
/* function calls for Pluto with asteroid number 134340
* are treated as calls for Pluto as main body SE_PLUTO */
if (geopos[2] < SEI_ECL_GEOALT_MIN || geopos[2] > SEI_ECL_GEOALT_MAX) {
if (serr != NULL)
sprintf(serr, "location for occultations must be between %.0f and %.0f m above sea", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
return ERR;
}
if (ipl < 0) ipl = 0;
if (ipl == SE_AST_OFFSET + 134340)
ipl = SE_PLUTO;
ifl &= SEFLG_EPHMASK;
swi_set_tid_acc(tjd_start, ifl, 0, serr);
if ((retflag = occult_when_loc(tjd_start, ipl, starname, ifl, geopos, tret, attr, backward, serr)) <= 0)
return retflag;
/*
@ -2039,7 +2130,7 @@ next_try:
swe_set_topo(geopos[0], geopos[1], geopos[2]);
dtdiv = 2;
dtstart = 0.5;
if (tjd < 1900000) /* because above formula is not good (delta t?) */
if (tjd < 1900000 || tjd > 2500000) /* because above formula is not good (delta t?) */
dtstart = 2;
for (dt = dtstart;
dt > 0.00001;
@ -2088,7 +2179,8 @@ next_try:
K++;
goto next_try;
}
tret[0] = tjd - swe_deltat(tjd);
tret[0] = tjd - swe_deltat_ex(tjd, ifl, serr);
tret[0] = tjd - swe_deltat_ex(tret[0], ifl, serr); /* these two lines are an iteration! */
if ((backward && tret[0] >= tjd_start - 0.0001)
|| (!backward && tret[0] <= tjd_start + 0.0001)) {
if (backward)
@ -2160,8 +2252,8 @@ next_try:
tret[j] += dt1;
}
}
tret[2] -= swe_deltat(tret[2]);
tret[3] -= swe_deltat(tret[3]);
tret[2] -= swe_deltat_ex(tret[2], ifl, serr);
tret[3] -= swe_deltat_ex(tret[3], ifl, serr);
}
/* contacts 1 and 4 */
dc[1] = rsplusrm - dctrmin;
@ -2214,8 +2306,8 @@ next_try:
tret[j] += dt1;
}
}
tret[1] -= swe_deltat(tret[1]);
tret[4] -= swe_deltat(tret[4]);
tret[1] -= swe_deltat_ex(tret[1], ifl, serr);
tret[4] -= swe_deltat_ex(tret[4], ifl, serr);
/*
* visibility of eclipse phases
*/
@ -2226,7 +2318,7 @@ next_try:
attr, serr) == ERR)
return ERR;
/*if (retflag2 & SE_ECL_VISIBLE) { could be wrong for 1st/4th contact */
if (attr[6] > 0) { /* this is save, sun above horizon, using app. alt. */
if (attr[6] > 0) { /* this is safe, sun above horizon, using app. alt. */
retflag |= SE_ECL_VISIBLE;
switch(i) {
case 0: retflag |= SE_ECL_MAX_VISIBLE; break;
@ -2247,10 +2339,21 @@ next_try:
goto next_try;
}
#endif
if (swe_rise_trans(tret[1] - 0.1, SE_SUN, NULL, iflag, SE_CALC_RISE|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjdr, serr) == ERR)
if ((retc = swe_rise_trans(tret[1] - 0.001, SE_SUN, NULL, iflag, SE_CALC_RISE|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjdr, serr)) == ERR)
return ERR;
if (swe_rise_trans(tret[1] - 0.1, SE_SUN, NULL, iflag, SE_CALC_SET|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjds, serr) == ERR)
if (retc == -2) /* circumpolar sun */
return retflag;
if ((retc = swe_rise_trans(tret[1] - 0.001, SE_SUN, NULL, iflag, SE_CALC_SET|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjds, serr)) == ERR)
return ERR;
if (retc == -2) /* circumpolar sun */
return retflag;
if (tjds < tret[1] || (tjds > tjdr && tjdr > tret[4])) {
if (backward)
K--;
else
K++;
goto next_try;
}
if (tjdr > tret[1] && tjdr < tret[4]) {
tret[5] = tjdr;
if (!(retflag & SE_ECL_MAX_VISIBLE)) {
@ -2280,7 +2383,7 @@ static int32 occult_when_loc(
int32 backward, char *serr)
{
int i, j, k, m;
int32 retflag = 0;
int32 retflag = 0, retc;
double t, tjd, dt, dtint;
double tjdr, tjds;
double xs[6], xm[6], ls[6], lm[6], x1[6], x2[6], dm, ds;
@ -2291,13 +2394,12 @@ static int32 occult_when_loc(
double twohr = 2.0 / 24.0;
double tenmin = 10.0 / 24.0 / 60.0;
double dt1 = 0, dt2 = 0, dtdiv, dtstart;
double dadd2 = 6;
int nstartpos = 10;
double drad;
double dadd2 = 1;
double drad, dl;
AS_BOOL is_partial = FALSE;
int32 iflag = SEFLG_TOPOCTR | ifl;
int32 iflaggeo = iflag & ~SEFLG_TOPOCTR;
int32 iflagcart = iflag | SEFLG_XYZ;
int32 iflagcartgeo = iflaggeo | SEFLG_XYZ;
int direction = 1;
int32 one_try = backward & SE_ECL_ONE_TRY;
AS_BOOL stop_after_this = FALSE;
@ -2308,29 +2410,46 @@ static int32 occult_when_loc(
tret[i] = 0;
if (backward)
direction = -1;
t = tjd_start - direction * 0.1;
tjd_start = t;
t = tjd_start;
tjd = tjd_start;
next_try:
for (i = 0; i < nstartpos; i++, t += direction * dadd2) {
if (calc_planet_star(t, ipl, starname, iflagcartgeo, xs, serr) == ERR)
is_partial = FALSE;
if (calc_planet_star(t, ipl, starname, iflaggeo, ls, serr) == ERR)
return ERR;
if (swe_calc(t, SE_MOON, iflagcartgeo, xm, serr) == ERR)
return ERR;
dc[i] = acos(swi_dot_prod_unit(xs, xm)) * RADTODEG;
if (i > 1 && dc[i] > dc[i-1] && dc[i-2] > dc[i-1]) {
tjd = t - direction*dadd2;
t = tjd;
break;
} else if (fabs(tjd - t) > (30 - dadd2 * 0.8)) {
t = tjd;
break; /* use initial tjd */
} else if (i == nstartpos-1) {
for (j = 0; j < nstartpos; j++)
printf("%f ", dc[j]);
printf("swe_lun_occult_when_loc(): problem planet\n");
/* fixed stars with an ecliptic latitude > 7 or < -7 cannot have
* an occultation. Even lunar parallax andd proper motion of star
* will never allow it. */
if (fabs(ls[1]) > 7 && starname != NULL && *starname != '\0') {
if (serr != NULL)
sprintf(serr, "occultation never occurs: star %s has ecl. lat. %.1f", starname, ls[1]);
return ERR;
}
if (swe_calc(t, SE_MOON, iflaggeo, lm, serr) == ERR)
return ERR;
dl = swe_degnorm(ls[0] - lm[0]);
if (direction < 0)
dl -= 360;
/* get rough conjunction in ecliptic longitude */
while (fabs(dl) > 0.1) {
t += dl / 13;
if (calc_planet_star(t, ipl, starname, iflaggeo, ls, serr) == ERR)
return ERR;
if (swe_calc(t, SE_MOON, iflaggeo, lm, serr) == ERR)
return ERR;
dl = swe_degnorm(ls[0] - lm[0]);
if (dl > 180) dl -= 360;
}
tjd = t;
/* difference in latitude too big for an occultation */
drad = fabs(ls[1] - lm[1]);
if (drad > 2) {
if (one_try) {
tret[0] = t + direction; /* return a date suitable for next try */
return 0;
}
t += direction * 20;
tjd = t;
goto next_try;
}
/*
* radius of planet disk in AU
@ -2350,7 +2469,7 @@ next_try:
dt > 0.00001;
dt /= dtdiv) {
if (dt < 0.01)
dtdiv = 3;
dtdiv = 2;
for (i = 0, t = tjd - dt; i <= 2; i++, t += dt) {
/* this takes some time, but is necessary to avoid
* missing an eclipse */
@ -2362,8 +2481,8 @@ next_try:
return ERR;
if (swe_calc(t, SE_MOON, iflag, lm, serr) == ERR)
return ERR;
if (dt < 1 && fabs(ls[1] - lm[1]) > 2) {
if (one_try) {
if (dt < 0.1 && fabs(ls[1] - lm[1]) > 2) {
if (one_try || stop_after_this) {
stop_after_this = TRUE;
} else {
/*t = tjd + direction * 2;*/
@ -2407,10 +2526,15 @@ next_try:
tjd = t;
goto next_try;
}
tret[0] = tjd - swe_deltat(tjd);
tret[0] = tjd - swe_deltat_ex(tjd, ifl, serr);
tret[0] = tjd - swe_deltat_ex(tret[0], ifl, serr);
if ((backward && tret[0] >= tjd_start - 0.0001)
|| (!backward && tret[0] <= tjd_start + 0.0001)) {
/* t = tjd + direction;*/
if (one_try) {
tret[0] = tjd;
return 0;
}
t = tjd + direction * 20;
tjd = t;
goto next_try;
@ -2423,9 +2547,10 @@ next_try:
retflag = SE_ECL_PARTIAL;
dctrmin = dctr;
/* contacts 2 and 3 */
if (dctr > fabs(rsminusrm)) /* partial, no 2nd and 3rd contact */
if (dctr > fabs(rsminusrm)) { /* partial, no 2nd and 3rd contact */
tret[2] = tret[3] = 0;
else {
is_partial = TRUE;
} else {
dc[1] = fabs(rsminusrm) - dctrmin;
for (i = 0, t = tjd - twomin; i <= 2; i += 2, t = tjd + twomin) {
if (calc_planet_star(t, ipl, starname, iflagcart, xs, serr) == ERR)
@ -2478,8 +2603,9 @@ next_try:
tret[j] += dt1;
}
}
tret[2] -= swe_deltat(tret[2]);
tret[3] -= swe_deltat(tret[3]);
tret[2] -= swe_deltat_ex(tret[2], ifl, serr);
tret[3] -= swe_deltat_ex(tret[3], ifl, serr);
is_partial = FALSE;
}
/* contacts 1 and 4 */
dc[1] = rsplusrm - dctrmin;
@ -2532,8 +2658,8 @@ next_try:
tret[j] += dt1;
}
}
tret[1] -= swe_deltat(tret[1]);
tret[4] -= swe_deltat(tret[4]);
tret[1] -= swe_deltat_ex(tret[1], ifl, serr);
tret[4] -= swe_deltat_ex(tret[4], ifl, serr);
/*
* visibility of eclipse phases
*/
@ -2559,35 +2685,48 @@ next_try:
#if 1
if (!(retflag & SE_ECL_VISIBLE)) {
/* t = tjd + direction;*/
if (one_try) {
tret[0] = tjd;
return 0;
}
t = tjd + direction * 20;
tjd = t;
goto next_try;
}
#endif
if (swe_rise_trans(tret[1] - 0.1, ipl, starname, iflag, SE_CALC_RISE|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjdr, serr) == ERR)
if ((retc = swe_rise_trans(tret[1] - 0.1, ipl, starname, iflag, SE_CALC_RISE|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjdr, serr)) == ERR)
return ERR;
if (swe_rise_trans(tret[1] - 0.1, ipl, starname, iflag, SE_CALC_SET|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjds, serr) == ERR)
if (retc >= 0 && (retc = swe_rise_trans(tret[1] - 0.1, ipl, starname, iflag, SE_CALC_SET|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjds, serr)) == ERR)
return ERR;
if (retc >= 0) {
if (tjdr > tret[1] && tjdr < tret[4])
tret[5] = tjdr;
if (tjds > tret[1] && tjds < tret[4])
tret[6] = tjds;
if (swe_rise_trans(tret[2], SE_SUN, NULL, iflag, SE_CALC_RISE, geopos, 0, 0, &tjdr, serr) == ERR)
}
/* note, circumpolar sun above horizon is not tested */
if (!is_partial) {
if ((retc = swe_rise_trans(tret[2], SE_SUN, NULL, iflag, SE_CALC_RISE, geopos, 0, 0, &tjdr, serr)) == ERR)
return ERR;
if (swe_rise_trans(tret[2], SE_SUN, NULL, iflag, SE_CALC_SET, geopos, 0, 0, &tjds, serr) == ERR)
if (retc >= 0 && (retc = swe_rise_trans(tret[2], SE_SUN, NULL, iflag, SE_CALC_SET, geopos, 0, 0, &tjds, serr)) == ERR)
return ERR;
if (retc >= 0) {
if (tjds < tjdr)
retflag |= SE_ECL_OCC_BEG_DAYLIGHT;
if (swe_rise_trans(tret[3], SE_SUN, NULL, iflag, SE_CALC_RISE, geopos, 0, 0, &tjdr, serr) == ERR)
}
if ((retc = swe_rise_trans(tret[3], SE_SUN, NULL, iflag, SE_CALC_RISE, geopos, 0, 0, &tjdr, serr)) == ERR)
return ERR;
if (swe_rise_trans(tret[3], SE_SUN, NULL, iflag, SE_CALC_SET, geopos, 0, 0, &tjds, serr) == ERR)
if (retc >= 0 && (retc = swe_rise_trans(tret[3], SE_SUN, NULL, iflag, SE_CALC_SET, geopos, 0, 0, &tjds, serr)) == ERR)
return ERR;
if (retc >= 0) {
if (tjds < tjdr)
retflag |= SE_ECL_OCC_END_DAYLIGHT;
}
}
return retflag;
}
/*
/*
* swe_azalt()
* Computes azimut and height, from either ecliptic or
* equatorial coordinates
@ -2621,13 +2760,12 @@ void FAR PASCAL_CONV swe_azalt(
int i;
double x[6], xra[3];
double armc = swe_degnorm(swe_sidtime(tjd_ut) * 15 + geopos[0]);
double mdd, eps_true, tjd_et;
double mdd, eps_true;
for (i = 0; i < 2; i++)
xra[i] = xin[i];
xra[2] = 1;
if (calc_flag == SE_ECL2HOR) {
tjd_et = tjd_ut + swe_deltat(tjd_ut);
swe_calc(tjd_et, SE_ECL_NUT, 0, x, NULL);
swe_calc(tjd_ut + swe_deltat_ex(tjd_ut, -1, NULL), SE_ECL_NUT, 0, x, NULL);
eps_true = x[0];
swe_cotrans(xra, xra, -eps_true);
}
@ -2673,7 +2811,7 @@ void FAR PASCAL_CONV swe_azalt_rev(
double geolon = geopos[0];
double geolat = geopos[1];
double armc = swe_degnorm(swe_sidtime(tjd_ut) * 15 + geolon);
double eps_true, tjd_et, dang;
double eps_true, dang;
for (i = 0; i < 2; i++)
xaz[i] = xin[i];
xaz[2] = 1;
@ -2689,8 +2827,7 @@ void FAR PASCAL_CONV swe_azalt_rev(
xout[1] = xaz[1];
/* ecliptic positions */
if (calc_flag == SE_HOR2ECL) {
tjd_et = tjd_ut + swe_deltat(tjd_ut);
swe_calc(tjd_et, SE_ECL_NUT, 0, x, NULL);
swe_calc(tjd_ut + swe_deltat_ex(tjd_ut, -1, NULL), SE_ECL_NUT, 0, x, NULL);
eps_true = x[0];
swe_cotrans(xaz, x, eps_true);
xout[0] = x[0];
@ -3019,11 +3156,18 @@ int32 FAR PASCAL_CONV swe_lun_eclipse_how(
/* attention: geopos[] is not used so far; may be NULL */
if (geopos != NULL)
geopos[0] = geopos[0]; /* to shut up mint */
if (geopos != NULL && (geopos[2] < SEI_ECL_GEOALT_MIN || geopos[2] > SEI_ECL_GEOALT_MAX)) {
if (serr != NULL)
sprintf(serr, "location for eclipses must be between %.0f and %.0f m above sea", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
return ERR;
}
ifl = ifl & ~SEFLG_TOPOCTR;
ifl &= ~(SEFLG_JPLHOR | SEFLG_JPLHOR_APPROX);
swi_set_tid_acc(tjd_ut, ifl, 0, serr);
retc = lun_eclipse_how(tjd_ut, ifl, attr, dcore, serr);
if (geopos == NULL)
if (geopos == NULL) {
return retc;
}
/*
* azimuth and altitude of moon
*/
@ -3072,7 +3216,7 @@ static int32 lun_eclipse_how(
* if mean sidereal time will be used */
iflag = SEFLG_SPEED | SEFLG_EQUATORIAL | ifl;
iflag = iflag | SEFLG_XYZ;
deltat = swe_deltat(tjd_ut);
deltat = swe_deltat_ex(tjd_ut, ifl, serr);
tjd = tjd_ut + deltat;
/* moon in cartesian coordinates */
if (swe_calc(tjd, SE_MOON, iflag, rm, serr) == ERR)
@ -3191,7 +3335,7 @@ int32 FAR PASCAL_CONV swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 if
{
int i, j, m, n, o, i1 = 0, i2 = 0;
int32 retflag = 0, retflag2 = 0;
double t, tjd, dt, dtint, dta, dtb;
double t, tjd, tjd2, dt, dtint, dta, dtb;
double T, T2, T3, T4, K, F, M, Mm;
double E, Ff, F1, A1, Om;
double xs[6], xm[6], dm, ds;
@ -3208,8 +3352,19 @@ int32 FAR PASCAL_CONV swe_lun_eclipse_when(double tjd_start, int32 ifl, int32 if
int32 iflag;
int32 iflagcart;
ifl &= SEFLG_EPHMASK;
swi_set_tid_acc(tjd_start, ifl, 0, serr);
iflag = SEFLG_EQUATORIAL | ifl;
iflagcart = iflag | SEFLG_XYZ;
ifltype &= ~(SE_ECL_CENTRAL|SE_ECL_NONCENTRAL);
if (ifltype & (SE_ECL_ANNULAR|SE_ECL_ANNULAR_TOTAL)) {
ifltype &= ~(SE_ECL_ANNULAR|SE_ECL_ANNULAR_TOTAL);
if (ifltype == 0) {
if (serr != NULL) {
strcpy(serr, "annular lunar eclipses don't exist");
}
return ERR; /* avoids infinite loop */
}
}
if (ifltype == 0)
ifltype = SE_ECL_TOTAL | SE_ECL_PENUMBRAL | SE_ECL_PARTIAL;
if (backward)
@ -3282,7 +3437,7 @@ next_try:
* the function lun_eclipse_how().
*/
dtstart = 0.1;
if (tjd < 2000000)
if (tjd < 2000000 || tjd > 2500000)
dtstart = 5;
dtdiv = 4;
for (j = 0, dt = dtstart;
@ -3311,7 +3466,9 @@ next_try:
find_maximum(dc[0], dc[1], dc[2], dt, &dtint, &dctr);
tjd += dtint + dt;
}
tjd = tjd - swe_deltat(tjd);
tjd2 = tjd - swe_deltat_ex(tjd, ifl, serr);
tjd2 = tjd - swe_deltat_ex(tjd2, ifl, serr);
tjd = tjd - swe_deltat_ex(tjd2, ifl, serr);
if ((retflag = swe_lun_eclipse_how(tjd, ifl, NULL, attr, serr)) == ERR)
return retflag;
if (retflag == 0) {
@ -3431,9 +3588,14 @@ next_try:
int32 FAR PASCAL_CONV swe_lun_eclipse_when_loc(double tjd_start, int32 ifl,
double *geopos, double *tret, double *attr, int32 backward, char *serr)
{
int32 retflag = 0, retflag2 = 0;
int32 retflag = 0, retflag2 = 0, retc;
double tjdr, tjds, tjd_max = 0;
int i;
if (geopos != NULL && (geopos[2] < SEI_ECL_GEOALT_MIN || geopos[2] > SEI_ECL_GEOALT_MAX)) {
if (serr != NULL)
sprintf(serr, "location for eclipses must be between %.0f and %.0f m above sea", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
return ERR;
}
ifl &= ~(SEFLG_JPLHOR | SEFLG_JPLHOR_APPROX);
next_lun_ecl:
if ((retflag = swe_lun_eclipse_when(tjd_start, ifl, 0, tret, backward, serr)) == ERR) {
@ -3470,11 +3632,19 @@ next_lun_ecl:
goto next_lun_ecl;
}
/* moon rise and moon set */
if (swe_rise_trans(tret[6] - 0.1, SE_MOON, NULL, ifl, SE_CALC_RISE|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjdr, serr) == ERR)
return ERR;
if (swe_rise_trans(tret[6] - 0.1, SE_MOON, NULL, ifl, SE_CALC_SET|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjds, serr) == ERR)
return ERR;
tjd_max = tret[0];
if ((retc = swe_rise_trans(tret[6] - 0.001, SE_MOON, NULL, ifl, SE_CALC_RISE|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjdr, serr)) == ERR)
return ERR;
if (retc >= 0 && (retc = swe_rise_trans(tret[6] - 0.001, SE_MOON, NULL, ifl, SE_CALC_SET|SE_BIT_DISC_BOTTOM, geopos, 0, 0, &tjds, serr)) == ERR)
return ERR;
if (retc >= 0) {
if (tjds < tret[6] || (tjds > tjdr && tjdr > tret[7])) {
if (backward)
tjd_start = tret[0] - 25;
else
tjd_start = tret[0] + 25;
goto next_lun_ecl;
}
if (tjdr > tret[6] && tjdr < tret[7]) {
tret[6] = 0;
for (i = 2; i <= 5; i++) {
@ -3497,9 +3667,17 @@ next_lun_ecl:
tjd_max = tjds;
}
}
}
tret[0] = tjd_max;
if ((retflag2 = swe_lun_eclipse_how(tjd_max, ifl, geopos, attr, serr)) == ERR)
return ERR;
if (retflag2 == 0) {
if (backward)
tjd_start = tret[0] - 25;
else
tjd_start = tret[0] + 25;
goto next_lun_ecl;
}
retflag |= (retflag2 & SE_ECL_ALLTYPES_LUNAR);
return retflag;
}
@ -3747,7 +3925,7 @@ int32 FAR PASCAL_CONV swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr
double tsid, h, e, f = EARTH_OBLATENESS;
double cosz, sinz, phi;
/* local apparent sidereal time */
tsid = swe_sidtime(tjd - swe_deltat(tjd)) * 15 + swed.topd.geolon;
tsid = swe_sidtime(tjd - swe_deltat_ex(tjd, iflag, serr)) * 15 + swed.topd.geolon;
/* local hour angle of the moon */
h = swe_degnorm(tsid - xm[0] / DEGTORAD);
/* geocentric latitude of the observer */
@ -3766,7 +3944,21 @@ int32 FAR PASCAL_CONV swe_pheno(double tjd, int32 ipl, int32 iflag, double *attr
int32 FAR PASCAL_CONV swe_pheno_ut(double tjd_ut, int32 ipl, int32 iflag, double *attr, char *serr)
{
return swe_pheno(tjd_ut + swe_deltat(tjd_ut), ipl, iflag, attr, serr);
double deltat;
int32 retflag = OK;
int32 epheflag = iflag & SEFLG_EPHMASK;
if (epheflag == 0) {
epheflag = SEFLG_SWIEPH;
iflag |= SEFLG_SWIEPH;
}
deltat = swe_deltat_ex(tjd_ut, iflag, serr);
retflag = swe_pheno(tjd_ut + deltat, ipl, iflag, attr, serr);
/* if ephe required is not ephe returned, adjust delta t: */
if ((retflag & SEFLG_EPHMASK) != epheflag) {
deltat = swe_deltat_ex(tjd_ut, retflag, serr);
retflag = swe_pheno(tjd_ut + deltat, ipl, iflag, attr, serr);
}
return retflag;
}
static int find_maximum(double y00, double y11, double y2, double dx,
@ -3856,7 +4048,7 @@ int32 FAR PASCAL_CONV swe_rise_trans_true_hor(
char *serr)
{
int i, j, k, ii, calc_culm, nculm = -1;
double tjd_et = tjd_ut + swe_deltat(tjd_ut);
double tjd_et = tjd_ut + swe_deltat_ex(tjd_ut, epheflag, serr);
double xc[6], xh[20][6], ah[6], aha;
double tculm[4], tcu, tc[20], h[20], t2[6], dc[6], dtint, dx, rdi, dd = 0;
int32 iflag = epheflag;
@ -3864,6 +4056,12 @@ int32 FAR PASCAL_CONV swe_rise_trans_true_hor(
double t, te, tt, dt, twohrs = 1.0 / 12.0;
double curdist;
AS_BOOL do_fixstar = (starname != NULL && *starname != '\0');
if (geopos[2] < SEI_ECL_GEOALT_MIN || geopos[2] > SEI_ECL_GEOALT_MAX) {
if (serr != NULL)
sprintf(serr, "location for swe_rise_trans() must be between %.0f and %.0f m above sea", SEI_ECL_GEOALT_MIN, SEI_ECL_GEOALT_MAX);
return ERR;
}
/*swi_set_tid_acc(tjd_ut, epheflag, 0, serr);*/
/* function calls for Pluto with asteroid number 134340
* are treated as calls for Pluto as main body SE_PLUTO */
if (ipl == SE_AST_OFFSET + 134340)
@ -3901,7 +4099,7 @@ int32 FAR PASCAL_CONV swe_rise_trans_true_hor(
for (ii = 0, t = tjd_ut - twohrs; ii <= jmax; ii++, t += twohrs) {
tc[ii] = t;
if (!do_fixstar) {
te = t + swe_deltat(t);
te = t + swe_deltat_ex(t, epheflag, serr);
if (swe_calc(te, ipl, iflag, xc, serr) == ERR)
return ERR;
}
@ -3966,7 +4164,7 @@ int32 FAR PASCAL_CONV swe_rise_trans_true_hor(
dt /= 3;
for (; dt > 0.0001; dt /= 3) {
for (i = 0, tt = tcu - dt; i < 3; tt += dt, i++) {
te = tt + swe_deltat(tt);
te = tt + swe_deltat_ex(tt, epheflag, serr);
if (!do_fixstar)
if (swe_calc(te, ipl, iflag, xc, serr) == ERR)
return ERR;
@ -3994,7 +4192,7 @@ int32 FAR PASCAL_CONV swe_rise_trans_true_hor(
}
tc[j] = tculm[i];
if (!do_fixstar) {
te = tc[j] + swe_deltat(tc[j]);
te = tc[j] + swe_deltat_ex(tc[j], epheflag, serr);
if (swe_calc(te, ipl, iflag, xc, serr) == ERR)
return ERR;
}
@ -4050,7 +4248,7 @@ int32 FAR PASCAL_CONV swe_rise_trans_true_hor(
for (i = 0; i < 20; i++) {
t = (t2[0] + t2[1]) / 2;
if (!do_fixstar) {
te = t + swe_deltat(t);
te = t + swe_deltat_ex(t, epheflag, serr);
if (swe_calc(te, ipl, iflag, xc, serr) == ERR)
return ERR;
}
@ -4110,7 +4308,7 @@ static int32 calc_mer_trans(
char *serr)
{
int i;
double tjd_et = tjd_ut + swe_deltat(tjd_ut);
double tjd_et = tjd_ut + swe_deltat_ex(tjd_ut, epheflag, serr);
double armc, armc0, arxc, x0[6], x[6], t, te;
double mdd;
int32 iflag = epheflag;
@ -4155,7 +4353,7 @@ static int32 calc_mer_trans(
if (rsmi & SE_CALC_ITRANSIT)
arxc = swe_degnorm(arxc + 180);
if (!do_fixstar) {
te = t + swe_deltat(t);
te = t + swe_deltat_ex(t, epheflag, serr);
if (swe_calc(te, ipl, iflag, x, serr) == ERR)
return ERR;
}
@ -4489,7 +4687,7 @@ int32 FAR PASCAL_CONV swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
int32 ipli;
int istart, iend;
int32 iflJ2000;
double plm;
double daya, plm;
double t = (tjd_et - J2000) / 36525, dt;
double x[6], xx[24], *xp, xobs[6], x2000[6];
double xpos[3][6], xnorm[6];
@ -5000,7 +5198,9 @@ int32 FAR PASCAL_CONV swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
} else {
/* traditional algorithm */
swi_cartpol_sp(pldat.xreturn+6, pldat.xreturn);
pldat.xreturn[0] -= swe_get_ayanamsa(tjd_et) * DEGTORAD;
if (swe_get_ayanamsa_ex(tjd_et, iflag, &daya, serr) == ERR)
return ERR;
pldat.xreturn[0] -= daya * DEGTORAD;
swi_polcart_sp(pldat.xreturn, pldat.xreturn+6);
}
}
@ -5022,12 +5222,14 @@ int32 FAR PASCAL_CONV swe_nod_aps(double tjd_et, int32 ipl, int32 iflag,
/**********************
* radians to degrees *
**********************/
if (!(iflag & SEFLG_RADIANS)) {
for (j = 0; j < 2; j++) {
pldat.xreturn[j] *= RADTODEG; /* ecliptic */
pldat.xreturn[j+3] *= RADTODEG;
pldat.xreturn[j+12] *= RADTODEG; /* equator */
pldat.xreturn[j+15] *= RADTODEG;
}
}
if (iflag & SEFLG_EQUATORIAL) {
for (j = 0; j <= 5; j++)
xp[j] = pldat.xreturn[12+j];
@ -5058,7 +5260,8 @@ int32 FAR PASCAL_CONV swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
double *xnasc, double *xndsc,
double *xperi, double *xaphe,
char *serr) {
return swe_nod_aps(tjd_ut + swe_deltat(tjd_ut),
/*swi_set_tid_acc(tjd_ut, iflag, 0, serr);*/
return swe_nod_aps(tjd_ut + swe_deltat_ex(tjd_ut, iflag, serr),
ipl, iflag, method, xnasc, xndsc, xperi, xaphe,
serr);
}
@ -5108,7 +5311,7 @@ int32 FAR PASCAL_CONV swe_gauquelin_sector(double t_ut, int32 ipl, char *starnam
* geometrically from ecl. longitude and latitude
*/
if (imeth == 0 || imeth == 1) {
t_et = t_ut + swe_deltat(t_ut);
t_et = t_ut + swe_deltat_ex(t_ut, iflag, serr);
eps = swi_epsiln(t_et, iflag) * RADTODEG;
swi_nutation(t_et, iflag, nutlo);
nutlo[0] *= RADTODEG;

View File

@ -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);
}

View File

@ -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
****************************/

View File

@ -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,14 +1380,23 @@ 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) {
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,9 +3054,10 @@ 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);
if (retval != OK)
@ -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
*/

View File

@ -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')

View File

@ -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 */

View File

@ -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)

10642
swe/src/swemptab.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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 */

View File

@ -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 */

File diff suppressed because it is too large Load Diff

View File

@ -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;

View File

@ -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)
#define SE_TIDAL_DEFAULT SE_TIDAL_DE431
#define SE_TIDAL_AUTOMATIC 999999
#define SE_TIDAL_MOSEPH SE_TIDAL_DE404
#define SE_TIDAL_SWIEPH SE_TIDAL_DEFAULT
#define SE_TIDAL_JPLEPH SE_TIDAL_DEFAULT
#define SE_MODEL_PREC_LONGTERM 0
#define SE_MODEL_PREC_SHORTTERM 1
#define SE_MODEL_NUT 2
#define SE_MODEL_SIDT 3
#define SE_MODEL_BIAS 4
#define SE_MODEL_JPLHOR_MODE 5
#define SE_MODEL_JPLHORA_MODE 6
#define SE_MODEL_DELTAT 7
/* precession models */
#define SEMOD_PREC_IAU_1976 1
#define SEMOD_PREC_IAU_2000 2
#define SEMOD_PREC_IAU_2006 3
#define SEMOD_PREC_BRETAGNON_2003 4
#define SEMOD_PREC_LASKAR_1986 5
#define SEMOD_PREC_SIMON_1994 6
#define SEMOD_PREC_WILLIAMS_1994 7
#define SEMOD_PREC_VONDRAK_2011 8
#define SEMOD_PREC_DEFAULT SEMOD_PREC_VONDRAK_2011
/* former implementations of the used
* IAU 1976, 2000 and 2006 for a limited time range
* in combination with a different model for
* long term precession.
#define SEMOD_PREC_DEFAULT_SHORT SEMOD_PREC_IAU_2000
*/
#define SEMOD_PREC_DEFAULT_SHORT SEMOD_PREC_VONDRAK_2011
/* nutation models */
#define SEMOD_NUT_IAU_1980 1
#define SEMOD_NUT_IAU_CORR_1987 2 /* Herring's (1987) corrections to IAU 1980
* nutation series. AA (1996) neglects them.*/
#define SEMOD_NUT_IAU_2000A 3 /* very time consuming ! */
#define SEMOD_NUT_IAU_2000B 4 /* fast, but precision of milli-arcsec */
#define SEMOD_NUT_DEFAULT SEMOD_NUT_IAU_2000B /* fast, but precision of milli-arcsec */
/* methods for sidereal time */
#define SEMOD_SIDT_LONGTERM 1
#define SEMOD_SIDT_IERS_CONV_2010 2
#define SEMOD_SIDT_PREC_MODEL 3
#define SEMOD_SIDT_IAU_1976 4
#define SEMOD_SIDT_DEFAULT SEMOD_SIDT_LONGTERM
//#define SEMOD_SIDT_DEFAULT SEMOD_SIDT_IERS_CONV_2010
/* frame bias methods */
#define SEMOD_BIAS_IAU2000 1 /* use frame bias matrix IAU 2000 */
#define SEMOD_BIAS_IAU2006 2 /* use frame bias matrix IAU 2000 */
#define SEMOD_BIAS_DEFAULT SEMOD_BIAS_IAU2006
/* methods of JPL Horizons (iflag & SEFLG_JPLHOR),
* using daily dpsi, deps; see explanations below */
#define SEMOD_JPLHOR_EXTENDED_1800 1 /* daily dpsi and deps from file are
* limited to 1962 - today. JPL uses the
* first and last value for all dates
* beyond this time range. */
#define SEMOD_JPLHOR_NOT_EXTENDED 2 /* outside the available time range
* 1962 - today default to SEFLG_JPLHOR_APROX */
#define SEMOD_JPLHOR_DEFAULT SEMOD_JPLHOR_EXTENDED_1800
/* SEMOD_JPLHOR_EXTENDED_1800, if combined with SEFLG_JPLHOR provides good
* agreement with JPL Horizons for 1800 - today. However, Horizons uses
* correct dpsi and deps only after 20-jan-1962. For all dates before that
* it uses dpsi and deps of 20-jan-1962, which provides a continuous
* ephemeris, but does not make sense otherwise.
* Before 1800, even this option does not provide agreement with Horizons,
* because Horizons uses a different precession model (Owen 1986)
* before 1800, which is not included in the Swiss Ephemeris.
* SEMOD_JPLHOR_NOT_EXTENDED causes the program to default to SEFLG_JPLHOR_APPROX,
* if the date is outside the time range 1962 - today, where values
* for dpsi and deps are given.
* Note that this will result in a non-continuous ephemeris near
* 20-jan-1962 and current years.
*/
/* methods of approximation of JPL Horizons (iflag & SEFLG_JPLHORA),
* without dpsi, deps; see explanations below */
#define SEMOD_JPLHORA_1 1
#define SEMOD_JPLHORA_2 2
#define SEMOD_JPLHORA_DEFAULT SEMOD_JPLHORA_1
/* With SEMOD_JPLHORA_1, planetary positions are always calculated
* using a recent precession/nutation model. Frame bias matrix is applied
* with some correction to RA and another correction is added to epsilon.
* This provides a very good approximation of JPL Horizons positions.
* With SEMOD_JPLHORA_2, frame bias as r$ecommended by IERS Conventions 2003
* and 2010 is *not* applied. Instead, dpsi_bias and deps_bias are added to
* nutation. This procedure is found in some older astronomical software.
* Equatorial apparent positions will be close to JPL Horizons
* (within a few mas) beetween 1962 and current years. Ecl. longitude
* will be good, latitude bad.
*/
#define SEMOD_DELTAT_ESPENAK_MEEUS_2006 1
#define SEMOD_DELTAT_STEPHENSON_MORRISON_2004 2
#define SEMOD_DELTAT_DEFAULT SEMOD_DELTAT_ESPENAK_MEEUS_2006
/**************************************************************
* here follow some ugly definitions which are only required
@ -512,10 +609,15 @@ extern "C" {
ext_def(int32) swe_heliacal_ut(double tjdstart_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 iflag, double *dret, char *serr);
ext_def(int32) swe_heliacal_pheno_ut(double tjd_ut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 TypeEvent, int32 helflag, double *darr, char *serr);
ext_def(int32) swe_vis_limit_mag(double tjdut, double *geopos, double *datm, double *dobs, char *ObjectName, int32 helflag, double *dret, char *serr);
/* the following are secret, for Victor Reijs' */
ext_def(int32) 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);
ext_def(int32) 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);
/* the following is secret, for Dieter, allows to test old models of
* precession, nutation, etc. Search for SE_MODEL_... in this file */
ext_def(void) swe_set_astro_models(int32 *imodel);
/****************************
* exports from sweph.c
****************************/
@ -561,12 +663,16 @@ ext_def (void) swe_set_topo(double geolon, double geolat, double geoalt);
ext_def(void) swe_set_sid_mode(int32 sid_mode, double t0, double ayan_t0);
/* get ayanamsa */
ext_def(int32) swe_get_ayanamsa_ex(double tjd_et, int32 iflag, double *daya, char *serr);
ext_def(int32) swe_get_ayanamsa_ex_ut(double tjd_ut, int32 iflag, double *daya, char *serr);
ext_def(double) swe_get_ayanamsa(double tjd_et);
ext_def(double) swe_get_ayanamsa_ut(double tjd_ut);
ext_def( char *) swe_get_ayanamsa_name(int32 isidmode);
/*ext_def(void) swe_set_timeout(int32 tsec);*/
/****************************
* exports from swedate.c
****************************/
@ -737,6 +843,7 @@ ext_def (int32) swe_nod_aps_ut(double tjd_ut, int32 ipl, int32 iflag,
/* delta t */
ext_def( double ) swe_deltat(double tjd);
ext_def(double) swe_deltat_ex(double tjd, int32 iflag, char *serr);
/* equation of time */
ext_def(int32) swe_time_equ(double tjd, double *te, char *serr);

File diff suppressed because it is too large Load Diff

View File

@ -59,45 +59,11 @@
for promoting such software, products or services.
*/
#define PREC_IAU_1976 1
#define PREC_IAU_2000 2
#define PREC_IAU_2006 3
#define PREC_BRETAGNON_2003 4
#define PREC_LASKAR_1986 5
#define PREC_SIMON_1994 6
#define PREC_WILLIAMS_1994 7
#define PREC_VONDRAK_2011 8
/* Precession coefficients for remote past and future.
* One of the following four defines must be true.
*/
#define USE_PREC_VONDRAK_2011 TRUE
#define USE_PREC_WILLIAMS_1994 FALSE
#define USE_PREC_SIMON_1994 FALSE
#define USE_PREC_LASKAR_1986 FALSE
#define USE_PREC_BRETAGNON_2003 FALSE
/* IAU precession 1976 or 2003 for recent centuries.
* only one of the following two defines may be TRUE */
#define USE_PREC_IAU_1976 FALSE
#define USE_PREC_IAU_2000 FALSE
#define USE_PREC_IAU_2006 FALSE /* precession model P03 */
#define PREC_IAU_1976_CTIES 2.0 /* J2000 +/- two centuries */
#define PREC_IAU_2000_CTIES 2.0 /* J2000 +/- two centuries */
/* we use P03 for whole ephemeris */
#define PREC_IAU_2006_CTIES 75.0 /* J2000 +/- 75 centuries */
/* choose between the following nutation models */
#define NUT_IAU_1980 FALSE
#define NUT_IAU_2000A FALSE /* very time consuming ! */
#define NUT_IAU_2000B TRUE /* fast, but precision of milli-arcsec */
/* Set TRUE, to include Herring's (1987) corrections to IAU 1980
* nutation series. AA (1996) neglects them. */
#define NUT_CORR_1987 FALSE
/* frame bias */
#define FRAME_BIAS_IAU2006 TRUE /* if false, frame bias iau2000 will be used
* difference is minimal. */
/* For reproducing JPL Horizons to 2 mas (SEFLG_JPLHOR):
* The user has to keep the following files up to date which contain
* the earth orientation parameters related to the IAU 1980 nutation
@ -111,7 +77,9 @@
#define DPSI_DEPS_IAU1980_FILE_FINALS "eop_finals.txt"
#define DPSI_DEPS_IAU1980_TJD0_HORIZONS 2437684.5
#define HORIZONS_TJD0_DPSI_DEPS_IAU1980 2437684.5
#define INCLUDE_CODE_FOR_DPSI_DEPS_IAU1980 TRUE
/*#define INCLUDE_CODE_FOR_DPSI_DEPS_IAU1980 TRUE*/
/*#define INCLUDE_CODE_FOR_DPSI_DEPS_IAU1980 TRUE */
/* You can set the latter false if you do not want to compile the
* code required to reproduce JPL Horizons.
* Keep it TRUE in order to reproduce JPL Horizons following
@ -140,9 +108,9 @@
* JPL Horizons is even better. Frame bias matrix is applied with
* some correction to RA and another correction is added to epsilon.
*/
#define APPROXIMATE_HORIZONS_ASTRODIENST TRUE
/*#define APPROXIMATE_HORIZONS_ASTRODIENST TRUE */
#define USE_HORIZONS_METHOD_BEFORE_1980 TRUE /* Horizons method before 20-jan-1962 */
/*#define USE_HORIZONS_METHOD_BEFORE_1980 TRUE * Horizons method before 20-jan-1962 */
/* The latter, if combined with SEFLG_JPLHOR provides good agreement
* with JPL Horizons for 1800 - today. However, Horizons uses correct
* dpsi and deps only after 20-jan-1962. For all dates before that
@ -183,6 +151,8 @@ extern void swi_icrs2fk5(double *x, int32 iflag, AS_BOOL backward);
extern int swi_precess(double *R, double J, int32 iflag, int direction );
extern void swi_precess_speed(double *xx, double t, int32 iflag, int direction);
extern int32 swi_guess_ephe_flag();
/* from sweph.c, light deflection, aberration, etc. */
extern void swi_deflect_light(double *xx, double dt, int32 iflag);
extern void swi_aberr_light(double *xx, double *xe, int32 iflag);

View File

@ -85,10 +85,10 @@ static char *infocmd1 = "\n\
Note: the date format is day month year (European style).\n\
-bj... begin date as an absolute Julian day number; e.g. -bj2415020.5\n\
-j... same as -bj\n\
-tHH.MMSS input time (ephemeris time)\n\
-ut input date is universal time\n\
-utHH:MM:SS input time\n\
-utHH.MMSS input time\n\
-tHH.MMSS input time (as Ephemeris Time)\n\
-ut input date is Universal Time\n\
-utHH:MM:SS input time (as Universal Time)\n\
-utHH.MMSS input time (as Universal Time)\n\
output time for eclipses, occultations, risings/settings is UT by default\n\
-lmt output date/time is LMT (with -geopos)\n\
-lat output date/time is LAT (with -geopos)\n\
@ -129,11 +129,11 @@ static char *infocmd2 = "\
The output lists 12 house cusps, Asc, MC, ARMC and Vertex.\n\
Houses can only be computed if option -ut is given.\n\
A equal\n\
E equal\n\
E equal = A\n\
B Alcabitius\n\
C Campanus\n\
G 36 Gauquelin sectors\n\
H horizon / azimut\n\
H horizon / azimuth\n\
K Koch\n\
M Morinus\n\
O Porphyry\n\
@ -158,11 +158,41 @@ static char *infocmd3 = "\
commas separated, + for east and north. If none are given,\n\
Greenwich is used: 0,51.5,0\n\
sidereal astrology:\n\
-ay.. ayanamsa, with number of method, e.g. ay0 for Fagan/Bradley\n\
-sid.. sidereal, with number of method; 'sid0' for Fagan/Bradley\n\
'sid1' for Lahiri\n\
-ay.. ayanamsha, with number of method, e.g. ay0 for Fagan/Bradley\n\
-sid.. sidereal, with number of method (see below)\n\
-sidt0.. sidereal, projection on ecliptic of t0 \n\
-sidsp.. sidereal, projection on solar system plane \n\
number of ayanamsha method:\n\
0 for Fagan/Bradley\n\
1 for Lahiri\n\
2 for De Luce\n\
3 for Raman\n\
4 for Ushashashi\n\
5 for Krishnamurti\n\
6 for Djwhal Khul\n\
7 for Yukteshwar\n\
8 for J.N. Bhasin\n\
9 for Babylonian/Kugler 1\n\
10 for Babylonian/Kugler 2\n\
11 for Babylonian/Kugler 3\n\
12 for Babylonian/Huber\n\
13 for Babylonian/Eta Piscium\n\
14 for Babylonian/Aldebaran = 15 Tau\n\
15 for Hipparchos\n\
16 for Sassanian\n\
17 for Galact. Center = 0 Sag\n\
18 for J2000\n\
19 for J1900\n\
20 for B1950\n\
21 for Suryasiddhanta\n\
22 for Suryasiddhanta, mean Sun\n\
23 for Aryabhata\n\
24 for Aryabhata, mean Sun\n\
25 for SS Citra\n\
26 for SS Revati\n\
27 for True Citra\n\
28 for True Revati\n\
29 for True Pushya\n\
ephemeris specifications:\n\
-edirPATH change the directory of the ephemeris files \n\
-eswe swiss ephemeris\n\
@ -176,10 +206,12 @@ static char *infocmd3 = "\
-j2000 no precession (i.e. J2000 positions)\n\
-icrs ICRS (use Internat. Celestial Reference System)\n\
-nonut no nutation \n\
";
static char *infocmd4 = "\
-speed calculate high precision speed \n\
-speed3 'low' precision speed from 3 positions \n\
do not use this option. -speed parameter\n\
is faster and preciser \n\
is faster and more precise \n\
-iXX force iflag to value XX\n\
-testaa96 test example in AA 96, B37,\n\
i.e. venus, j2450442.5, DE200.\n\
@ -189,8 +221,6 @@ static char *infocmd3 = "\
-testaa97\n\
-roundsec round to seconds\n\
-roundmin round to minutes\n\
";
static char *infocmd4 = "\
observer position:\n\
-hel compute heliocentric positions\n\
-bary compute barycentric positions (bar. earth instead of node) \n\
@ -217,6 +247,8 @@ static char *infocmd4 = "\
-occult occultation of planet or star by the moon. Use -p to \n\
specify planet (-pf -xfAldebaran for stars) \n\
output format same as with -solecl\n\
";
static char *infocmd5 = "\
-lunecl lunar eclipse\n\
output 1st line:\n\
eclipse date,\n\
@ -225,8 +257,6 @@ static char *infocmd4 = "\
output 2nd line:\n\
6 contacts for start and end of penumbral, partial, and\n\
total phase\n\
";
static char *infocmd5 = "\
-local only with -solecl or -occult, if the next event of this\n\
kind is wanted for a given geogr. position.\n\
Use -geopos[long,lat,elev] to specify that position.\n\
@ -257,12 +287,13 @@ static char *infocmd5 = "\
-penumbral penumbral lunar eclipse (only with -lunecl)\n\
-central central eclipse (only with -solecl, nonlocal)\n\
-noncentral non-central eclipse (only with -solecl, nonlocal)\n\
";
static char *infocmd6 = "\
specifications for risings and settings:\n\
-norefrac neglect refraction (with option -rise)\n\
-disccenter find rise of disc center (with option -rise)\n\
-discbottom find rise of disc bottom (with option -rise)\n\
-hindu hindu version of sunrise (with option -rise)\n\
";
static char *infocmd6 = "\
specifications for heliacal events:\n\
-at[press,temp,rhum,visr]:\n\
pressure in hPa\n\
@ -285,7 +316,7 @@ static char *infocmd6 = "\
backward search:\n\
-bwd\n";
/* characters still available:
bcgijklruvxy
bcgijklruvx
*/
static char *infoplan = "\n\
Planet selection letters:\n\
@ -295,11 +326,16 @@ static char *infoplan = "\n\
h ficticious factors J..X\n\
a all factors\n\
(the letters above can only appear as a single letter)\n\n\
single planet letters:\n\
single body numbers/letters:\n\
0 Sun (character zero)\n\
1 Moon (character 1)\n\
2 Mercury\n\
....\n\
3 Venus\n\
4 Mars\n\
5 Jupiter\n\
6 Saturn\n\
7 Uranus\n\
8 Neptune\n\
9 Pluto\n\
m mean lunar node\n\
t true lunar node\n\
@ -348,6 +384,8 @@ static char *infoplan = "\n\
Z White Moon\n\
w Waldemath's dark Moon\n\
z hypothetical body, with number given in -xz\n\
sidereal time:\n\
x sidereal time\n\
e print a line of labels\n\
\n";
/* characters still available
@ -382,12 +420,12 @@ static char *infoform = "\n\
a right ascension hours decimal\n\
D declination degree\n\
d declination decimal\n\
I Azimuth degree\n\
i Azimuth decimal\n\
H Height degree\n\
h Height decimal\n\
K Height (with refraction) degree\n\
k Height (with refraction) decimal\n\
I azimuth degree\n\
i azimuth decimal\n\
H altitude degree\n\
h altitude decimal\n\
K altitude (with refraction) degree\n\
k altitude (with refraction) decimal\n\
G house position in degrees\n\
g house position in degrees decimal\n\
j house number 1.0 - 12.99999\n\
@ -417,7 +455,7 @@ static char *infodate = "\n\
1.2.1991 three integers separated by a nondigit character for\n\
day month year. Dates are interpreted as Gregorian\n\
after 4.10.1582 and as Julian Calendar before.\n\
Time is always set to midnight.\n\
Time is always set to midnight (0 h).\n\
If the three letters jul are appended to the date,\n\
the Julian calendar is used even after 1582.\n\
If the four letters greg are appended to the date,\n\
@ -525,6 +563,10 @@ static char *infoexamp = "\n\
#define MODE_HOUSE 1
#define MODE_LABEL 2
#define SEARCH_RANGE_LUNAR_CYCLES 20000
#define OUTPUT_EXTRA_PRECISION 0
static char se_pname[AS_MAXCH];
static char *zod_nam[] = {"ar", "ta", "ge", "cn", "le", "vi",
"li", "sc", "sa", "cp", "aq", "pi"};
@ -567,8 +609,8 @@ static int hpos_meth = 0;
static double geopos[10];
static double attr[20], tret[20], datm[4], dobs[6];
static int32 iflag = 0, iflag2; /* external flag: helio, geo... */
static char *hs_nam[] = {"undef",
"Ascendant", "MC", "ARMC", "Vertex"};
static char *hs_nam[] =
{"undef", "Ascendant", "MC", "ARMC", "Vertex"};
static int direction = 1;
static AS_BOOL direction_flag = FALSE;
static int32 helflag = 0;
@ -580,6 +622,10 @@ static int32 whicheph = SEFLG_SWIEPH;
static char *psp;
static int32 norefrac = 0;
static int32 disccenter = 0;
static int32 discbottom = 0;
/* for test of old models only */
static int32 astro_models[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
static int do_set_astro_models = FALSE;
#define SP_LUNAR_ECLIPSE 1
#define SP_SOLAR_ECLIPSE 2
@ -629,10 +675,9 @@ int main(int argc, char *argv[])
int32 sid_mode = SE_SIDM_FAGAN_BRADLEY;
double t2, tstep = 1, thour = 0;
double delt;
datm[0] = 0; datm[1] = 0; datm[2] = 0; datm[3] = 0;
datm[0] = 1013.25; datm[1] = 15; datm[2] = 40; datm[3] = 0;
dobs[0] = 0; dobs[1] = 0;
dobs[2] = 0; dobs[3] = 0; dobs[4] = 0; dobs[5] = 0;
/* swe_set_tid_acc(-25.858); * to test delta t output */
serr[0] = serr_save[0] = serr_warn[0] = sdate_save[0] = '\0';
# ifdef MACOS
argc = ccommand(&argv); /* display the arguments window */
@ -653,10 +698,11 @@ int main(int argc, char *argv[])
}
}
thour = atof(s1);
thour += (thour < 0 ? -.00005 : .00005);
/* h.mmss -> decimal */
t = fmod(thour, 1) * 100 + 1e-6;
t = fmod(thour, 1) * 100;
j = (int) t;
t = fmod(t, 1) * 100 + 1e-6;
t = (int)(fmod(t, 1) * 100);
thour = (int) thour + j / 60.0 + t / 3600.0;
}
} else if (strncmp(argv[i], "-head", 5) == 0) {
@ -670,26 +716,26 @@ int main(int argc, char *argv[])
} else if (strncmp(argv[i], "-ay", 3) == 0) {
do_ayanamsa = TRUE;
sid_mode = atol(argv[i]+3);
swe_set_sid_mode(sid_mode, 0, 0);
/*swe_set_sid_mode(sid_mode, 0, 0);*/
} else if (strncmp(argv[i], "-sidt0", 6) == 0) {
iflag |= SEFLG_SIDEREAL;
sid_mode = atol(argv[i]+6);
if (sid_mode == 0)
sid_mode = SE_SIDM_FAGAN_BRADLEY;
sid_mode |= SE_SIDBIT_ECL_T0;
swe_set_sid_mode(sid_mode, 0, 0);
/*swe_set_sid_mode(sid_mode, 0, 0);*/
} else if (strncmp(argv[i], "-sidsp", 6) == 0) {
iflag |= SEFLG_SIDEREAL;
sid_mode = atol(argv[i]+6);
if (sid_mode == 0)
sid_mode = SE_SIDM_FAGAN_BRADLEY;
sid_mode |= SE_SIDBIT_SSY_PLANE;
swe_set_sid_mode(sid_mode, 0, 0);
/*swe_set_sid_mode(sid_mode, 0, 0);*/
} else if (strncmp(argv[i], "-sid", 4) == 0) {
iflag |= SEFLG_SIDEREAL;
sid_mode = atol(argv[i]+4);
if (sid_mode > 0)
swe_set_sid_mode(sid_mode, 0, 0);
/*if (sid_mode > 0)
swe_set_sid_mode(sid_mode, 0, 0);*/
} else if (strcmp(argv[i], "-jplhora") == 0) {
iflag |= SEFLG_JPLHOR_APPROX;
} else if (strcmp(argv[i], "-jplhor") == 0) {
@ -786,13 +832,13 @@ int main(int argc, char *argv[])
} else if (strcmp(argv[i], "-how") == 0) {
special_mode |= SP_MODE_HOW;
} else if (strcmp(argv[i], "-total") == 0) {
search_flag |= SE_ECL_TOTAL|SE_ECL_CENTRAL|SE_ECL_NONCENTRAL;
search_flag |= SE_ECL_TOTAL;
} else if (strcmp(argv[i], "-annular") == 0) {
search_flag |= SE_ECL_ANNULAR|SE_ECL_CENTRAL|SE_ECL_NONCENTRAL;
search_flag |= SE_ECL_ANNULAR;
} else if (strcmp(argv[i], "-anntot") == 0) {
search_flag |= SE_ECL_ANNULAR_TOTAL|SE_ECL_CENTRAL|SE_ECL_NONCENTRAL;
search_flag |= SE_ECL_ANNULAR_TOTAL;
} else if (strcmp(argv[i], "-partial") == 0) {
search_flag |= SE_ECL_PARTIAL|SE_ECL_CENTRAL|SE_ECL_NONCENTRAL;
search_flag |= SE_ECL_PARTIAL;
} else if (strcmp(argv[i], "-penumbral") == 0) {
search_flag |= SE_ECL_PENUMBRAL;
} else if (strcmp(argv[i], "-noncentral") == 0) {
@ -813,9 +859,22 @@ int main(int argc, char *argv[])
} else if (strcmp(argv[i], "-hindu") == 0) {
norefrac = 1;
disccenter = 1;
} else if (strcmp(argv[i], "-discbottom") == 0) {
discbottom = 1;
} else if (strcmp(argv[i], "-metr") == 0) {
special_event = SP_MERIDIAN_TRANSIT;
have_geopos = TRUE;
/* secret test feature for dieter */
} else if (strncmp(argv[i], "-prec",5) == 0) {
j = 0;
astro_models[j] = atoi(argv[i]+5);
sp = argv[i];
while((sp2 = strchr(sp, ',')) != NULL) {
sp = sp2 + 1;
j++;
astro_models[j] = atoi(sp);
}
do_set_astro_models = TRUE;
} else if (strncmp(argv[i], "-hev", 4) == 0) {
special_event = SP_HELIACAL;
search_flag = 0;
@ -824,7 +883,14 @@ int main(int argc, char *argv[])
have_geopos = TRUE;
if (strstr(argv[i], "AV")) hel_using_AV = TRUE;
} else if (strncmp(argv[i], "-at", 3) == 0) {
sscanf(argv[i]+3, "%lf,%lf,%lf,%lf", &(datm[0]), &(datm[1]), &(datm[2]), &(datm[3]));
sp = argv[i]+3;
j = 0;
while (j < 4 && sp != NULL) {
datm[j] = atof(sp);
sp = strchr(sp, ',');
if (sp != NULL) sp += 1;
j++;
}
} else if (strncmp(argv[i], "-obs", 4) == 0) {
sscanf(argv[i]+4, "%lf,%lf", &(dobs[0]), &(dobs[1]));
} else if (strncmp(argv[i], "-opt", 4) == 0) {
@ -890,6 +956,8 @@ int main(int argc, char *argv[])
round_flag |= BIT_ROUND_SEC;
} else if (strcmp(argv[i], "-roundmin") == 0) {
round_flag |= BIT_ROUND_MIN;
/*} else if (strncmp(argv[i], "-timeout", 8) == 0) {
swe_set_timeout(atoi(argv[i]) + 8);*/
} else if (strncmp(argv[i], "-t", 2) == 0) {
if (strlen(argv[i]) > 2) {
*s1 = '\0';
@ -902,10 +970,11 @@ int main(int argc, char *argv[])
}
}
thour = atof(s1);
thour += (thour < 0 ? -.00005 : .00005);
/* h.mmss -> decimal */
t = fmod(thour, 1) * 100 + 1e-6;
t = fmod(thour, 1) * 100;
j = (int) t;
t = fmod(t, 1) * 100 + 1e-6;
t = (int)(fmod(t, 1) * 100);
thour = (int) thour + j / 60.0 + t / 3600.0;
}
} else if (strncmp(argv[i], "-h", 2) == 0
@ -952,10 +1021,6 @@ int main(int argc, char *argv[])
if (special_event == SP_OCCULTATION && ipl == 1)
ipl = 2; /* no occultation of moon by moon */
}
geopos[0] = top_long;
geopos[1] = top_lat;
geopos[2] = top_elev;
swe_set_topo(top_long, top_lat, top_elev);
#if HPUNIX
gethostname (hostname, 80);
if (strstr(hostname, "as10") != NULL)
@ -968,7 +1033,7 @@ int main(int argc, char *argv[])
}
}
iflag = (iflag & ~SEFLG_EPHMASK) | whicheph;
if (strpbrk(fmt, "SsQ") != NULL)
if (strpbrk(fmt, "SsQ") != NULL && !(iflag & SEFLG_SPEED3))
iflag |= SEFLG_SPEED;
if (*ephepath == '\0') {
if (make_ephemeris_path(iflag, argv[0], ephepath) == ERR) {
@ -976,9 +1041,20 @@ int main(int argc, char *argv[])
whicheph = SEFLG_MOSEPH;
}
}
if (whicheph != SEFLG_MOSEPH)
swe_set_ephe_path(ephepath);
if (whicheph & SEFLG_JPLEPH)
swe_set_jpl_file(fname);
/* the following is only a test feature */
if (do_set_astro_models)
swe_set_astro_models(astro_models); /* secret test feature for dieter */
if ((iflag & SEFLG_SIDEREAL) || do_ayanamsa)
swe_set_sid_mode(sid_mode, 0, 0);
geopos[0] = top_long;
geopos[1] = top_lat;
geopos[2] = top_elev;
swe_set_topo(top_long, top_lat, top_elev);
/*swe_set_tid_acc(-25.82); * to test delta t output */
while (TRUE) {
serr[0] = serr_save[0] = serr_warn[0] = '\0';
if (begindate == NULL) {
@ -1019,7 +1095,6 @@ int main(int argc, char *argv[])
strcpy(sastno, sdate + 3);
*sdate = '\0';
}
// swe_set_tid_acc((double) (iflag & SEFLG_EPHMASK));
sp = sdate;
if (*sp == '.') {
goto end_main;
@ -1091,7 +1166,7 @@ int main(int argc, char *argv[])
printf(" greg.");
else
printf(" jul.");
t2 = jut;
t2 = jut + (jut < 0 ? -.5 : .5) / 3600.;
printf(" % 2d:", (int) t2);
t2 = (t2 - (int32) t2) * 60;
printf("%02d:", (int) t2);
@ -1103,10 +1178,10 @@ int main(int argc, char *argv[])
printf(" ET");
printf("\t\tversion %s", swe_version(sout));
}
delt = swe_deltat(t);
delt = swe_deltat_ex(t, iflag, serr);
if (universal_time) {
if (with_header) {
printf("\nUT: %.11f", t);
printf("\nUT: %.9f", t);
}
if (with_header) {
printf(" delta t: %f sec", delt * 86400.0);
@ -1119,10 +1194,13 @@ int main(int argc, char *argv[])
}
iflgret = swe_calc(te, SE_ECL_NUT, iflag, xobl, serr);
if (with_header) {
printf("\nET: %.11f", te);
printf("\nET: %.9f", te);
if (iflag & SEFLG_SIDEREAL) {
daya = swe_get_ayanamsa(te);
printf(" ayanamsa = %s", dms(daya, round_flag));
if (swe_get_ayanamsa_ex(te, iflag, &daya, serr) == ERR) {
printf(" error in swe_get_ayanamsa_ex(): %s\n", serr);
exit(1);
}
printf(" ayanamsa = %s (%s)", dms(daya, round_flag), swe_get_ayanamsa_name(sid_mode));
}
if (have_geopos) {
printf("\ngeo. long %f, lat %f, alt %f", geopos[0], geopos[1], geopos[2]);
@ -1154,7 +1232,10 @@ int main(int argc, char *argv[])
if (with_header && !with_header_always)
with_header = FALSE;
if (do_ayanamsa) {
daya = swe_get_ayanamsa(te);
if (swe_get_ayanamsa_ex(te, iflag, &daya, serr) == ERR) {
printf(" error in swe_get_ayanamsa_ex(): %s\n", serr);
exit(1);
}
fputs("Ayanamsa", stdout);
fputs(gap, stdout);
fputs(dms(daya, round_flag), stdout);
@ -1186,9 +1267,10 @@ int main(int argc, char *argv[])
if (ipl == SE_MEAN_NODE || ipl == SE_TRUE_NODE
|| ipl == SE_MEAN_APOG || ipl == SE_OSCU_APOG)
continue;
} else /* geocentric */
} else { /* geocentric */
if (ipl == SE_EARTH)
continue;
}
/* ecliptic position */
if (iflag_f >=0)
iflag = iflag_f;
@ -1209,10 +1291,15 @@ int main(int argc, char *argv[])
swe_get_planet_name(ipl, se_pname);
}
if (*psp == 'q') {/* delta t */
x[0] = swe_deltat(te) * 86400;
x[0] = swe_deltat_ex(te, iflag, serr) * 86400;
x[1] = x[2] = x[3] = 0;
strcpy(se_pname, "Delta T");
}
if (*psp == 'x') {/* sidereal time */
x[0] = swe_degnorm(swe_sidtime(tut) * 15 + geopos[0]);
x[1] = x[2] = x[3] = 0;
strcpy(se_pname, "Sidereal Time");
}
if (*psp == 'o') {/* ecliptic is wanted, remove nutation */
x[2] = x[3] = 0;
strcpy(se_pname, "Ecl. Obl.");
@ -1234,7 +1321,8 @@ int main(int argc, char *argv[])
&& (ipl == SE_SUN || ipl == SE_MOON
|| ipl == SE_MEAN_NODE || ipl == SE_TRUE_NODE
|| ipl == SE_CHIRON || ipl == SE_PHOLUS || ipl == SE_CUPIDO
|| ipl >= SE_AST_OFFSET || ipl == SE_FIXSTAR)) {
|| ipl >= SE_AST_OFFSET || ipl == SE_FIXSTAR
|| *psp == 'y')) {
fputs("error: ", stdout);
fputs(serr, stdout);
fputs("\n", stdout);
@ -1306,10 +1394,10 @@ int main(int argc, char *argv[])
* of 1013.25 mbar is assumed at 0 m above sea level.
* If the altitude of the observer is given (in geopos[2])
* pressure is estimated according to that */
swe_azalt(tut, SE_EQU2HOR, geopos, 0, 10, xt, xaz);
swe_azalt(tut, SE_EQU2HOR, geopos, datm[0], datm[1], xt, xaz);
if (diff_mode) {
iflgret = swe_calc(te, ipldiff, iflgt, xt, serr);
swe_azalt(tut, SE_EQU2HOR, geopos, 0, 10, xt, x2);
swe_azalt(tut, SE_EQU2HOR, geopos, datm[0], datm[1], xt, x2);
if (diff_mode == DIFF_DIFF) {
for (i = 1; i < 3; i++)
xaz[i] -= x2[i];
@ -1548,7 +1636,11 @@ static int print_line(int mode)
case 'l':
if (is_label) { printf("long"); break; }
ldec:
#if OUTPUT_EXTRA_PRECISION
printf("%# 11.9f", x[0]);
#else
printf("%# 11.7f", x[0]);
#endif
break;
case 'G':
if (is_label) { printf("housPos"); break; }
@ -1671,7 +1763,11 @@ static int print_line(int mode)
break;
case 'b':
if (is_label) { printf("lat"); break; }
#if OUTPUT_EXTRA_PRECISION
printf("%# 11.9f", x[1]);
#else
printf("%# 11.7f", x[1]);
#endif
break;
case 'A': /* right ascension */
if (is_label) { printf("RA"); break; }
@ -1679,7 +1775,11 @@ static int print_line(int mode)
break;
case 'a': /* right ascension */
if (is_label) { printf("RA"); break; }
#if OUTPUT_EXTRA_PRECISION
printf("%# 11.9f", xequ[0]);
#else
printf("%# 11.7f", xequ[0]);
#endif
break;
case 'D': /* declination */
if (is_label) { printf("decl"); break; }
@ -1687,7 +1787,11 @@ static int print_line(int mode)
break;
case 'd': /* declination */
if (is_label) { printf("decl"); break; }
#if OUTPUT_EXTRA_PRECISION
printf("%# 11.9f", xequ[1]);
#else
printf("%# 11.7f", xequ[1]);
#endif
break;
case 'I': /* azimuth */
if (is_label) { printf("azimuth"); break; }
@ -1874,7 +1978,6 @@ static int print_line(int mode)
return OK;
}
#define OUTPUT_EXTRA_PRECISION 0
static char *dms(double xv, int32 iflg)
{
int izod;
@ -1890,18 +1993,29 @@ static char *dms(double xv, int32 iflg)
if (isnan(xv))
return "nan";
#endif
if (xv >= 360)
xv = 0;
*s = '\0';
if (iflg & SEFLG_EQUATORIAL)
c = "h";
if (xv < 0) {
xv = -xv;
sgn = -1;
} else
} else {
sgn = 1;
if (iflg & BIT_ROUND_MIN)
}
if (iflg & BIT_ROUND_MIN) {
xv = swe_degnorm(xv + 0.5/60);
if (iflg & BIT_ROUND_SEC)
} else if (iflg & BIT_ROUND_SEC) {
xv = swe_degnorm(xv + 0.5/3600);
} else {
/* rounding 0.9999999999 to 1 */
#if OUTPUT_EXTRA_PRECISION
xv += (xv < 0 ? -1 : 1 ) * 0.000000005 / 3600.0;
#else
xv += (xv < 0 ? -1 : 1 ) * 0.00005 / 3600.0;
#endif
}
if (iflg & BIT_ZODIAC) {
izod = (int) (xv / 30);
xv = fmod(xv, 30);
@ -1935,10 +2049,10 @@ static char *dms(double xv, int32 iflg)
goto return_dms;
xv -= ksec;
#if OUTPUT_EXTRA_PRECISION
k = (int32) (xv * 100000 + 0.5);
sprintf(s1, ".%05d", k);
k = (int32) (xv * 100000000);
sprintf(s1, ".%08d", k);
#else
k = (int32) (xv * 10000 + 0.5);
k = (int32) (xv * 10000);
sprintf(s1, ".%04d", k);
#endif
strcat(s, s1);
@ -1973,6 +2087,7 @@ static int letter_to_ipl(int letter)
case 'e': /* swetest: a line of labels */
case 'q': /* swetest: delta t */
case 'y': /* swetest: time equation */
case 'x': /* swetest: sidereal time */
case 's': /* swetest: an asteroid, with number given in -xs[number] */
case 'z': /* swetest: a fictitious body, number given in -xz[number] */
case 'd': /* swetest: default (main) factors 0123456789mtABC */
@ -2001,13 +2116,13 @@ static int32 call_rise_set(double t_ut, int32 ipl, char *star, int32 whicheph, i
{
int ii;
int32 rsmi = 0;
double tret[10];
double tret[10], tret1sv = 0;
double t0, t1;
int32 retc = OK;
swe_set_topo(geopos[0], geopos[1], geopos[2]);
do_printf("\n");
/* loop over days */
for (ii = 0; ii < nstep; ii++, t_ut = tret[1] + 0.1) {
for (ii = 0; ii < nstep; ii++, t_ut = tret1sv + 0.1) {
*sout = '\0';
/* swetest -rise
* calculate and print rising and setting */
@ -2016,7 +2131,8 @@ static int32 call_rise_set(double t_ut, int32 ipl, char *star, int32 whicheph, i
rsmi = SE_CALC_RISE;
if (norefrac) rsmi |= SE_BIT_NO_REFRACTION;
if (disccenter) rsmi |= SE_BIT_DISC_CENTER;
if (swe_rise_trans(t_ut, ipl, star, whicheph, rsmi, geopos, 1013.25, 10, &(tret[0]), serr) != OK) {
if (discbottom) rsmi |= SE_BIT_DISC_BOTTOM;
if (swe_rise_trans(t_ut, ipl, star, whicheph, rsmi, geopos, datm[0], datm[1], &(tret[0]), serr) != OK) {
do_printf(serr);
exit(0);
}
@ -2024,10 +2140,12 @@ static int32 call_rise_set(double t_ut, int32 ipl, char *star, int32 whicheph, i
rsmi = SE_CALC_SET;
if (norefrac) rsmi |= SE_BIT_NO_REFRACTION;
if (disccenter) rsmi |= SE_BIT_DISC_CENTER;
if (swe_rise_trans(t_ut, ipl, star, whicheph, rsmi, geopos, 1013.25, 10, &(tret[1]), serr) != OK) {
if (discbottom) rsmi |= SE_BIT_DISC_BOTTOM;
if (swe_rise_trans(t_ut, ipl, star, whicheph, rsmi, geopos, datm[0], datm[1], &(tret[1]), serr) != OK) {
do_printf(serr);
exit(0);
}
tret1sv = tret[1];
if (time_flag & (BIT_TIME_LMT | BIT_TIME_LAT)) {
retc = ut_to_lmt_lat(tret[0], geopos, &(tret[0]), serr);
retc = ut_to_lmt_lat(tret[1], geopos, &(tret[1]), serr);
@ -2061,15 +2179,16 @@ static int32 call_rise_set(double t_ut, int32 ipl, char *star, int32 whicheph, i
* midheaven */
if (special_event == SP_MERIDIAN_TRANSIT) {
/* transit over midheaven */
if (swe_rise_trans(t_ut, ipl, star, whicheph, SE_CALC_MTRANSIT, geopos, 1013.25, 10, &(tret[0]), serr) != OK) {
if (swe_rise_trans(t_ut, ipl, star, whicheph, SE_CALC_MTRANSIT, geopos, datm[0], datm[1], &(tret[0]), serr) != OK) {
do_printf(serr);
return ERR;
}
/* transit over lower midheaven */
if (swe_rise_trans(t_ut, ipl, star, whicheph, SE_CALC_ITRANSIT, geopos, 1013.25, 10, &(tret[1]), serr) != OK) {
if (swe_rise_trans(t_ut, ipl, star, whicheph, SE_CALC_ITRANSIT, geopos, datm[0], datm[1], &(tret[1]), serr) != OK) {
do_printf(serr);
return ERR;
}
tret1sv = tret[1];
if (time_flag & (BIT_TIME_LMT | BIT_TIME_LAT)) {
retc = ut_to_lmt_lat(tret[0], geopos, &(tret[0]), serr);
retc = ut_to_lmt_lat(tret[1], geopos, &(tret[1]), serr);
@ -2198,6 +2317,7 @@ ERR) {
sprintf(sout + strlen(sout), "%s ", hms_from_tjd(tret[7]));
else
strcat(sout, " - ");
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
strcat(sout, "\n");
/* global lunar eclipse */
} else {
@ -2238,7 +2358,7 @@ ERR) {
/* short output:
* date, time of day, umbral magnitude, umbral duration, saros series, member number */
sprintf(sout_short, "%s\t%2d.%2d.%4d\t%s\t%.3f\t%s\t%d\t%d\n", sout, jday, jmon, jyear, hms(jut,0), attr[8],s1, (int) attr[9], (int) attr[10]);
sprintf(sout + strlen(sout), "%2d.%02d.%04d\t%s\t%.4f/%.4f\tsaros %d/%d\t%.6f\n", jday, jmon, jyear, hms(jut,BIT_LZEROES), attr[0],attr[1], (int) attr[9], (int) attr[10], t_ut);
sprintf(sout + strlen(sout), "%2d.%02d.%04d\t%s\t%.4f/%.4f\tsaros %d/%d\t%.6f\tdt=%.2f\n", jday, jmon, jyear, hms(jut,BIT_LZEROES), attr[0],attr[1], (int) attr[9], (int) attr[10], t_ut, swe_deltat_ex(t_ut, whicheph, serr) * 86400);
/* second line:
* eclipse times, penumbral, partial, total begin and end */
sprintf(sout + strlen(sout), " %s ", hms_from_tjd(tret[6]));
@ -2258,7 +2378,9 @@ ERR) {
sprintf(sout + strlen(sout), "%s ", hms_from_tjd(tret[3]));
else
strcat(sout, " - ");
sprintf(sout + strlen(sout), "%s\n", hms_from_tjd(tret[7]));
sprintf(sout + strlen(sout), "%s", hms_from_tjd(tret[7]));
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
strcat(sout, "\n");
if (special_mode & SP_MODE_HOCAL) {
swe_split_deg(jut, SE_SPLIT_DEG_ROUND_MIN, &ihou, &imin, &isec, &dfrc, &isgn);
sprintf(sout, "\"%04d %02d %02d %02d.%02d %d\",\n", jyear, jmon, jday, ihou, imin, ecl_type);
@ -2315,7 +2437,7 @@ attr, direction_flag, serr)) == ERR) {
if (!has_found) {
ii--;
} else {
swe_calc(t_ut + swe_deltat(t_ut), SE_ECL_NUT, 0, x, serr);
swe_calc(t_ut + swe_deltat_ex(t_ut, whicheph, serr), SE_ECL_NUT, 0, x, serr);
if (time_flag & (BIT_TIME_LMT | BIT_TIME_LAT)) {
for (i = 0; i < 10; i++) {
if (tret[i] != 0)
@ -2351,6 +2473,7 @@ attr, direction_flag, serr)) == ERR) {
strcpy(s4, hms(fmod(tret[3] + 0.5, 1) * 24, BIT_LZEROES)),
strcpy(s2, hms(fmod(tret[4] + 0.5, 1) * 24, BIT_LZEROES)));
#endif
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
strcat(sout, "\n");
do_printf(sout);
}
@ -2404,7 +2527,9 @@ attr, direction_flag, serr)) == ERR) {
} else {
strcat(sout, " - ");
}
sprintf(sout + strlen(sout), "%s\n", hms_from_tjd(tret[3]));
sprintf(sout + strlen(sout), "%s", hms_from_tjd(tret[3]));
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
strcat(sout, "\n");
sprintf(sout + strlen(sout), "\t%s\t%s", strcpy(s1, dms(geopos_max[0], BIT_ROUND_MIN)), strcpy(s2, dms(geopos_max[1], BIT_ROUND_MIN)));
strcat(sout, "\t");
strcat(sout_short, "\t");
@ -2413,8 +2538,9 @@ attr, direction_flag, serr)) == ERR) {
do_printf(serr);
return ERR;
}
if (fabs(tret[0] - t_ut) > 2)
if (fabs(tret[0] - t_ut) > 2) {
do_printf("when_loc returns wrong date\n");
}
dt = (tret[3] - tret[2]) * 24 * 60;
sprintf(s1, "%d min %4.2f sec", (int) dt, fmod(dt, 1) * 60);
strcat(sout, s1);
@ -2445,6 +2571,7 @@ static int32 call_lunar_occultation(double t_ut, int32 ipl, char *star, int32 wh
double dt, tret[30], attr[30], geopos_max[3];
char s1[AS_MAXCH], s2[AS_MAXCH];
AS_BOOL has_found = FALSE;
int nloops = 0;
/* no selective eclipse type set, set all */
if ((search_flag & SE_ECL_ALLTYPES_SOLAR) == 0)
search_flag |= SE_ECL_ALLTYPES_SOLAR;
@ -2454,10 +2581,25 @@ static int32 call_lunar_occultation(double t_ut, int32 ipl, char *star, int32 wh
do_printf("\n");
for (ii = 0; ii < nstep; ii++) {
*sout = '\0';
if (special_mode & SP_MODE_LOCAL) {
if ((eclflag = swe_lun_occult_when_loc(t_ut, ipl, star, whicheph, geopos, tret, attr, direction_flag, serr)) == ERR) {
nloops++;
if (nloops > SEARCH_RANGE_LUNAR_CYCLES) {
sprintf(serr, "event search ended after %d lunar cycles at jd=%f\n", SEARCH_RANGE_LUNAR_CYCLES, t_ut);
do_printf(serr);
return ERR;
}
if (special_mode & SP_MODE_LOCAL) {
/* * local search for occultation, test one lunar cycle only (SE_ECL_ONE_TRY) */
if (ipl != SE_SUN) {
search_flag &= ~(SE_ECL_ANNULAR|SE_ECL_ANNULAR_TOTAL);
if (search_flag == 0)
search_flag = SE_ECL_ALLTYPES_SOLAR;
}
if ((eclflag = swe_lun_occult_when_loc(t_ut, ipl, star, whicheph, geopos, tret, attr, direction_flag|SE_ECL_ONE_TRY, serr)) == ERR) {
do_printf(serr);
return ERR;
} else if (eclflag == 0) { /* event not found, try next conjunction */
t_ut = tret[0] + direction * 10; /* try again with start date increased by 10 */
ii--;
} else {
t_ut = tret[0];
if (time_flag & (BIT_TIME_LMT | BIT_TIME_LAT)) {
@ -2525,17 +2667,23 @@ static int32 call_lunar_occultation(double t_ut, int32 ipl, char *star, int32 wh
strcpy(s4, hms(fmod(tret[3] + 0.5, 1) * 24, BIT_LZEROES)),
strcpy(s2, hms(fmod(tret[4] + 0.5, 1) * 24, BIT_LZEROES)));
#endif
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
strcat(sout, "\n");
do_printf(sout);
}
}
} /* endif search_local */
if (!(special_mode & SP_MODE_LOCAL)) {
/* * global search for occultations */
if ((eclflag = swe_lun_occult_when_glob(t_ut, ipl, star, whicheph, search_flag, tret, direction_flag, serr)) == ERR) {
/* * global search for occultations, test one lunar cycle only (SE_ECL_ONE_TRY) */
if ((eclflag = swe_lun_occult_when_glob(t_ut, ipl, star, whicheph, search_flag, tret, direction_flag|SE_ECL_ONE_TRY, serr)) == ERR) {
do_printf(serr);
return ERR;
}
if (eclflag == 0) { /* no occltation was found at next conjunction, try next conjunction */
t_ut = tret[0] + direction;
ii--;
continue;
}
if ((eclflag & SE_ECL_TOTAL)) {
strcpy(sout, "total ");
ecl_type = ECL_SOL_TOTAL;
@ -2573,7 +2721,9 @@ static int32 call_lunar_occultation(double t_ut, int32 ipl, char *star, int32 wh
sprintf(sout + strlen(sout), "%s ", hms_from_tjd(tret[5]));
else
strcat(sout, " - ");
sprintf(sout + strlen(sout), "%s\n", hms_from_tjd(tret[3]));
sprintf(sout + strlen(sout), "%s", hms_from_tjd(tret[3]));
sprintf(sout + strlen(sout), "dt=%.1f", swe_deltat_ex(tret[0], whicheph, serr) * 86400.0);
strcat(sout, "\n");
sprintf(sout + strlen(sout), "\t%s\t%s", strcpy(s1, dms(geopos_max[0], BIT_ROUND_MIN)), strcpy(s2, dms(geopos_max[1], BIT_ROUND_MIN)));
if (!(eclflag & SE_ECL_PARTIAL) && !(eclflag & SE_ECL_NONCENTRAL)) {
if ((eclflag = swe_lun_occult_when_loc(t_ut - 10, ipl, star, whicheph, geopos_max, tret, attr, 0, serr)) == ERR) {
@ -2785,10 +2935,14 @@ static int do_special_event(double tjd, int32 ipl, char *star, int32 special_eve
return retc;
}
static char *hms_from_tjd(double x)
static char *hms_from_tjd(double tjd)
{
static char s[AS_MAXCH];
sprintf(s, "%s ", hms(fmod(x + 1000000.5, 1) * 24, BIT_LZEROES));
double x;
/* tjd may be negative, 0h corresponds to day number 9999999.5 */
x = fmod(tjd, 1); /* may be negative ! */
x = fmod(x + 1.5, 1); /* is positive day fraction */
sprintf(s, "%s ", hms(x * 24, BIT_LZEROES));
return s;
}
@ -2831,9 +2985,6 @@ static int make_ephemeris_path(int32 iflg, char *argv0, char *path)
char *sp;
char *dirglue = DIR_GLUE;
size_t pathlen = 0;
/* moshier needs no ephemeris path */
if (iflg & SEFLG_MOSEPH)
return OK;
/* current working directory */
sprintf(path, ".%c", *PATH_SEPARATOR);
/* program directory */