From 3f6105373944216787883a9e87b18a6f51803406 Mon Sep 17 00:00:00 2001 From: David Minton Date: Mon, 13 Sep 2021 17:11:36 -0400 Subject: [PATCH] Fixed initial conditions generator --- .../8pl_16tp_encounters/cb.in | 4 +- .../8pl_16tp_encounters/cb.swiftest.in | 4 +- .../8pl_16tp_encounters/init_cond.py | 20 ++-- .../8pl_16tp_encounters/param.swifter.in | 6 +- .../8pl_16tp_encounters/param.swiftest.in | 9 +- .../8pl_16tp_encounters/pl.in | 48 +++++----- .../8pl_16tp_encounters/pl.swifter.in | 50 +++++----- .../8pl_16tp_encounters/pl.swiftest.in | 48 +++++----- .../8pl_16tp_encounters/tp.in | 96 +++++++++---------- .../8pl_16tp_encounters/tp.swifter.in | 49 ++++++++++ .../8pl_16tp_encounters/tp.swiftest.in | 49 ++++++++++ python/swiftest/swiftest/init_cond.py | 32 +------ 12 files changed, 249 insertions(+), 166 deletions(-) create mode 100644 examples/symba_swifter_comparison/8pl_16tp_encounters/tp.swifter.in create mode 100644 examples/symba_swifter_comparison/8pl_16tp_encounters/tp.swiftest.in diff --git a/examples/symba_swifter_comparison/8pl_16tp_encounters/cb.in b/examples/symba_swifter_comparison/8pl_16tp_encounters/cb.in index 81c636655..01c5fb3dd 100644 --- a/examples/symba_swifter_comparison/8pl_16tp_encounters/cb.in +++ b/examples/symba_swifter_comparison/8pl_16tp_encounters/cb.in @@ -1,5 +1,5 @@ -0 -0.00029591220819207774 +Sun +0.0002959122081920778 0.004650467260962157 4.7535806948127355e-12 -2.2473967953572827e-18 diff --git a/examples/symba_swifter_comparison/8pl_16tp_encounters/cb.swiftest.in b/examples/symba_swifter_comparison/8pl_16tp_encounters/cb.swiftest.in index 81c636655..01c5fb3dd 100644 --- a/examples/symba_swifter_comparison/8pl_16tp_encounters/cb.swiftest.in +++ b/examples/symba_swifter_comparison/8pl_16tp_encounters/cb.swiftest.in @@ -1,5 +1,5 @@ -0 -0.00029591220819207774 +Sun +0.0002959122081920778 0.004650467260962157 4.7535806948127355e-12 -2.2473967953572827e-18 diff --git a/examples/symba_swifter_comparison/8pl_16tp_encounters/init_cond.py b/examples/symba_swifter_comparison/8pl_16tp_encounters/init_cond.py index 7ab52fd23..425ea1b73 100755 --- a/examples/symba_swifter_comparison/8pl_16tp_encounters/init_cond.py +++ b/examples/symba_swifter_comparison/8pl_16tp_encounters/init_cond.py @@ -11,11 +11,13 @@ swifter_input = "param.swifter.in" swifter_pl = "pl.swifter.in" +swifter_tp = "tp.swifter.in" swifter_bin = "bin.swifter.dat" swifter_enc = "enc.swifter.dat" swiftest_input = "param.swiftest.in" swiftest_pl = "pl.swiftest.in" +swiftest_tp = "tp.swiftest.in" swiftest_cb = "cb.swiftest.in" swiftest_bin = "bin.swiftest.dat" swiftest_enc = "enc.swiftest.dat" @@ -34,12 +36,12 @@ sim.param['CHK_RMIN'] = swiftest.RSun / swiftest.AU2M sim.param['CHK_RMAX'] = 1000.0 sim.param['CHK_EJECT'] = 1000.0 -sim.param['OUT_FORM'] = "XV" sim.param['OUT_STAT'] = "UNKNOWN" sim.param['GR'] = 'NO' sim.param['CHK_CLOSE'] = 'YES' sim.param['RHILL_PRESENT'] = 'YES' sim.param['GMTINY'] = 1.0e-12 +sim.param['IN_FORM'] = 'XV' sim.param['MU2KG'] = swiftest.MSun sim.param['TU2S'] = swiftest.JD2S @@ -69,10 +71,14 @@ dims = ['time', 'id', 'vec'] tp = [] t = np.array([0.0]) +sim.param['OUT_FORM'] = "XV" clab, plab, tlab = swio.make_swiftest_labels(sim.param) # For each planet, we will initialize a pair of test particles. One on its way in, and one on its way out. We will also initialize two additional particles that don't encounter anything -tpnames = np.arange(101, 101 + ntp) +tpidlist = np.arange(9,9+ntp) +tpnames = [] +for i in tpidlist: + tpnames.append(f"SmallBody{i+1:0.4g}") tpxv1 = np.empty((6)) tpxv2 = np.empty((6)) @@ -86,7 +92,7 @@ for i in pl.id: pli = pl.sel(id=i) rstart = 2 * np.double(pli['radius']) # Start the test particles at a multiple of the planet radius away - vstart = 1.5 * np.sqrt(2 * np.double(pli['Mass']) / rstart) # Start the test particle velocities at a multiple of the escape speed + vstart = 1.5 * np.sqrt(2 * np.double(pli['Gmass']) / rstart) # Start the test particle velocities at a multiple of the escape speed xvstart = np.array([rstart / np.sqrt(2.0), rstart / np.sqrt(2.0), 0.0, vstart, 0.0, 0.0]) # The positions and velocities of each pair of test particles will be in reference to a planet plvec = np.array([np.double(pli['xhx']), @@ -110,9 +116,11 @@ p6.append(tpxv1[5]) p6.append(tpxv2[5]) + tvec = np.vstack([p1, p2, p3, p4, p5, p6]) tpframe = np.expand_dims(tvec.T, axis=0) -tpxr = xr.DataArray(tpframe, dims = dims, coords = {'time' : t, 'id' : tpnames, 'vec' : tlab}) +tpxr = xr.DataArray(tpframe, dims = dims, coords = {'time' : t, 'id' : tpidlist, 'vec' : tlab}) +tpxr = tpxr.assign_coords(name=('id', tpnames)) tp = [tpxr] tpda = xr.concat(tp,dim='time') @@ -122,7 +130,7 @@ swio.swiftest_xr2infile(sim.ds, sim.param) sim.param['PL_IN'] = swiftest_pl -sim.param['TP_IN'] = tpin +sim.param['TP_IN'] = swiftest_tp sim.param['CB_IN'] = swiftest_cb sim.param['BIN_OUT'] = swiftest_bin sim.param['ENC_OUT'] = swiftest_enc @@ -130,7 +138,7 @@ sim.save(swiftest_input) sim.param['PL_IN'] = swifter_pl -sim.param['TP_IN'] = tpin +sim.param['TP_IN'] = swifter_tp sim.param['BIN_OUT'] = swifter_bin sim.param['ENC_OUT'] = swifter_enc sim.save(swifter_input, codename="Swifter") diff --git a/examples/symba_swifter_comparison/8pl_16tp_encounters/param.swifter.in b/examples/symba_swifter_comparison/8pl_16tp_encounters/param.swifter.in index d87472e35..b8731386b 100644 --- a/examples/symba_swifter_comparison/8pl_16tp_encounters/param.swifter.in +++ b/examples/symba_swifter_comparison/8pl_16tp_encounters/param.swifter.in @@ -5,19 +5,19 @@ DT 1.0 ISTEP_OUT 11 ISTEP_DUMP 1 OUT_FORM XV -OUT_TYPE REAL8 +OUT_TYPE NETCDF_DOUBLE OUT_STAT UNKNOWN IN_TYPE ASCII PL_IN pl.swifter.in -TP_IN tp.in +TP_IN tp.swifter.in BIN_OUT bin.swifter.dat -ENC_OUT enc.swifter.dat CHK_QMIN 0.004650467260962157 CHK_RMIN 0.004650467260962157 CHK_RMAX 1000.0 CHK_EJECT 1000.0 CHK_QMIN_COORD HELIO CHK_QMIN_RANGE 0.004650467260962157 1000.0 +ENC_OUT enc.swifter.dat EXTRA_FORCE NO BIG_DISCARD NO CHK_CLOSE YES diff --git a/examples/symba_swifter_comparison/8pl_16tp_encounters/param.swiftest.in b/examples/symba_swifter_comparison/8pl_16tp_encounters/param.swiftest.in index f26f33592..bca11da6d 100644 --- a/examples/symba_swifter_comparison/8pl_16tp_encounters/param.swiftest.in +++ b/examples/symba_swifter_comparison/8pl_16tp_encounters/param.swiftest.in @@ -5,15 +5,13 @@ DT 1.0 ISTEP_OUT 11 ISTEP_DUMP 1 OUT_FORM XV -OUT_TYPE REAL8 +OUT_TYPE NETCDF_DOUBLE OUT_STAT UNKNOWN IN_TYPE ASCII PL_IN pl.swiftest.in -TP_IN tp.in +TP_IN tp.swiftest.in CB_IN cb.swiftest.in BIN_OUT bin.swiftest.dat -ENC_OUT enc.swiftest.dat -DISCARD_OUT discard.swiftest.dat CHK_QMIN 0.004650467260962157 CHK_RMIN 0.004650467260962157 CHK_RMAX 1000.0 @@ -23,7 +21,10 @@ CHK_QMIN_RANGE 0.004650467260962157 1000.0 MU2KG 1.988409870698051e+30 TU2S 86400 DU2M 149597870700.0 +IN_FORM XV +ENC_OUT enc.swiftest.dat EXTRA_FORCE NO +DISCARD_OUT discard.swiftest.dat BIG_DISCARD NO CHK_CLOSE YES RHILL_PRESENT YES diff --git a/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.in b/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.in index 207dd84f6..72b1baa3b 100644 --- a/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.in +++ b/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.in @@ -1,33 +1,33 @@ 8 -1 4.9125474498983623693e-11 0.001475124456355905224 +Mercury 4.9125474498983625056e-11 0.0014751323154597007903 1.6306381826061645943e-05 --0.30949970210807342674 0.1619004125820537876 0.041620272188990829754 --0.018820805516945871005 -0.023743802865467341506 -0.00021385162925667799668 -2 7.243452483873646905e-10 0.006759069616556246028 +0.053584775529809842987 -0.4548355025417368247 -0.04208301187261995896 +0.022298358665237189014 0.0047355207618514265702 -0.0016584224113858070382 +Venus 7.243452483873647106e-10 0.0067590814914530454873 4.0453784346544178454e-05 --0.5567137338251560985 -0.46074173273652380134 0.02580196630219121906 -0.012753121506668980284 -0.015678149412530151263 -0.0009510907726656827677 -3 8.9970113821660187435e-10 0.010044908171483009529 +0.12681182092868958922 -0.7161485778943049718 -0.017146261752773749032 +0.01978070713081106144 0.0034557070729633850362 -0.00109402215681010293 +Earth 8.997011382166018993e-10 0.010044922299157372164 4.25875607065040958e-05 -0.6978790186886838498 -0.73607603319120218366 3.261671020506711323e-05 -0.012205130808798069983 0.0117727888369263504476 -6.0385404652521189453e-07 -4 9.549535102761465607e-11 0.0072466797341124641736 +0.9913796310092216624 -0.17236385208280941006 4.574442303609438109e-06 +0.0026673818939059660942 0.016885702625202340249 -8.2074388361713082097e-07 +Mars 9.549535102761465872e-11 0.007246507286611460043 2.265740805092889601e-05 --1.617661473167097963 0.38314370807747849534 0.04771055403546069218 --0.0027036789764029569086 -0.012421968497550240837 -0.00019400613558421780209 -5 2.825345908631354893e-07 0.35527079166215922855 +-1.6436878725691590475 -0.09931688681832298582 0.038237939117251117105 +0.0013642455487206960919 -0.0127728951275482699446 -0.00030115173687901287654 +Jupiter 2.8253459086313549713e-07 0.3552710784524730732 0.00046732617030490929307 -4.1527454588897487753 -2.8347492039446908763 -0.081136554176388195336 -0.0041683967523185880624 0.0065946899141205552256 -0.00012065009272080269359 -6 8.459715183006415395e-08 0.43765832419088212185 +4.304060110247122317 -2.579516473452256875 -0.08558202993848706974 +0.003792902202341501966 0.0068350794283332117623 -0.00011324814038141340017 +Saturn 8.45971518300641563e-08 0.4376659135625219704 0.00038925687730393611812 -6.39471595410062843 -7.621162747287802297 -0.121992225877669294154 -0.0039680130835247464163 0.0035798698934692090544 -0.00022010758050265331019 -7 1.2920249163736673626e-08 0.46960112247450473807 +6.54409134618183419 -7.483470470167333133 -0.1303290586096018111 +0.003893524262024787054 0.0036668581511023591937 -0.00021865564058601801348 +Uranus 1.2920249163736673984e-08 0.46971473227488383167 0.00016953449859497231466 -14.793135356927480828 13.074218343364380601 -0.14311846037737518955 --0.0026297294662822792016 0.0027702756265410048361 4.4212949669357180555e-05 -8 1.5243589003230834323e-08 0.78136567314580814177 +14.692788408572690528 13.179130291284799625 -0.14143429698462339772 +-0.0026516826407085368304 0.0027513763836455209892 4.4427867883713361775e-05 +Neptune 1.5243589003230834746e-08 0.78149679568494038567 0.000164587904124493665 -29.568629894896030663 -4.5543028991960081697 -0.58771107137394917874 -0.00046181040300440859715 0.0031288137434451902125 -7.498349850432879627e-05 +29.58593540166936009 -4.435365846939811618 -0.5905556302070252839 +0.0004489890080502080224 0.003131021601122137201 -7.4728898269552307757e-05 diff --git a/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.swifter.in b/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.swifter.in index 3179473c0..c0567724d 100644 --- a/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.swifter.in +++ b/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.swifter.in @@ -1,36 +1,36 @@ 9 -0 0.00029591220819207775568 +0 0.0002959122081920778 0.0 0.0 0.0 0.0 0.0 0.0 -1 4.9125474498983623693e-11 0.001475124456355905224 +1 4.9125474498983625056e-11 0.0014751323154597007903 1.6306381826061645943e-05 --0.30949970210807342674 0.1619004125820537876 0.041620272188990829754 --0.018820805516945871005 -0.023743802865467341506 -0.00021385162925667799668 -2 7.243452483873646905e-10 0.006759069616556246028 +0.053584775529809842987 -0.4548355025417368247 -0.04208301187261995896 +0.022298358665237189014 0.0047355207618514265702 -0.0016584224113858070382 +2 7.243452483873647106e-10 0.0067590814914530454873 4.0453784346544178454e-05 --0.5567137338251560985 -0.46074173273652380134 0.02580196630219121906 -0.012753121506668980284 -0.015678149412530151263 -0.0009510907726656827677 -3 8.9970113821660187435e-10 0.010044908171483009529 +0.12681182092868958922 -0.7161485778943049718 -0.017146261752773749032 +0.01978070713081106144 0.0034557070729633850362 -0.00109402215681010293 +3 8.997011382166018993e-10 0.010044922299157372164 4.25875607065040958e-05 -0.6978790186886838498 -0.73607603319120218366 3.261671020506711323e-05 -0.012205130808798069983 0.0117727888369263504476 -6.0385404652521189453e-07 -4 9.549535102761465607e-11 0.0072466797341124641736 +0.9913796310092216624 -0.17236385208280941006 4.574442303609438109e-06 +0.0026673818939059660942 0.016885702625202340249 -8.2074388361713082097e-07 +4 9.549535102761465872e-11 0.007246507286611460043 2.265740805092889601e-05 --1.617661473167097963 0.38314370807747849534 0.04771055403546069218 --0.0027036789764029569086 -0.012421968497550240837 -0.00019400613558421780209 -5 2.825345908631354893e-07 0.35527079166215922855 +-1.6436878725691590475 -0.09931688681832298582 0.038237939117251117105 +0.0013642455487206960919 -0.0127728951275482699446 -0.00030115173687901287654 +5 2.8253459086313549713e-07 0.3552710784524730732 0.00046732617030490929307 -4.1527454588897487753 -2.8347492039446908763 -0.081136554176388195336 -0.0041683967523185880624 0.0065946899141205552256 -0.00012065009272080269359 -6 8.459715183006415395e-08 0.43765832419088212185 +4.304060110247122317 -2.579516473452256875 -0.08558202993848706974 +0.003792902202341501966 0.0068350794283332117623 -0.00011324814038141340017 +6 8.45971518300641563e-08 0.4376659135625219704 0.00038925687730393611812 -6.39471595410062843 -7.621162747287802297 -0.121992225877669294154 -0.0039680130835247464163 0.0035798698934692090544 -0.00022010758050265331019 -7 1.2920249163736673626e-08 0.46960112247450473807 +6.54409134618183419 -7.483470470167333133 -0.1303290586096018111 +0.003893524262024787054 0.0036668581511023591937 -0.00021865564058601801348 +7 1.2920249163736673984e-08 0.46971473227488383167 0.00016953449859497231466 -14.793135356927480828 13.074218343364380601 -0.14311846037737518955 --0.0026297294662822792016 0.0027702756265410048361 4.4212949669357180555e-05 -8 1.5243589003230834323e-08 0.78136567314580814177 +14.692788408572690528 13.179130291284799625 -0.14143429698462339772 +-0.0026516826407085368304 0.0027513763836455209892 4.4427867883713361775e-05 +8 1.5243589003230834746e-08 0.78149679568494038567 0.000164587904124493665 -29.568629894896030663 -4.5543028991960081697 -0.58771107137394917874 -0.00046181040300440859715 0.0031288137434451902125 -7.498349850432879627e-05 +29.58593540166936009 -4.435365846939811618 -0.5905556302070252839 +0.0004489890080502080224 0.003131021601122137201 -7.4728898269552307757e-05 diff --git a/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.swiftest.in b/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.swiftest.in index 207dd84f6..72b1baa3b 100644 --- a/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.swiftest.in +++ b/examples/symba_swifter_comparison/8pl_16tp_encounters/pl.swiftest.in @@ -1,33 +1,33 @@ 8 -1 4.9125474498983623693e-11 0.001475124456355905224 +Mercury 4.9125474498983625056e-11 0.0014751323154597007903 1.6306381826061645943e-05 --0.30949970210807342674 0.1619004125820537876 0.041620272188990829754 --0.018820805516945871005 -0.023743802865467341506 -0.00021385162925667799668 -2 7.243452483873646905e-10 0.006759069616556246028 +0.053584775529809842987 -0.4548355025417368247 -0.04208301187261995896 +0.022298358665237189014 0.0047355207618514265702 -0.0016584224113858070382 +Venus 7.243452483873647106e-10 0.0067590814914530454873 4.0453784346544178454e-05 --0.5567137338251560985 -0.46074173273652380134 0.02580196630219121906 -0.012753121506668980284 -0.015678149412530151263 -0.0009510907726656827677 -3 8.9970113821660187435e-10 0.010044908171483009529 +0.12681182092868958922 -0.7161485778943049718 -0.017146261752773749032 +0.01978070713081106144 0.0034557070729633850362 -0.00109402215681010293 +Earth 8.997011382166018993e-10 0.010044922299157372164 4.25875607065040958e-05 -0.6978790186886838498 -0.73607603319120218366 3.261671020506711323e-05 -0.012205130808798069983 0.0117727888369263504476 -6.0385404652521189453e-07 -4 9.549535102761465607e-11 0.0072466797341124641736 +0.9913796310092216624 -0.17236385208280941006 4.574442303609438109e-06 +0.0026673818939059660942 0.016885702625202340249 -8.2074388361713082097e-07 +Mars 9.549535102761465872e-11 0.007246507286611460043 2.265740805092889601e-05 --1.617661473167097963 0.38314370807747849534 0.04771055403546069218 --0.0027036789764029569086 -0.012421968497550240837 -0.00019400613558421780209 -5 2.825345908631354893e-07 0.35527079166215922855 +-1.6436878725691590475 -0.09931688681832298582 0.038237939117251117105 +0.0013642455487206960919 -0.0127728951275482699446 -0.00030115173687901287654 +Jupiter 2.8253459086313549713e-07 0.3552710784524730732 0.00046732617030490929307 -4.1527454588897487753 -2.8347492039446908763 -0.081136554176388195336 -0.0041683967523185880624 0.0065946899141205552256 -0.00012065009272080269359 -6 8.459715183006415395e-08 0.43765832419088212185 +4.304060110247122317 -2.579516473452256875 -0.08558202993848706974 +0.003792902202341501966 0.0068350794283332117623 -0.00011324814038141340017 +Saturn 8.45971518300641563e-08 0.4376659135625219704 0.00038925687730393611812 -6.39471595410062843 -7.621162747287802297 -0.121992225877669294154 -0.0039680130835247464163 0.0035798698934692090544 -0.00022010758050265331019 -7 1.2920249163736673626e-08 0.46960112247450473807 +6.54409134618183419 -7.483470470167333133 -0.1303290586096018111 +0.003893524262024787054 0.0036668581511023591937 -0.00021865564058601801348 +Uranus 1.2920249163736673984e-08 0.46971473227488383167 0.00016953449859497231466 -14.793135356927480828 13.074218343364380601 -0.14311846037737518955 --0.0026297294662822792016 0.0027702756265410048361 4.4212949669357180555e-05 -8 1.5243589003230834323e-08 0.78136567314580814177 +14.692788408572690528 13.179130291284799625 -0.14143429698462339772 +-0.0026516826407085368304 0.0027513763836455209892 4.4427867883713361775e-05 +Neptune 1.5243589003230834746e-08 0.78149679568494038567 0.000164587904124493665 -29.568629894896030663 -4.5543028991960081697 -0.58771107137394917874 -0.00046181040300440859715 0.0031288137434451902125 -7.498349850432879627e-05 +29.58593540166936009 -4.435365846939811618 -0.5905556302070252839 +0.0004489890080502080224 0.003131021601122137201 -7.4728898269552307757e-05 diff --git a/examples/symba_swifter_comparison/8pl_16tp_encounters/tp.in b/examples/symba_swifter_comparison/8pl_16tp_encounters/tp.in index c1e239467..25ae7ab30 100644 --- a/examples/symba_swifter_comparison/8pl_16tp_encounters/tp.in +++ b/examples/symba_swifter_comparison/8pl_16tp_encounters/tp.in @@ -1,49 +1,49 @@ 16 -101 --0.30947664140174180325 0.16192347328838543885 0.041620272188990829754 --0.01621725604493672035 -0.023743802865467341506 -0.00021385162925667799668 -102 --0.30952276281440505024 0.16187735187572213635 0.041620272188990829754 --0.021424354988955021661 -0.023743802865467341506 -0.00021385162925667799668 -103 --0.55665652353468386693 -0.46068452244605162527 0.02580196630219121906 -0.019100355212014374223 -0.015678149412530151263 -0.0009510907726656827677 -104 --0.5567709441156283301 -0.4607989430269959774 0.02580196630219121906 -0.0064058878013235863447 -0.015678149412530151263 -0.0009510907726656827677 -105 -0.6979392465946233637 -0.7360158052852626698 3.261671020506711323e-05 -0.019099571043071944532 0.0117727888369263504476 -6.0385404652521189453e-07 -106 -0.6978187907827443359 -0.73613626109714169754 3.261671020506711323e-05 -0.005310690574524194567 0.0117727888369263504476 -6.0385404652521189453e-07 -107 --1.6176294307533440886 0.38317575049123231423 0.04771055403546069218 -0.00037580012182093606998 -0.012421968497550240837 -0.00019400613558421780209 -108 --1.6176935155808518374 0.38311166566372467646 0.04771055403546069218 --0.005783158074626849887 -0.012421968497550240837 -0.00019400613558421780209 -109 -4.1534063578978459574 -2.834088304936593694 -0.081136554176388195336 -0.041050613953966016978 0.0065946899141205552256 -0.00012065009272080269359 -110 -4.152084559881651593 -2.8354101029527880584 -0.081136554176388195336 --0.032713820449328842588 0.0065946899141205552256 -0.00012065009272080269359 -111 -6.395266446455758924 -7.620612254932671803 -0.121992225877669294154 -0.026081181967058334609 0.0035798698934692090544 -0.00022010758050265331019 -112 -6.394165461745497936 -7.621713239642932791 -0.121992225877669294154 --0.01814515580000884351 0.0035798698934692090544 -0.00022010758050265331019 -113 -14.793375114914683266 13.074458101351583039 -0.14311846037737518955 -0.0104650340723796142495 0.0027702756265410048361 4.4212949669357180555e-05 -114 -14.79289559894027839 13.073978585377178163 -0.14311846037737518955 --0.015724493004944172653 0.0027702756265410048361 4.4212949669357180555e-05 -115 -29.568862657342247502 -4.5540701367497931074 -0.58771107137394917874 -0.0148974462162825404404 0.0031288137434451902125 -7.498349850432879627e-05 -116 -29.568397132449813824 -4.554535661642223232 -0.58771107137394917874 --0.013973825410273721728 0.0031288137434451902125 -7.498349850432879627e-05 +SmallBody10 +0.053607836236141494235 -0.4548124418354052012 -0.04208301187261995896 +0.02490190813724633967 0.0047355207618514265702 -0.0016584224113858070382 +SmallBody11 +0.053561714823478191738 -0.4548585632480684482 -0.04208301187261995896 +0.019694809193228038358 0.0047355207618514265702 -0.0016584224113858070382 +SmallBody12 +0.12686903121916179304 -0.71609136760383274023 -0.017146261752773749032 +0.026127940836156455379 0.0034557070729633850362 -0.00109402215681010293 +SmallBody13 +0.12675461063821738539 -0.7162057881847772034 -0.017146261752773749032 +0.0134334734254656675 0.0034557070729633850362 -0.00109402215681010293 +SmallBody14 +0.99143985891516117626 -0.17230362417686989618 4.574442303609438109e-06 +0.0095618221281798410766 0.016885702625202340249 -8.2074388361713082097e-07 +SmallBody15 +0.9913194031032821485 -0.17242407998874892394 4.574442303609438109e-06 +-0.0042270583403679097556 0.016885702625202340249 -8.2074388361713082097e-07 +SmallBody16 +-1.6436558301554051731 -0.099284844404569139176 0.038237939117251117105 +0.004443724646944589504 -0.0127728951275482699446 -0.00030115173687901287654 +SmallBody17 +-1.6437199149829129219 -0.09934892923207683246 0.038237939117251117105 +-0.0017152335495031968866 -0.0127728951275482699446 -0.00030115173687901287654 +SmallBody18 +4.3047210092552194993 -2.5788555744441596929 -0.08558202993848706974 +0.04067511940398893522 0.0068350794283332117623 -0.00011324814038141340017 +SmallBody19 +4.303399211239025135 -2.5801773724603540572 -0.08558202993848706974 +-0.033089314999305924347 0.0068350794283332117623 -0.00011324814038141340017 +SmallBody20 +6.544641838536964684 -7.4829199778122026387 -0.1303290586096018111 +0.026006693145558375246 0.0036668581511023591937 -0.00021865564058601801348 +SmallBody21 +6.543540853826703696 -7.484020962522463627 -0.1303290586096018111 +-0.018219644621508802873 0.0036668581511023591937 -0.00021865564058601801348 +SmallBody22 +14.693028166559892966 13.179370049272002063 -0.14143429698462339772 +0.010443080897953356187 0.0027513763836455209892 4.4427867883713361775e-05 +SmallBody23 +14.69254865058548809 13.178890533297597187 -0.14143429698462339772 +-0.01574644617937042898 0.0027513763836455209892 4.4427867883713361775e-05 +SmallBody24 +29.586168164115576928 -4.435133084493596556 -0.5905556302070252839 +0.014884624821328339486 0.003131021601122137201 -7.4728898269552307757e-05 +SmallBody25 +29.585702639223143251 -4.4355986093860266806 -0.5905556302070252839 +-0.0139866468052279226825 0.003131021601122137201 -7.4728898269552307757e-05 diff --git a/examples/symba_swifter_comparison/8pl_16tp_encounters/tp.swifter.in b/examples/symba_swifter_comparison/8pl_16tp_encounters/tp.swifter.in new file mode 100644 index 000000000..672ab5bf6 --- /dev/null +++ b/examples/symba_swifter_comparison/8pl_16tp_encounters/tp.swifter.in @@ -0,0 +1,49 @@ +16 +9 +0.053607836236141494235 -0.4548124418354052012 -0.04208301187261995896 +0.02490190813724633967 0.0047355207618514265702 -0.0016584224113858070382 +10 +0.053561714823478191738 -0.4548585632480684482 -0.04208301187261995896 +0.019694809193228038358 0.0047355207618514265702 -0.0016584224113858070382 +11 +0.12686903121916179304 -0.71609136760383274023 -0.017146261752773749032 +0.026127940836156455379 0.0034557070729633850362 -0.00109402215681010293 +12 +0.12675461063821738539 -0.7162057881847772034 -0.017146261752773749032 +0.0134334734254656675 0.0034557070729633850362 -0.00109402215681010293 +13 +0.99143985891516117626 -0.17230362417686989618 4.574442303609438109e-06 +0.0095618221281798410766 0.016885702625202340249 -8.2074388361713082097e-07 +14 +0.9913194031032821485 -0.17242407998874892394 4.574442303609438109e-06 +-0.0042270583403679097556 0.016885702625202340249 -8.2074388361713082097e-07 +15 +-1.6436558301554051731 -0.099284844404569139176 0.038237939117251117105 +0.004443724646944589504 -0.0127728951275482699446 -0.00030115173687901287654 +16 +-1.6437199149829129219 -0.09934892923207683246 0.038237939117251117105 +-0.0017152335495031968866 -0.0127728951275482699446 -0.00030115173687901287654 +17 +4.3047210092552194993 -2.5788555744441596929 -0.08558202993848706974 +0.04067511940398893522 0.0068350794283332117623 -0.00011324814038141340017 +18 +4.303399211239025135 -2.5801773724603540572 -0.08558202993848706974 +-0.033089314999305924347 0.0068350794283332117623 -0.00011324814038141340017 +19 +6.544641838536964684 -7.4829199778122026387 -0.1303290586096018111 +0.026006693145558375246 0.0036668581511023591937 -0.00021865564058601801348 +20 +6.543540853826703696 -7.484020962522463627 -0.1303290586096018111 +-0.018219644621508802873 0.0036668581511023591937 -0.00021865564058601801348 +21 +14.693028166559892966 13.179370049272002063 -0.14143429698462339772 +0.010443080897953356187 0.0027513763836455209892 4.4427867883713361775e-05 +22 +14.69254865058548809 13.178890533297597187 -0.14143429698462339772 +-0.01574644617937042898 0.0027513763836455209892 4.4427867883713361775e-05 +23 +29.586168164115576928 -4.435133084493596556 -0.5905556302070252839 +0.014884624821328339486 0.003131021601122137201 -7.4728898269552307757e-05 +24 +29.585702639223143251 -4.4355986093860266806 -0.5905556302070252839 +-0.0139866468052279226825 0.003131021601122137201 -7.4728898269552307757e-05 diff --git a/examples/symba_swifter_comparison/8pl_16tp_encounters/tp.swiftest.in b/examples/symba_swifter_comparison/8pl_16tp_encounters/tp.swiftest.in new file mode 100644 index 000000000..25ae7ab30 --- /dev/null +++ b/examples/symba_swifter_comparison/8pl_16tp_encounters/tp.swiftest.in @@ -0,0 +1,49 @@ +16 +SmallBody10 +0.053607836236141494235 -0.4548124418354052012 -0.04208301187261995896 +0.02490190813724633967 0.0047355207618514265702 -0.0016584224113858070382 +SmallBody11 +0.053561714823478191738 -0.4548585632480684482 -0.04208301187261995896 +0.019694809193228038358 0.0047355207618514265702 -0.0016584224113858070382 +SmallBody12 +0.12686903121916179304 -0.71609136760383274023 -0.017146261752773749032 +0.026127940836156455379 0.0034557070729633850362 -0.00109402215681010293 +SmallBody13 +0.12675461063821738539 -0.7162057881847772034 -0.017146261752773749032 +0.0134334734254656675 0.0034557070729633850362 -0.00109402215681010293 +SmallBody14 +0.99143985891516117626 -0.17230362417686989618 4.574442303609438109e-06 +0.0095618221281798410766 0.016885702625202340249 -8.2074388361713082097e-07 +SmallBody15 +0.9913194031032821485 -0.17242407998874892394 4.574442303609438109e-06 +-0.0042270583403679097556 0.016885702625202340249 -8.2074388361713082097e-07 +SmallBody16 +-1.6436558301554051731 -0.099284844404569139176 0.038237939117251117105 +0.004443724646944589504 -0.0127728951275482699446 -0.00030115173687901287654 +SmallBody17 +-1.6437199149829129219 -0.09934892923207683246 0.038237939117251117105 +-0.0017152335495031968866 -0.0127728951275482699446 -0.00030115173687901287654 +SmallBody18 +4.3047210092552194993 -2.5788555744441596929 -0.08558202993848706974 +0.04067511940398893522 0.0068350794283332117623 -0.00011324814038141340017 +SmallBody19 +4.303399211239025135 -2.5801773724603540572 -0.08558202993848706974 +-0.033089314999305924347 0.0068350794283332117623 -0.00011324814038141340017 +SmallBody20 +6.544641838536964684 -7.4829199778122026387 -0.1303290586096018111 +0.026006693145558375246 0.0036668581511023591937 -0.00021865564058601801348 +SmallBody21 +6.543540853826703696 -7.484020962522463627 -0.1303290586096018111 +-0.018219644621508802873 0.0036668581511023591937 -0.00021865564058601801348 +SmallBody22 +14.693028166559892966 13.179370049272002063 -0.14143429698462339772 +0.010443080897953356187 0.0027513763836455209892 4.4427867883713361775e-05 +SmallBody23 +14.69254865058548809 13.178890533297597187 -0.14143429698462339772 +-0.01574644617937042898 0.0027513763836455209892 4.4427867883713361775e-05 +SmallBody24 +29.586168164115576928 -4.435133084493596556 -0.5905556302070252839 +0.014884624821328339486 0.003131021601122137201 -7.4728898269552307757e-05 +SmallBody25 +29.585702639223143251 -4.4355986093860266806 -0.5905556302070252839 +-0.0139866468052279226825 0.003131021601122137201 -7.4728898269552307757e-05 diff --git a/python/swiftest/swiftest/init_cond.py b/python/swiftest/swiftest/init_cond.py index 12f0ef6ed..9ada311d9 100644 --- a/python/swiftest/swiftest/init_cond.py +++ b/python/swiftest/swiftest/init_cond.py @@ -129,35 +129,10 @@ def solar_system_horizons(plname, idval, param, ephemerides_start_date, ds): tend = tstart + tstep ephemerides_end_date = tend.isoformat() ephemerides_step = '1d' - + + param_tmp = param + param_tmp['OUT_FORM'] = 'XVEL' clab, plab, tlab = swiftest.io.make_swiftest_labels(param) - # Add the missing labels - if param['OUT_FORM'] == 'XV': - plab.append('a') - plab.append('e') - plab.append('inc') - plab.append('capom') - plab.append('omega') - plab.append('capm') - tlab.append('a') - tlab.append('e') - tlab.append('inc') - tlab.append('capom') - tlab.append('omega') - tlab.append('capm') - elif param['OUT_FORM'] == 'EL': - plab.append('xhx') - plab.append('xhy') - plab.append('xhz') - plab.append('vhx') - plab.append('vhy') - plab.append('vhz') - tlab.append('xhx') - tlab.append('xhy') - tlab.append('xhz') - tlab.append('vhx') - tlab.append('vhy') - tlab.append('vhz') dims = ['time', 'id', 'vec'] t = np.array([0.0]) @@ -208,6 +183,7 @@ def solar_system_horizons(plname, idval, param, ephemerides_start_date, ds): pldata[key] = Horizons(id=key, id_type='smallbody', location='@sun', epochs={'start': ephemerides_start_date, 'stop': ephemerides_end_date, 'step': ephemerides_step}) + if (param['OUT_FORM'] == 'XV' or param['OUT_FORM'] == 'XVEL'): p1.append(pldata[key].vectors()['x'][0] * DCONV) p2.append(pldata[key].vectors()['y'][0] * DCONV)