Skip to content

Commit b56bee3

Browse files
authored
Merge pull request #2341 from willend/main
Add more %Example lines to McStas instruments
2 parents faa6def + e511a4b commit b56bee3

10 files changed

Lines changed: 13211 additions & 11 deletions

File tree

mcstas-comps/contrib/SNS_source_analytic.comp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,9 +926,6 @@ INITIALIZE
926926
CL = (1.0 / sqrt (Emin * 1e-3) - 1.0 / sqrt (Emax * 1e-3)) / (Emax - Emin) * 1e3;
927927
CU = (log (Emax * 1e-3) - log (Emin * 1e-3)) / (Emax - Emin) * 1e3;
928928

929-
#ifdef USE_MPI
930-
p_in /= mpi_node_count;
931-
#endif
932929
p_in /= mcget_ncount ();
933930
%}
934931

mcstas-comps/data/source_sct091_tu_02_1.dat

Lines changed: 13152 additions & 0 deletions
Large diffs are not rendered by default.

mcstas-comps/examples/SNS/Gallmeier_SNS_decoupled_poisoned/Gallmeier_SNS_decoupled_poisoned.instr

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,44 @@
1616
*
1717
* Simple instrumentfile for estimating SNS brilliance, moderator is a the Gallmeier SNS_source_analytic applying Ikeda-Carpenter vs. Pade function fits to MCNPX tables.
1818
*
19+
* %Example: filename=a1Gw2-2-f5_fit_fit.dat Detector: Brillmon_I=5.51519e+12
20+
*
1921
* %Parameters
2022
* Lambda_min: [AA] Minimum wavelength produced at source
2123
* Lambda_max: [AA] Maximum wavelength produced at source
24+
* filename: [str] Source input file from $MCSTAS/data
2225
*
2326
* %Link
2427
*
2528
* %End
2629
*******************************************************************************/
27-
DEFINE INSTRUMENT Gallmeier_SNS_decoupled_poisoned(Lambda_min=0.5,Lambda_max=20)
30+
DEFINE INSTRUMENT Gallmeier_SNS_decoupled_poisoned(Lambda_min=0.5,Lambda_max=20, string filename="a1Gw2-2-f5_fit_fit.dat")
2831

32+
DEPENDENCY " -DLOADPATH=GETPATH(data) "
33+
2934
DECLARE
3035
%{
3136
double E_min;
3237
double E_max;
38+
char fullfile[256];
3339
%}
3440

3541
INITIALIZE
3642
%{
3743
E_min=81.82/(Lambda_max*Lambda_max);
3844
E_max=81.82/(Lambda_min*Lambda_min);
45+
46+
#define QUOTE(x) #x
47+
#define STR(macro) QUOTE(macro)
48+
49+
#ifndef LOADPATH
50+
#define LOADPATH /usr/share/mcstas/data
51+
#endif
52+
53+
#define LOADPATH_ STR(LOADPATH)
54+
55+
sprintf(fullfile,"%s/%s",LOADPATH_,filename);
56+
3957
%}
4058

4159
/* Here comes the TRACE section, where the actual */
@@ -45,7 +63,7 @@ TRACE
4563
COMPONENT Origin = Progress_bar()
4664
AT (0,0,0) ABSOLUTE
4765

