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

Commit

Permalink
added "." to the end of comments because it was bugging me
Browse files Browse the repository at this point in the history
  • Loading branch information
cwishard committed Dec 6, 2022
1 parent ee33e27 commit 3b1127e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions examples/Basic_Simulation/initial_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Input
------
None
None.
Output
------
Expand All @@ -38,10 +38,10 @@
# Initialize the simulation object as a variable. Arguments may be defined here or through the sim.run() method.
sim = swiftest.Simulation(fragmentation=True, minimum_fragment_mass = 2.5e-11, mtiny=2.5e-8)

# Add the modern planets and the Sun using the JPL Horizons Database
# Add the modern planets and the Sun using the JPL Horizons Database.
sim.add_solar_system_body(["Sun","Mercury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune","Pluto"])

# Add 5 user-defined massive bodies
# Add 5 user-defined massive bodies.
npl = 5
density_pl = 3000.0 / (sim.param['MU2KG'] / sim.param['DU2M'] ** 3)

Expand All @@ -60,7 +60,7 @@

sim.add_body(name=name_pl, a=a_pl, e=e_pl, inc=inc_pl, capom=capom_pl, omega=omega_pl, capm=capm_pl, Gmass=GM_pl, radius=R_pl, rhill=Rh_pl, Ip=Ip_pl, rot=rot_pl)

# Add 10 user-defined test particles
# Add 10 user-defined test particles.
ntp = 10

name_tp = ["TestParticle_01", "TestParticle_02", "TestParticle_03", "TestParticle_04", "TestParticle_05", "TestParticle_06", "TestParticle_07", "TestParticle_08", "TestParticle_09", "TestParticle_10"]
Expand All @@ -72,7 +72,7 @@
capm_tp = default_rng().uniform(0.0, 360.0, ntp)

sim.add_body(name=name_tp, a=a_tp, e=e_tp, inc=inc_tp, capom=capom_tp, omega=omega_tp, capm=capm_tp)
# Display the run configuration parameters
# Display the run configuration parameters.
sim.get_parameter()

# Run the simulation. Arguments may be defined here or thorugh the swiftest.Simulation() method.
Expand Down
4 changes: 2 additions & 2 deletions examples/Basic_Simulation/output_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
import xarray as xr
import matplotlib.pyplot as plt

# Read in the simulation output and store it as an Xarray dataset
# Read in the simulation output and store it as an Xarray dataset.
sim = swiftest.Simulation(read_old_output_file=True)

# Plot of the data and save the output plot
# Plot of the data and save the output plot.
colors = ['white' if x == 'Massive Body' else 'black' for x in sim.data['particle_type']]
sizes = [100 if x == 'Massive Body' else 10 for x in sim.data['particle_type']]

Expand Down
2 changes: 1 addition & 1 deletion examples/Fragmentation/swiftest_fragmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Input
------
None
None.
Output
------
Expand Down
12 changes: 6 additions & 6 deletions examples/helio_gr_test/helio_gr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Input
------
None
None.
Output
------
Expand Down Expand Up @@ -50,12 +50,12 @@

# Initialize the simulation object as a variable. Define the directory in which the output will be placed.
sim_gr = swiftest.Simulation(simdir="gr")
# Add the modern planets and the Sun using the JPL Horizons Database
# Add the modern planets and the Sun using the JPL Horizons Database.
sim_gr.add_solar_system_body(["Sun","Mercury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune"])

# Initialize the simulation object as a variable. Define the directory in which the output will be placed.
sim_nogr = swiftest.Simulation(simdir="nogr")
# Add the modern planets and the Sun using the JPL Horizons Database
# Add the modern planets and the Sun using the JPL Horizons Database.
sim_nogr.add_solar_system_body(["Sun","Mercury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune"])

# Define a set of arguments that apply to both runs. For a list of possible arguments, see the User Manual.
Expand All @@ -65,13 +65,13 @@
sim_gr.run(**run_args,general_relativity=True)
sim_nogr.run(**run_args,general_relativity=False)

# Get the start and end date of the simulation so we can compare with the real solar system
# Get the start and end date of the simulation so we can compare with the real solar system.
start_date = sim_gr.ephemeris_date
tstop_d = sim_gr.param['TSTOP'] * sim_gr.param['TU2S'] / swiftest.JD2S

stop_date = (datetime.datetime.fromisoformat(start_date) + datetime.timedelta(days=tstop_d)).isoformat()

#Get the ephemerides of Mercury for the same timeframe as the simulation
#Get the ephemerides of Mercury for the same timeframe as the simulation.
obj = Horizons(id='1', location='@sun',
epochs={'start':start_date, 'stop':stop_date,
'step':'10y'})
Expand All @@ -87,7 +87,7 @@
dvarpi_nogr = np.diff(varpisim_nogr) * 3600 * 100 / run_args['tstep_out']
dvarpi_obs = np.diff(varpi_obs) / np.diff(t) * 3600 * 100

# Plot of the data and save the output plot
# Plot of the data and save the output plot.
fig, ax = plt.subplots()

ax.plot(t, varpi_obs, label="JPL Horizons",linewidth=2.5)
Expand Down
8 changes: 4 additions & 4 deletions examples/whm_gr_test/whm_gr_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Input
------
None
None.
Output
------
Expand Down Expand Up @@ -63,13 +63,13 @@
sim_gr.run(**run_args,general_relativity=True)
sim_nogr.run(**run_args,general_relativity=False)

# Get the start and end date of the simulation so we can compare with the real solar system
# Get the start and end date of the simulation so we can compare with the real solar system.
start_date = sim_gr.ephemeris_date
tstop_d = sim_gr.param['TSTOP'] * sim_gr.param['TU2S'] / swiftest.JD2S

stop_date = (datetime.datetime.fromisoformat(start_date) + datetime.timedelta(days=tstop_d)).isoformat()

#Get the ephemerides of Mercury for the same timeframe as the simulation
#Get the ephemerides of Mercury for the same timeframe as the simulation.
obj = Horizons(id='1', location='@sun',
epochs={'start':start_date, 'stop':stop_date,
'step':'10y'})
Expand All @@ -85,7 +85,7 @@
dvarpi_nogr = np.diff(varpisim_nogr) * 3600 * 100 / run_args['tstep_out']
dvarpi_obs = np.diff(varpi_obs) / np.diff(t) * 3600 * 100

# Plot of the data and save the output plot
# Plot of the data and save the output plot.
fig, ax = plt.subplots()

ax.plot(t, varpi_obs, label="JPL Horizons",linewidth=2.5)
Expand Down

0 comments on commit 3b1127e

Please sign in to comment.