Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinmacaulay committed Sep 21, 2024
1 parent 2ae6fe4 commit 5e8ac51
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/example_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
bmt = bm.angle_dataset


def plot_compare(f1, ts1, label1, f2, ts2, label2, title):
def plot_compare_freq(f1, ts1, label1, f2, ts2, label2, title):
"""Plot together two ts(f) result sets."""
jech_index = np.nanmean(np.abs(np.array(ts1) - np.array(ts2)))
# Plot the mss model and benchmark results
Expand Down Expand Up @@ -80,7 +80,8 @@ def plot_compare_angle(theta1, ts1, label1, theta2, ts2, label2, title):
('weakly scattering finite cylinder', 'Cylinder_WeaklyScattering'),
('fixed rigid prolate spheroid', 'ProlateSpheroid_Rigid'),
('pressure release prolate spheroid', 'ProlateSpheroid_PressureRelease'),
('gas filled prolate spheroid', 'ProlateSpheroid_Gas'),
# Gas filled is not yet supported
# ('gas filled prolate spheroid', 'ProlateSpheroid_Gas'),
# weakly scattering takes a while to run, so leave it out for the moment
# ('weakly scattering prolate spheroid', 'ProlateSpheroid_WeaklyScattering'),
]
Expand Down Expand Up @@ -120,7 +121,7 @@ def plot_compare_angle(theta1, ts1, label1, theta2, ts2, label2, title):
if bm_name == 'ProlateSpheroid_Gas':
bm_ts = m['f'] * np.nan

plot_compare(m['f'], ts, s['benchmark_model'], m['f'], bm_ts, 'Benchmark', name)
plot_compare_freq(m['f'], ts, s['benchmark_model'], m['f'], bm_ts, 'Benchmark', name)

# %% ###############################################################################################
# Run the benchmark models and compare to the angle-varying benchmark results.
Expand All @@ -130,7 +131,8 @@ def plot_compare_angle(theta1, ts1, label1, theta2, ts2, label2, title):
('weakly scattering finite cylinder', 'Cylinder_WeaklyScattering'),
('fixed rigid prolate spheroid', 'ProlateSpheroid_Rigid'),
('pressure release prolate spheroid', 'ProlateSpheroid_PressureRelease'),
('gas filled prolate spheroid', 'ProlateSpheroid_Gas'),
# Gas filled is not yet supported
# ('gas filled prolate spheroid', 'ProlateSpheroid_Gas'),
('weakly scattering prolate spheroid', 'ProlateSpheroid_WeaklyScattering'),]

for name, bm_name in models:
Expand Down

0 comments on commit 5e8ac51

Please sign in to comment.