-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.jbs
executable file
·47 lines (40 loc) · 1.52 KB
/
example.jbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env jabs
#This is a comment
set ion 4He
set energy 2027keV
#the following three lines are equivalent
set alpha 0
set alpha 0deg
set alpha "0 deg"
#Default cross sections can be changed easily between the built-in models, see other examples on how to define reactions
#set cs_rbs Rutherford
#Fluence is actually total number of ions, not ions/cm2... this should not be multiplied by detector solid angle (JaBS will do that)
set fluence 2.0e13
load exp "experimental.dat"
#sample can be set with one command
set sample Au 30tfu rough 20tfu n_rough 10 SiO2 6500tfu Si 20000tfu
#or loaded from a file (tabular data)
#load sample "sample.txt"
#Scripts can be loaded (run). It is convenient to store detector in a separate script.
load script "detector.jbs"
#The following line can be uncommented after this script is run. We save the detector calibration at the end of the script.
#load script "calibration_out.jbs"
add fit range [200:449] [450:700]
add fit range [1050:1110]
#Iterations can be limited if there is reason to suspect it won't converge...
set maxiter 100
#Speed up by setting the minimum energy in the simulation
set emin 150keV
simulate
save spectra "simulated_out.csv"
set fit normal
fit *calib*,fluence,thick1,thick2,rough1,conc2_O
save spectra "example_out.csv"
#detector calibration can be saved to a script file. This can be loaded back in.
save calibration "calibration_out.jbs"
#fitted sample can be saved (and loaded back in later!)
save sample "sample_out.txt"
#show detector
#show fit
#show sample profile
show fit ranges