Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPT examples review (parameters-tuning and fem-reconstruction) #1379

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ As seen in the previous example (:doc:`../photon-count-calculation-in-a-cylindri
set verbosity = quiet
set export counts = false
set counts file = run.csv
set monte carlo iteration = 10000
set monte carlo iteration = 100000
set random number seed = 0
set reactor height = 0.3
set reactor radius = 0.4
Expand Down
2 changes: 1 addition & 1 deletion examples/rpt/parameters-tuning/rpt_lethe_nomad.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
file.write("\n".join(filestr))

# Call rpt_3d executable
os.system("rpt_3d " + tmp_lethe_parameter_file)
os.system("lethe-rpt-3d " + tmp_lethe_parameter_file)

# Delete temporary parameter files
os.remove(tmp_lethe_parameter_file)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""
IMPORTS
"""

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd

"""
MAIN
"""

# Read data
found_positions = pd.read_csv("found_positions.csv", header=1).values
real_positions = np.loadtxt("real-positions.txt", skiprows=1)

# Extract X and Y coordinates
found_x, found_y = found_positions[:, 0], found_positions[:, 1]
real_x, real_y = real_positions[:, 0], real_positions[:, 1]

"""
PLOTS
"""

plt.figure(figsize=(6, 6))
plt.scatter(real_x, real_y, c='red', label='Experimental position', s=10, alpha=0.8)
plt.scatter(found_x, found_y, c='black', label='Reconstructed position', s=10, alpha=0.8)

plt.xlabel("X (m)")
plt.ylabel("Y (m)")
plt.legend(loc="upper center", bbox_to_anchor=(0.5, 1.1), ncol=2)
plt.axis('equal') # ensures the grid is square

plt.show()
Loading