|
RadCluster
Graph-based cluster dynamics for irradiated materials
|
Functions | |
| _set_title (ax, text, **kw) | |
| _has (s, *needles) | |
| parse_burgers_fraction (bv_str, temp_c=None, dose_dpa=None) | |
| extract_f111_table (xlsx) | |
| _apply_style (font_size, font_family, font_serif, axes_linewidth, dpi, save_dpi) | |
| _r2 (x, y) | |
| _spearman_abs (x, y) | |
| _scatter (ax, df, xkey, xlabel, color_by="material", marker_by="irradiation") | |
| plot_loop_111_fraction (xlsx="Ferritics_Irradiated_Microstructure_Data.xlsx", outdir="figures", save=True, show=False, formats=("pdf", "png"), weak_threshold=0.20, force=None, font_size=16, font_family="serif", font_serif=("Times New Roman", "DejaVu Serif"), axes_linewidth=1.2, dpi=150, save_dpi=300, figsize=(10, 6)) | |
Variables | |
| bool | SHOW_TITLES = False |
| p = argparse.ArgumentParser() | |
| default | |
| type | |
| int | |
| a = p.parse_args() | |
| xlsx | |
| outdir | |
| font_size | |
| save | |
| True | |
| show | |
loop_burgers_fraction.py
Extracts and plots the fraction of ½⟨111⟩ dislocation loops vs temperature
and irradiation dose from Ferritics_Irradiated_Microstructure_Data.xlsx.
Two data sources are used:
1. The `Dominant Burgers Vector` column of the
`N – Dislocation Loops` and `Ion – Dislocation Loops` sheets.
Free-text descriptions are parsed into numeric f₁₁₁ ∈ [0, 1].
2. The `111 Fraction` sheet, which contains size-binned histograms.
For conditions where both ⟨100⟩ and ½⟨111⟩ histograms are present
(e.g. 350°C / 16 dpa), an integrated bulk fraction is computed.
Programmatic use (Jupyter):
from loop_burgers_fraction import plot_loop_111_fraction
figs, df = plot_loop_111_fraction(
xlsx="../../input/Ferritics_Irradiated_Microstructure_Data.xlsx",
outdir="../../output/microstructure",
font_size=16, save=True, show=True,
)
|
protected |
Definition at line 174 of file loop_burgers_fraction.py.
|
protected |
Definition at line 49 of file loop_burgers_fraction.py.
|
protected |
Coefficient of determination for a least-squares linear fit.
Definition at line 193 of file loop_burgers_fraction.py.
|
protected |
Definition at line 222 of file loop_burgers_fraction.py.
|
protected |
Axes (or panel) title, drawn only when SHOW_TITLES is on.
Definition at line 43 of file loop_burgers_fraction.py.
|
protected |
|Spearman ρ| — captures monotonic (incl. nonlinear) dependence; better than R² when the underlying relationship is sigmoidal or step-like.
Definition at line 207 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.extract_f111_table | ( | xlsx | ) |
Definition at line 112 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.parse_burgers_fraction | ( | bv_str, | |
temp_c = None, |
|||
dose_dpa = None |
|||
| ) |
Definition at line 52 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.plot_loop_111_fraction | ( | xlsx = "Ferritics_Irradiated_Microstructure_Data.xlsx", |
|
outdir = "figures", |
|||
save = True, |
|||
show = False, |
|||
formats = ("pdf", "png"), |
|||
weak_threshold = 0.20, |
|||
force = None, |
|||
font_size = 16, |
|||
font_family = "serif", |
|||
font_serif = ("Times New Roman", "DejaVu Serif"), |
|||
axes_linewidth = 1.2, |
|||
dpi = 150, |
|||
save_dpi = 300, |
|||
figsize = (10, 6) |
|||
| ) |
Build figures of f_111 vs (T, dose).
Strategy:
- Compute |Spearman ρ| for f_111 vs T and vs dose (rank-based;
captures monotonic non-linear trends — e.g. the sigmoidal
½⟨111⟩→⟨100⟩ transition with T).
- If both > weak_threshold, plot both.
- If only one is, plot only that one (the weak axis is omitted,
per the user's spec).
- If neither is, plot both anyway as a diagnostic.
- `force` overrides the auto choice.
Returns (figs_dict, dataframe).
Definition at line 244 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.a = p.parse_args() |
Definition at line 354 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.default |
Definition at line 351 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.font_size |
Definition at line 356 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.int |
Definition at line 353 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.outdir |
Definition at line 355 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.p = argparse.ArgumentParser() |
Definition at line 350 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.save |
Definition at line 356 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.show |
Definition at line 356 of file loop_burgers_fraction.py.
| bool py_utils.loop_burgers_fraction.SHOW_TITLES = False |
Definition at line 40 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.True |
Definition at line 356 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.type |
Definition at line 353 of file loop_burgers_fraction.py.
| py_utils.loop_burgers_fraction.xlsx |
Definition at line 355 of file loop_burgers_fraction.py.