RadCluster
Graph-based cluster dynamics for irradiated materials
Loading...
Searching...
No Matches
Functions | Variables
make_dose_figures Namespace Reference

Functions

 load_model (Path run_dir)
 
 short_source (title)
 
 attribute (df)
 
 load_experiment ()
 
 draw (D, M, SER, which, annotated)
 
 main ()
 

Variables

 MOD = Path(__file__).resolve().parent.parent
 
str DB = MOD.parent / 'docs' / 'Database'
 
 C111
 
 C100
 
 CCAV
 
 INK
 
 INK2
 
 GRID
 
dict SOURCE_COLOR
 
float LW = 4.5
 
int MS = 260
 
 LABEL_PT
 
 TICK_PT
 
 LEGEND_PT
 
int XMIN = 1e-3
 
int NMIN = 1e19
 
float DMAX = 18.0
 

Detailed Description

Dose-evolution figures for a RadCluster_2_1 run, with EUROFER97 data overlaid.

Regenerates `plots/density_vs_dose.png` and `plots/size_vs_dose.png` (plus the
`_annotated` variants) for ANY run directory under `output/`.

WHY THIS FILE EXISTS.  The reference figures for run
`20260904_212202_..._I80000V20000_im5vm5` were made by a script that was never
saved next to them -- `output/` is gitignored, so the only surviving relative,
`output/20260904_153005_f281fcf/make_figures.py`, is a DIFFERENT and earlier
variant: it plots the campaign row's `at_dose` trajectory out of
`digital_twin/results/B3_coal.jsonl`, not the run's own solution, and it draws
the marker-on-curve "annotated" style with no experimental bands.  The notebook
never produced these figures at all.  So the headline figures of the reference
case could not be regenerated from anything in version control.  This script
closes that gap and is committed.

The six series are derived from the run's own `plots/plot_data.pkl`, using the
same expressions `digital_twin/run_ensemble.py` uses for the campaign
observables, so a figure and a ledger row for the same vector agree by
construction:

    d_111  = 2*sqrt(mean_n_111 * Omega / (pi*b_111))     [loop, 1/2<111>]
    d_100  = 2*sqrt(mean_n_100 * Omega / (pi*b_100))     [loop, <100>]
    d_cav  = 2*(3*mean_n_v*Omega/(4*pi))^(1/3)           [spherical cavity]

Verified against the reference run: reproduces its provenance addendum's
"Model at key doses" table to every printed digit.

ENCODING (revised 2026-09-06).  Experimental points are coloured by *literature
source*, not by defect population, and every source is named in the legend --
replacing the earlier filled/open "experiment, 330 C" / "experiment, 300/350 C"
pair, which spent two legend entries on temperature and none on provenance.
Defect population is carried by marker SHAPE (o = 1/2<111>, s = <100>,
^ = cavity), and the model legend entries repeat that shape, so a reader can
still tell which curve each measurement belongs against.  The irradiation
temperature of an individual point is no longer encoded; every point in the
window is 300-350 C and the model is at 330 C.

Usage:
    python codes/make_dose_figures.py <run_dir> [--annotated] [--in-place]

    <run_dir>     an output/ run directory (must contain plots/plot_data.pkl)
    --annotated   also write the marker/annotated *_annotated.png variants
    --in-place    write into <run_dir>/plots/ (default: a new timestamped dir,
                  so an existing reference run is never overwritten)

Function Documentation

◆ attribute()

make_dose_figures.attribute (   df)
Add a short `Source` per row of InterstitialLoop.xlsx.

The `Paper` column uses MERGED CELLS: one title heads a block of rows and
pandas leaves NaN on every row but the first, so attribution is a forward
fill.  The fill is fenced by irradiation type: the sheet has one place --
Excel row 40 -- where a neutron row sits immediately below an ion block, and
an unfenced fill would hand it to Boulanger 2009 (an ion study).  A finer
fence would be wrong: the Dethloff 2018 merge legitimately spans an HFR ->
BOR-60 facility change.  Fencing leaves row 40 unattributed, exactly what
SOURCES.md caveat 1 records; it is then assigned to Chauhan 2021 by the
inference stated there (its 1/2<111> partner, same 6.2 nm, is Chauhan), and
the assumption is printed at run time.  Fix the merge range to retire this.

Definition at line 140 of file make_dose_figures.py.

◆ draw()

make_dose_figures.draw (   D,
  M,
  SER,
  which,
  annotated 
)

Definition at line 185 of file make_dose_figures.py.

◆ load_experiment()

make_dose_figures.load_experiment ( )
EUROFER97, neutron, 300-350 C.  Provenance: docs/Database/SOURCES.md.

Definition at line 165 of file make_dose_figures.py.

◆ load_model()

make_dose_figures.load_model ( Path  run_dir)
Six observable series + dose axis, from the run's own solution.

Definition at line 105 of file make_dose_figures.py.

◆ main()

make_dose_figures.main ( )

Definition at line 295 of file make_dose_figures.py.

◆ short_source()

make_dose_figures.short_source (   title)
'Dethloff et al. - 2016 - Microstructural ...' -> 'Dethloff 2016'.

Definition at line 131 of file make_dose_figures.py.

Variable Documentation

◆ C100

make_dose_figures.C100

Definition at line 66 of file make_dose_figures.py.

◆ C111

make_dose_figures.C111

Definition at line 66 of file make_dose_figures.py.

◆ CCAV

make_dose_figures.CCAV

Definition at line 66 of file make_dose_figures.py.

◆ DB

str make_dose_figures.DB = MOD.parent / 'docs' / 'Database'

Definition at line 61 of file make_dose_figures.py.

◆ DMAX

float make_dose_figures.DMAX = 18.0

Definition at line 102 of file make_dose_figures.py.

◆ GRID

make_dose_figures.GRID

Definition at line 67 of file make_dose_figures.py.

◆ INK

make_dose_figures.INK

Definition at line 67 of file make_dose_figures.py.

◆ INK2

make_dose_figures.INK2

Definition at line 67 of file make_dose_figures.py.

◆ LABEL_PT

make_dose_figures.LABEL_PT

Definition at line 89 of file make_dose_figures.py.

◆ LEGEND_PT

make_dose_figures.LEGEND_PT

Definition at line 89 of file make_dose_figures.py.

◆ LW

float make_dose_figures.LW = 4.5

Definition at line 83 of file make_dose_figures.py.

◆ MOD

make_dose_figures.MOD = Path(__file__).resolve().parent.parent

Definition at line 60 of file make_dose_figures.py.

◆ MS

int make_dose_figures.MS = 260

Definition at line 84 of file make_dose_figures.py.

◆ NMIN

int make_dose_figures.NMIN = 1e19

Definition at line 101 of file make_dose_figures.py.

◆ SOURCE_COLOR

dict make_dose_figures.SOURCE_COLOR
Initial value:
1= {
2 'Dethloff 2016': '#111111',
3 'Dethloff 2018': '#8a1c1c',
4 'Klimenkov 2011': '#b8860b',
5 'Klimenkov 2020': '#7b2d8e',
6 'Weiß 2012': '#d81b60',
7 'Chauhan 2021': '#6b4423',
8 'Coppola 2019': '#4a6572',
9}

Definition at line 73 of file make_dose_figures.py.

◆ TICK_PT

make_dose_figures.TICK_PT

Definition at line 89 of file make_dose_figures.py.

◆ XMIN

int make_dose_figures.XMIN = 1e-3

Definition at line 100 of file make_dose_figures.py.