Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion examples/classification/plot_paper_results.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,15 @@ def plot_volume_classification(data_dir, output_path, config_label="",

tl_data = np.loadtxt(data_dir / "times_lost.dat")
trap_par = tl_data[:, 2]
# Class 0 is the initial value: the orbit left the plasma before it was
# classified, or it stayed confined without enough banana tips. Only the
# first is a prompt loss; the exit code tells them apart.
exit_file = data_dir / "orbit_exit_code.dat"
if exit_file.exists():
exit_code = np.loadtxt(exit_file)[:, 1].astype(int)
lost = (exit_code == 1) | (exit_code == 2)
else:
lost = np.ones(len(icl), dtype=bool)

bminmax = np.loadtxt(data_dir / "bminmax.dat")

Expand All @@ -368,7 +377,8 @@ def plot_volume_classification(data_dir, output_path, config_label="",
if not is_trapped:
continue
if icl[ipart] == 0:
prompt[k, i] += 1.0
if lost[ipart]:
prompt[k, i] += 1.0
elif icl[ipart] == 1:
regular[k, i] += 1.0
elif icl[ipart] == 2:
Expand Down
Loading