-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RPT examples review (parameters-tuning and fem-reconstruction) (#1379)
Modified the exacutable rpt_3d -> lethe-rpt-3d in the python file responsible for launching the lethe code Changed the monte carlo iteration count in the doc to match the one in the prm files Forgot to create a new branch so I will do two examples in a single PR. Added a post-processing script to particle-fem-reconstruction example.
- Loading branch information
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
examples/rpt/particle-fem-reconstruction/particle-fem-reconstruction-post-processing.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |