diff --git a/generate/codegen.c b/generate/codegen.c index e2b28708..8ca457a1 100644 --- a/generate/codegen.c +++ b/generate/codegen.c @@ -210,7 +210,7 @@ static int ParseVsopBodyName(const cg_context_t *context, const char *name, vsop return LogError(context, "Unknown VSOP body name '%s'", name); } -static int JsChebyshev(cg_context_t *context) +static int ListChebyshev(cg_context_t *context) { int error = 1; int body, i, record_index; @@ -238,7 +238,7 @@ static int JsChebyshev(cg_context_t *context) if (record_index > 0) fprintf(context->outfile, ",\n"); - fprintf(context->outfile, "{ tt:%lf, ndays:%lf, coeff:[\n", record.jdStart - T0, record.jdDelta); + fprintf(context->outfile, "{ 'tt':%lf, 'ndays':%lf, 'coeff':[\n", record.jdStart - T0, record.jdDelta); for (i=0; i < record.numpoly; ++i) { fprintf(context->outfile, " [%0.12lf, %0.12lf, %0.12lf]%s\n", @@ -660,7 +660,7 @@ static const cg_directive_entry DirectiveTable[] = { { "C_VSOP", CVsop }, { "LIST_VSOP", ListVsop }, - { "JS_CHEBYSHEV", JsChebyshev }, + { "LIST_CHEBYSHEV", ListChebyshev }, { "C_CHEBYSHEV", CChebyshev }, { "DELTA_T", GenDeltaT }, { NULL, NULL } diff --git a/generate/template/astronomy.js b/generate/template/astronomy.js index 0e2e97c7..5b6eb95b 100644 --- a/generate/template/astronomy.js +++ b/generate/template/astronomy.js @@ -241,7 +241,7 @@ const vsop = { }; const cheb = { - Pluto: $ASTRO_JS_CHEBYSHEV(8) + Pluto: $ASTRO_LIST_CHEBYSHEV(8) }; const DT = $ASTRO_DELTA_T(); diff --git a/generate/template/astronomy.py b/generate/template/astronomy.py index 01c47828..b1765de8 100644 --- a/generate/template/astronomy.py +++ b/generate/template/astronomy.py @@ -863,9 +863,6 @@ def _CalcMoon(time): (_ARC * (_ERAD / _AU)) / (0.999953253 * SINPI) ) -# END CalcMoon -#---------------------------------------------------------------------------- - def GeoMoon(time): m = _CalcMoon(time) @@ -884,7 +881,7 @@ def GeoMoon(time): mpos2 = _precession(time.tt, mpos1, 0) return Vector(mpos2[0], mpos2[1], mpos2[2], time) - +# END CalcMoon #---------------------------------------------------------------------------- # BEGIN VSOP @@ -916,4 +913,9 @@ _vsop = [ # END VSOP #---------------------------------------------------------------------------- +# BEGIN CHEBYSHEV +_pluto = $ASTRO_LIST_CHEBYSHEV(8) + +# END CHEBYSHEV +#---------------------------------------------------------------------------- diff --git a/source/js/astronomy.js b/source/js/astronomy.js index 8f6d3105..caa17119 100644 --- a/source/js/astronomy.js +++ b/source/js/astronomy.js @@ -842,7 +842,7 @@ const vsop = { const cheb = { Pluto: [ -{ tt:-109573.500000, ndays:26141.000000, coeff:[ +{ 'tt':-109573.500000, 'ndays':26141.000000, 'coeff':[ [-30.303124711144, -18.980368465705, 3.206649343866], [20.092745278347, -27.533908687219, -14.641121965990], [9.137264744925, 6.513103657467, -0.720732357468], @@ -863,7 +863,7 @@ const cheb = { [0.001695288316, 0.000768480768, 0.000287916141], [-0.001428026702, 0.002707551594, 0.001195955756]] }, -{ tt:-83432.500000, ndays:26141.000000, coeff:[ +{ 'tt':-83432.500000, 'ndays':26141.000000, 'coeff':[ [67.049456204563, -9.279626603192, -23.091941092128], [14.860676672314, 26.594121136143, 3.819668867047], [-6.254409044120, 1.408757903538, 2.323726101433], @@ -884,7 +884,7 @@ const cheb = { [0.001505145187, 0.001081653337, 0.000426723640], [-0.002019479384, 0.002375617497, 0.001068258925]] }, -{ tt:-57291.500000, ndays:26141.000000, coeff:[ +{ 'tt':-57291.500000, 'ndays':26141.000000, 'coeff':[ [46.038290912405, 73.773759757856, 9.148670950706], [-22.354364534703, 10.217143138926, 9.921247676076], [-2.696282001399, -4.440843715929, -0.572373037840], @@ -905,7 +905,7 @@ const cheb = { [0.001234661297, 0.001342978436, 0.000545313112], [-0.002517963678, 0.001941826791, 0.000893859860]] }, -{ tt:-31150.500000, ndays:26141.000000, coeff:[ +{ 'tt':-31150.500000, 'ndays':26141.000000, 'coeff':[ [-39.074661990988, 30.963513412373, 21.431709298065], [-12.033639281924, -31.693679132310, -6.263961539568], [7.233936758611, -3.979157072767, -3.421027935569], @@ -926,7 +926,7 @@ const cheb = { [0.000907458104, 0.001537243912, 0.000637001965], [-0.002909908764, 0.001413648354, 0.000677030924]] }, -{ tt:-5009.500000, ndays:26141.000000, coeff:[ +{ 'tt':-5009.500000, 'ndays':26141.000000, 'coeff':[ [23.380075041204, -38.969338804442, -19.204762094135], [33.437140696536, 8.735194448531, -7.348352917314], [-3.127251304544, 8.324311848708, 3.540122328502], @@ -947,7 +947,7 @@ const cheb = { [0.000534534110, 0.001670320887, 0.000702775941], [-0.003169380270, 0.000816186705, 0.000427213817]] }, -{ tt:21131.500000, ndays:26141.000000, coeff:[ +{ 'tt':21131.500000, 'ndays':26141.000000, 'coeff':[ [74.130449310804, 43.372111541004, -8.799489207171], [-8.705941488523, 23.344631690845, 9.908006472122], [-4.614752911564, -2.587334376729, 0.583321715294], @@ -968,7 +968,7 @@ const cheb = { [0.000132867113, 0.001741417484, 0.000743224630], [-0.003293498893, 0.000182437998, 0.000158073228]] }, -{ tt:47272.500000, ndays:26141.000000, coeff:[ +{ 'tt':47272.500000, 'ndays':26141.000000, 'coeff':[ [-5.727994625506, 71.194823351703, 23.946198176031], [-26.767323214686, -12.264949302780, 4.238297122007], [0.890596204250, -5.970227904551, -2.131444078785], diff --git a/source/python/astronomy.py b/source/python/astronomy.py index eb2f2d31..138bdeb1 100644 --- a/source/python/astronomy.py +++ b/source/python/astronomy.py @@ -954,9 +954,6 @@ def _CalcMoon(time): (_ARC * (_ERAD / _AU)) / (0.999953253 * SINPI) ) -# END CalcMoon -#---------------------------------------------------------------------------- - def GeoMoon(time): m = _CalcMoon(time) @@ -975,7 +972,7 @@ def GeoMoon(time): mpos2 = _precession(time.tt, mpos1, 0) return Vector(mpos2[0], mpos2[1], mpos2[2], time) - +# END CalcMoon #---------------------------------------------------------------------------- # BEGIN VSOP @@ -1607,4 +1604,156 @@ _vsop = [ # END VSOP #---------------------------------------------------------------------------- +# BEGIN CHEBYSHEV +_pluto = [ +{ 'tt':-109573.500000, 'ndays':26141.000000, 'coeff':[ + [-30.303124711144, -18.980368465705, 3.206649343866], + [20.092745278347, -27.533908687219, -14.641121965990], + [9.137264744925, 6.513103657467, -0.720732357468], + [-1.201554708717, 2.149917852301, 1.032022293526], + [-0.566068170022, -0.285737361191, 0.081379987808], + [0.041678527795, -0.143363105040, -0.057534475984], + [0.041087908142, 0.007911321580, -0.010270655537], + [0.001611769878, 0.011409821837, 0.003679980733], + [-0.002536458296, -0.000145632543, 0.000949924030], + [0.001167651969, -0.000049912680, 0.000115867710], + [-0.000196953286, 0.000420406270, 0.000110147171], + [0.001073825784, 0.000442658285, 0.000146985332], + [-0.000906160087, 0.001702360394, 0.000758987924], + [-0.001467464335, -0.000622191266, -0.000231866243], + [-0.000008986691, 0.000004086384, 0.000001442956], + [-0.001099078039, -0.000544633529, -0.000205534708], + [0.001259974751, -0.002178533187, -0.000965315934], + [0.001695288316, 0.000768480768, 0.000287916141], + [-0.001428026702, 0.002707551594, 0.001195955756]] +}, +{ 'tt':-83432.500000, 'ndays':26141.000000, 'coeff':[ + [67.049456204563, -9.279626603192, -23.091941092128], + [14.860676672314, 26.594121136143, 3.819668867047], + [-6.254409044120, 1.408757903538, 2.323726101433], + [0.114416381092, -0.942273228585, -0.328566335886], + [0.074973631246, 0.106749156044, 0.010806547171], + [-0.018627741964, -0.009983491157, 0.002589955906], + [0.006167206174, -0.001042430439, -0.001521881831], + [-0.000471293617, 0.002337935239, 0.001060879763], + [-0.000240627462, -0.001380351742, -0.000546042590], + [0.001872140444, 0.000679876620, 0.000240384842], + [-0.000334705177, 0.000693528330, 0.000301138309], + [0.000796124758, 0.000653183163, 0.000259527079], + [-0.001276116664, 0.001393959948, 0.000629574865], + [-0.001235158458, -0.000889985319, -0.000351392687], + [-0.000019881944, 0.000048339979, 0.000021342186], + [-0.000987113745, -0.000748420747, -0.000296503569], + [0.001721891782, -0.001893675502, -0.000854270937], + [0.001505145187, 0.001081653337, 0.000426723640], + [-0.002019479384, 0.002375617497, 0.001068258925]] +}, +{ 'tt':-57291.500000, 'ndays':26141.000000, 'coeff':[ + [46.038290912405, 73.773759757856, 9.148670950706], + [-22.354364534703, 10.217143138926, 9.921247676076], + [-2.696282001399, -4.440843715929, -0.572373037840], + [0.385475818800, -0.287872688575, -0.205914693555], + [0.020994433095, 0.004256602589, -0.004817361041], + [0.003212255378, 0.000574875698, -0.000764464370], + [-0.000158619286, -0.001035559544, -0.000535612316], + [0.000967952107, -0.000653111849, -0.000292019750], + [0.001763494906, -0.000370815938, -0.000224698363], + [0.001157990330, 0.001849810828, 0.000759641577], + [-0.000883535516, 0.000384038162, 0.000191242192], + [0.000709486562, 0.000655810827, 0.000265431131], + [-0.001525810419, 0.001126870468, 0.000520202001], + [-0.000983210860, -0.001116073455, -0.000456026382], + [-0.000015655450, 0.000069184008, 0.000029796623], + [-0.000815102021, -0.000900597010, -0.000365274209], + [0.002090300438, -0.001536778673, -0.000709827438], + [0.001234661297, 0.001342978436, 0.000545313112], + [-0.002517963678, 0.001941826791, 0.000893859860]] +}, +{ 'tt':-31150.500000, 'ndays':26141.000000, 'coeff':[ + [-39.074661990988, 30.963513412373, 21.431709298065], + [-12.033639281924, -31.693679132310, -6.263961539568], + [7.233936758611, -3.979157072767, -3.421027935569], + [1.383182539917, 1.090729793400, -0.076771771448], + [-0.009894394996, 0.313614402007, 0.101180677344], + [-0.055459383449, 0.031782406403, 0.026374448864], + [-0.011074105991, -0.007176759494, 0.001896208351], + [-0.000263363398, -0.001145329444, 0.000215471838], + [0.000405700185, -0.000839229891, -0.000418571366], + [0.001004921401, 0.001135118493, 0.000406734549], + [-0.000473938695, 0.000282751002, 0.000114911593], + [0.000528685886, 0.000966635293, 0.000401955197], + [-0.001838869845, 0.000806432189, 0.000394594478], + [-0.000713122169, -0.001334810971, -0.000554511235], + [0.000006449359, 0.000060730000, 0.000024513230], + [-0.000596025142, -0.000999492770, -0.000413930406], + [0.002364904429, -0.001099236865, -0.000528480902], + [0.000907458104, 0.001537243912, 0.000637001965], + [-0.002909908764, 0.001413648354, 0.000677030924]] +}, +{ 'tt':-5009.500000, 'ndays':26141.000000, 'coeff':[ + [23.380075041204, -38.969338804442, -19.204762094135], + [33.437140696536, 8.735194448531, -7.348352917314], + [-3.127251304544, 8.324311848708, 3.540122328502], + [-1.491354030154, -1.350371407475, 0.028214278544], + [0.361398480996, -0.118420687058, -0.145375605480], + [-0.011771350229, 0.085880588309, 0.030665997197], + [-0.015839541688, -0.014165128211, 0.000523465951], + [0.004213218926, -0.001426373728, -0.001906412496], + [0.001465150002, 0.000451513538, 0.000081936194], + [0.000640069511, 0.001886692235, 0.000884675556], + [-0.000883554940, 0.000301907356, 0.000127310183], + [0.000245524038, 0.000910362686, 0.000385555148], + [-0.001942010476, 0.000438682280, 0.000237124027], + [-0.000425455660, -0.001442138768, -0.000607751390], + [0.000004168433, 0.000033856562, 0.000013881811], + [-0.000337920193, -0.001074290356, -0.000452503056], + [0.002544755354, -0.000620356219, -0.000327246228], + [0.000534534110, 0.001670320887, 0.000702775941], + [-0.003169380270, 0.000816186705, 0.000427213817]] +}, +{ 'tt':21131.500000, 'ndays':26141.000000, 'coeff':[ + [74.130449310804, 43.372111541004, -8.799489207171], + [-8.705941488523, 23.344631690845, 9.908006472122], + [-4.614752911564, -2.587334376729, 0.583321715294], + [0.316219286624, -0.395448970181, -0.219217574801], + [0.004593734664, 0.027528474371, 0.007736197280], + [-0.001192268851, -0.004987723997, -0.001599399192], + [0.003051998429, -0.001287028653, -0.000780744058], + [0.001482572043, 0.001613554244, 0.000635747068], + [0.000581965277, 0.000788286674, 0.000315285159], + [-0.000311830730, 0.001622369930, 0.000714817617], + [-0.000711275723, -0.000160014561, -0.000050445901], + [0.000177159088, 0.001032713853, 0.000435835541], + [-0.002032280820, 0.000144281331, 0.000111910344], + [-0.000148463759, -0.001495212309, -0.000635892081], + [-0.000009629403, -0.000013678407, -0.000006187457], + [-0.000061196084, -0.001119783520, -0.000479221572], + [0.002630993795, -0.000113042927, -0.000112115452], + [0.000132867113, 0.001741417484, 0.000743224630], + [-0.003293498893, 0.000182437998, 0.000158073228]] +}, +{ 'tt':47272.500000, 'ndays':26141.000000, 'coeff':[ + [-5.727994625506, 71.194823351703, 23.946198176031], + [-26.767323214686, -12.264949302780, 4.238297122007], + [0.890596204250, -5.970227904551, -2.131444078785], + [0.808383708156, -0.143104108476, -0.288102517987], + [0.089303327519, 0.049290470655, -0.010970501667], + [0.010197195705, 0.012879721400, 0.001317586740], + [0.001795282629, 0.004482403780, 0.001563326157], + [-0.001974716105, 0.001278073933, 0.000652735133], + [0.000906544715, -0.000805502229, -0.000336200833], + [0.000283816745, 0.001799099064, 0.000756827653], + [-0.000784971304, 0.000123081220, 0.000068812133], + [-0.000237033406, 0.000980100466, 0.000427758498], + [-0.001976846386, -0.000280421081, -0.000072417045], + [0.000195628511, -0.001446079585, -0.000624011074], + [-0.000044622337, -0.000035865046, -0.000013581236], + [0.000204397832, -0.001127474894, -0.000488668673], + [0.002625373003, 0.000389300123, 0.000102756139], + [-0.000277321614, 0.001732818354, 0.000749576471], + [-0.003280537764, -0.000457571669, -0.000116383655]] +}] + +# END CHEBYSHEV +#----------------------------------------------------------------------------