Skip to content

Commit 7c39578

Browse files
committed
Added more stuff to example, moved some of the comments from their own lines to the end of the line.
1 parent f643f7e commit 7c39578

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

example/example.jbs

+24-20
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
#!/usr/bin/env jabs
22
#This is a comment
3-
set ion 4He
3+
set ion 4He #4He is also known as "a"
44
set energy 2027keV
5-
#the following three lines are equivalent
6-
set alpha 0
5+
set alpha 0 #this and the following two lines are equivalent
76
set alpha 0deg
87
set alpha "0 deg"
98

10-
#Default cross sections can be changed easily between the built-in models, see other examples on how to define reactions
9+
#Default cross sections can be changed easily between the built-in models, see other examples on how to define reactions using e.g. R33 files
1110
#set cs_rbs Rutherford
1211

13-
#Fluence is actually total number of ions, not ions/cm2... this should not be multiplied by detector solid angle (JaBS will do that)
14-
set fluence 2.0e13
12+
#RBS (and ERD) reactions are added automatically when running a simulation or a fit, if no reactions are specified
13+
#load reactions RBS
14+
#add reaction RBS 197Au
15+
16+
17+
set fluence 2.0e13 #Fluence is actually total number of ions, not ions/cm2... this should *not* be multiplied by detector solid angle (JaBS will do that)
1518
load exp "experimental.dat"
1619

1720
#sample can be set with one command
@@ -20,30 +23,31 @@ set sample Au 30tfu rough 20tfu n_rough 20 SiO2 6500tfu Si 20000tfu
2023
#or loaded from a file (tabular data)
2124
#load sample "sample.txt"
2225

23-
#Scripts can be loaded (run). It is convenient to store detector in a separate script.
24-
load script "detector.jbs"
26+
load script "detector.jbs" #Scripts can be loaded (run). It is convenient to store detector in a separate script.
2527
#The following line can be uncommented after this script is run. We save the detector calibration at the end of the script.
2628
#load script "calibration_out.jbs"
2729

30+
set emin 150keV #Speed up by setting the minimum energy in the simulation (optional)
31+
32+
#show sim
33+
simulate #Run a simulation
34+
35+
save spectra "simulated_out.csv" #Save spectra
36+
37+
#fit ranges (channels) must be specified before fitting. We can define multiple ranges with one command.
2838
add fit range [200:449] [450:700]
2939
add fit range [1050:1110]
30-
#Iterations can be limited if there is reason to suspect it won't converge...
31-
set maxiter 100
32-
#Speed up by setting the minimum energy in the simulation
33-
set emin 150keV
34-
simulate
35-
save spectra "simulated_out.csv"
36-
37-
set fit normal
40+
#Number of iterations can be limited if there is reason to suspect the fit won't converge...
41+
#set maxiter 100
3842

43+
#Run a fit
3944
fit *calib*,fluence,thick1,thick2,rough1,conc2_O
4045
save spectra "example_out.csv"
41-
#detector calibration can be saved to a script file. This can be loaded back in.
42-
save calibration "calibration_out.jbs"
43-
#fitted sample can be saved (and loaded back in later!)
44-
save sample "sample_out.txt"
46+
save calibration "calibration_out.jbs" #detector calibration can be saved to a script file. This can be loaded back in.
47+
save sample "sample_out.txt" #fitted sample can be saved (and loaded back in later!)
4548
#show detector
4649
#show fit
4750
#show fit correlation
4851
#show sample profile
4952
show fit ranges
53+
#roi [1060:1092]

0 commit comments

Comments
 (0)