Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Updated examples with new Python module structure
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jun 29, 2021
1 parent fb340b1 commit 04275a1
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 226 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import swiftest.swiftestio as swio
import swiftest.io as swio
import astropy.constants as const
import sys
import xarray as xr
Expand Down Expand Up @@ -43,7 +43,7 @@
rmax = 1000.0

sys.stdout = open(swiftest_input, "w")
print(f'! Swiftest input file generated using init_cond.py')
print(f'! VERSION Swiftest input file generated using init_cond.py')
print(f'T0 {t_0} ')
print(f'TSTOP {end_sim}')
print(f'DT {deltaT}')
Expand Down Expand Up @@ -136,7 +136,7 @@
tpds = tpda.to_dataset(dim = 'vec')

ds = xr.combine_by_coords([ds, tpds])
swio.swiftest_xr2_infile(ds, param)
swio.swiftest_xr2infile(ds, param)

# Swifter PL file
plfile = open(swifter_pl, 'w')
Expand All @@ -154,7 +154,7 @@

# Swifter parameter file
sys.stdout = open(swifter_input, "w")
print(f"! Swifter input file generated using init_cond.py")
print(f"! VERSION Swifter input file generated using init_cond.py")
print(f"T0 {t_0} ")
print(f"TSTOP {end_sim}")
print(f"DT {deltaT}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! Swiftest input file generated using init_cond.py
! VERSION Swiftest input file generated using init_cond.py
T0 0
TSTOP 365.25
DT 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@
0.0 0.0 0.0
0.0 0.0 0.0
1 4.9125474498983625e-11 0.0014751258227142052
2439400.0
1.6306381826061646e-05
0.008059842448018334 -0.4616051037329109 -0.03846017738329229
0.02248719132054853 0.001934639213990692 -0.001904656977422976
2 7.243452483873647e-10 0.006759134232034941
6051800.0
4.0453784346544176e-05
-0.5115875215389065 0.5030818749037324 0.03642547299277956
-0.01425515725454357 -0.01452868630179309 0.0006232072038298823
3 8.997011382166019e-10 0.010044625087011915
6371008.4
4.25875607065041e-05
-0.1090020607540907 -1.009893805009766 4.823302918632528e-05
0.01682491922568941 -0.001910549762056979 3.992660742687128e-08
4 9.549535102761465e-11 0.0072467897902424765
3389500.0
2.2657408050928896e-05
-1.342897929331636 0.9778655112682739 0.05343398538723887
-0.007712315645393206 -0.01011917844182223 -2.287744801261131e-05
5 2.825345908631355e-07 0.3552720805286442
69911000.0
0.0004673261703049093
3.923184193414315 -3.168419770483168 -0.0746147877972047
0.004655552638985802 0.006232623300954468 -0.0001300429201057457
6 8.459715183006416e-08 0.4376460836930155
58232000.0
0.00038925687730393614
6.185794462795267 -7.804174837804826 -0.110498432926239
0.004066833203985018 0.003458637040736611 -0.0002219310939327014
7 1.2920249163736674e-08 0.46946272948265794
25362000.0
0.00016953449859497232
14.9290976575471 12.92949673572929 -0.1454099139559955
-0.002599557960646664 0.002795888198858545 4.391864857782088e-05
8 1.5243589003230834e-08 0.78119478483336
24622000.0
0.00016458790412449367
29.54416169025338 -4.716921603714237 -0.5838030174427992
0.0004792636209523189 0.00312573757291745 -7.53264045199501e-05
9 2.1919422829042796e-12 0.05379680851617536
1188300.0
7.943294877391593e-06
14.54448346259197 -31.05223519593471 -0.8828000265625595
0.002923077617691739 0.0006625916902153526 -0.0009142553677224461
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
9
1 4.9125474498983625056e-11
2439400.0
1.6306381826061645943e-05
0.008059842448018333591 -0.46160510373291091524 -0.038460177383292291908
0.02248719132054852949 0.0019346392139906921279 -0.0019046569774229759606
2 7.243452483873647106e-10
6051800.0
4.0453784346544178454e-05
-0.51158752153890652004 0.5030818749037323512 0.036425472992779560355
-0.01425515725454356988 -0.014528686301793089943 0.00062320720382988232425
3 8.997011382166018993e-10
6371008.4000000003725
4.25875607065040958e-05
-0.109002060754090704386 -1.0098938050097661101 4.8233029186325282966e-05
0.016824919225689409317 -0.0019105497620569790936 3.9926607426871282392e-08
4 9.549535102761465872e-11
3389500.0
2.265740805092889601e-05
-1.3428979293316360977 0.97786551126827392366 0.053433985387238869258
-0.007712315645393206092 -0.0101191784418222296525 -2.2877448012611311785e-05
5 2.8253459086313549713e-07
69911000.0
0.00046732617030490929307
3.923184193414314791 -3.1684197704831680298 -0.07461478779720470689
0.0046555526389858022113 0.006232623300954467766 -0.00013004292010574569365
6 8.45971518300641563e-08
58232000.0
0.00038925687730393611812
6.1857944627952665684 -7.804174837804826126 -0.11049843292623899582
0.0040668332039850179674 0.0034586370407366113193 -0.00022193109393270141328
7 1.2920249163736673984e-08
25362000.0
0.00016953449859497231466
14.929097657547099942 12.9294967357292893695 -0.14540991395599550673
-0.0025995579606466640267 0.0027958881988585450113 4.391864857782088156e-05
8 1.5243589003230834746e-08
24622000.0
0.000164587904124493665
29.544161690253378794 -4.7169216037142369657 -0.58380301744279916587
0.00047926362095231893815 0.00312573757291745008 -7.532640451995010825e-05
9 2.1919422829042797324e-12
1188300.0
7.943294877391593783e-06
14.544483462591969669 -31.052235195934709822 -0.88280002656255951443
0.0029230776176917390448 0.0006625916902153525834 -0.0009142553677224461557
Loading

0 comments on commit 04275a1

Please sign in to comment.