48-
COMPONENT Source = SNS_source_analytic(filename="a1Gw2-2-f5_fit_fit.dat",
66+
COMPONENT Source = SNS_source_analytic(filename=fullfile,
4967
xwidth=0.01, yheight=0.01,
5068
dist=1, focus_xw=0.01, focus_yh=0.01, Emin=E_min,Emax=E_max,sample_E=2, p_power=2)
5169
AT (0,0,0) ABSOLUTE

mcstas-comps/examples/SNS/Granroth_SNS_decoupled_poisoned/Granroth_SNS_decoupled_poisoned.instr

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,44 @@
1616
*
1717
* Simple instrumentfile for estimating SNS brilliance, moderator is a the Granroth SNS_source applying linear interpolation in MCNPX tables.
1818
*
19+
* %Example: filename=source_sct091_tu_02_1.dat Detector: Brillmon_I=7.11736e+12
20+
*
1921
* %Parameters
2022
* Lambda_min: [AA] Minimum wavelength produced at source
2123
* Lambda_max: [AA] Maximum wavelength produced at source
24+
* filename: [str] Source input file from $MCSTAS/data
2225
*
2326
* %Link
2427
*
2528
* %End
2629
*******************************************************************************/
27-
DEFINE INSTRUMENT Granroth_SNS_decoupled_poisoned(Lambda_min=0.5,Lambda_max=20)
30+
DEFINE INSTRUMENT Granroth_SNS_decoupled_poisoned(Lambda_min=0.5,Lambda_max=20, string filename="source_sct091_tu_02_1.dat")
2831

32+
DEPENDENCY " -DLOADPATH=GETPATH(data) "
33+
2934
DECLARE
3035
%{
3136
double E_min;
3237
double E_max;
38+
char fullfile[256];
3339
%}
3440

3541
INITIALIZE
3642
%{
3743
E_min=81.82/(Lambda_max*Lambda_max);
3844
E_max=81.82/(Lambda_min*Lambda_min);
45+
46+
#define QUOTE(x) #x
47+
#define STR(macro) QUOTE(macro)
48+
49+
#ifndef LOADPATH
50+
#define LOADPATH /usr/share/mcstas/data
51+
#endif
52+
53+
#define LOADPATH_ STR(LOADPATH)
54+
55+
sprintf(fullfile,"%s/%s",LOADPATH_,filename);
56+
3957
%}
4058

4159
/* Here comes the TRACE section, where the actual */
@@ -45,7 +63,7 @@ TRACE
4563
COMPONENT Origin = Progress_bar()
4664
AT (0,0,0) ABSOLUTE
4765

48-
COMPONENT Source = SNS_source(filename="/usr/local/lib/mcstas-2.0delta/data/source_sct091_tu_02_1.dat",
66+
COMPONENT Source = SNS_source(filename=fullfile,
4967
xwidth=0.01, yheight=0.01,
5068
dist=1, focus_xw=0.01, focus_yh=0.01, Emin=E_min,Emax=E_max)//,sample_E=samp, p_power=0.5)
5169
AT (0,0,0) ABSOLUTE

mcstas-comps/examples/SNS/Mezei_SNS_decoupled_poisoned/Mezei_SNS_decoupled_poisoned.instr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
*
1717
* Simple instrumentfile for estimating SNS brilliance, moderator is a rescaled ESS short-pulsed Mezei description.
1818
*
19+
* %Example: -y Detector: Brillmon_I=1.178e+13
20+
*
1921
* %Parameters
2022
* Lambda_min: [AA] Minimum wavelength produced at source
2123
* Lambda_max: [AA] Maximum wavelength produced at source

mcstas-comps/examples/SNS/SNS_ARCS/SNS_ARCS.instr

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
* B. Fultz,"Design and operation of the wide angular-range chopper spectrometer ARCS at the
2525
* Spallation Neutron Source", Review of Scientific Instruments, 83 , 015114 (2012)</ul>
2626
*
27+
* %Example: -y Detector: Full_cyl_I=235445
28+
*
2729
* %Parameters
2830
* Fermi_nu: [Hz] Frequency of the Fermi chopper
2931
* T0_nu: [Hz] Frequency of the T0 chopper
@@ -260,7 +262,12 @@ AT(0,0,LS) RELATIVE mod
260262
COMPONENT sampleMantid = Spot_sample(radius_o=0.01, h=0.05, pack = 1,xwidth=0, yheight=0, zthick=0, Eideal=Edes,w=Et,two_theta=ttheta,n_spots=4)
261263
AT (0.0,0.0,0.0) RELATIVE Sample_Arm
262264

263-
COMPONENT t_mon_detB= Monitor_nD(xwidth=5.9817,yheight=3.2,restore_neutron=1, filename="this",
265+
COMPONENT Full_cyl= Monitor_nD(xwidth=5.98,yheight=3.2,restore_neutron=1,
266+
options="mantid banana, theta limits=[-28.0 135.38] bins=389 ,y limits=[-0.550 0.450] bins=128")
267+
AT (0,0,0.00005) RELATIVE Sample_Arm
268+
269+
270+
COMPONENT t_mon_detB= Monitor_nD(xwidth=5.9817,yheight=3.2,restore_neutron=1, filename="this",
264271
options="mantid banana, theta limits=[-28.0 135.38] bins=389 ,y limits=[-0.550 0.450] bins=128, neutron pixel min=0 t, list all neutrons", restore_neutron=1)
265272
AT (0,0,0.00005) RELATIVE Sample_Arm
266273

mcstas-comps/examples/SNS/SNS_analytic_test/SNS_analytic_test.instr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Simple test instrument for the SNS_source component.
2020
* Refer to SNS <A href="http://neutrons.ornl.gov/instrument_systems/components/moderators.shtml">Source files.</A>
2121
*
22-
* Example: filename="source_sct091_tu_02_1.dat" Detector: det_I=9.89304e+09
22+
* Example: filename=source_sct091_tu_02_1.dat Detector: det_I=7.09416e+09
2323
*
2424
* %Parameters
2525
* filename: [string] Source file

mcstas-comps/examples/TUDelft/SEMSANS_Delft/SEMSANS_Delft.instr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
* These parameter and the sphere radius match now with the magnetic fields below to get a good measurement range.
2424
* A pretty high number of neutrons is needed to get good statistics in the fine position sensitive detector.
2525
*
26-
* Example:
26+
* %Example: -y Detector: det_I=7.8145e-08
27+
*
28+
* Other examples:
2729
* SESANS_Delft -n 100000000 -N 31 L0=2.165 DL=0.02 By=0,0.0468 AnaSign=1
2830
* SESANS_Delft -n 100000000 -N 31 L0=2.165 DL=0.02 By=0,0.0468 AnaSign=-1
2931
*

mcstas-comps/examples/TUDelft/SEMSANS_instrument/SEMSANS_instrument.instr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* %Description
1515
* SEMSANS instrument with 2 isosceles triangular field coils
1616
*
17+
* %Example: -y Detector: TOF_det_I=2.87073e-09
18+
*
1719
* %Parameters
1820
* triacoil_depth: [m] Half of the triangular coil depth in z-direction (one right triangle)
1921
* triacoil_width: [m] xwidth of triangular coil

mcstas-comps/examples/TUDelft/SESANS_Delft/SESANS_Delft.instr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
* The foil-angle, thickness and wavelength yield now matched parameters to have the SESANS working.
2323
* These parameter and the sphere radius match now with the magnetic fields below to get a good measurement range.
2424
*
25-
* Example: SESANS_Delft -n 1000000 -N 31 L0=2.165 DL=0.02 By=0,0.0468
25+
* %Example: -y Detector: det_I=2.2537e-07
26+
*
27+
* Scan Example: SESANS_Delft -n 1000000 -N 31 L0=2.165 DL=0.02 By=0,0.0468
2628
*
2729
* %P
2830
* <parameter1>: [<unit>] <parameter1 description>

0 commit comments

Comments
 (0)