1515* %Description
1616* Simply a model source illuminating a powder sample.
1717* The default sample itself is an LaB6-powder.
18- * Alternatively, the Single_crystal component can also be tested in powder mode .
18+ * Alternatively, the Single_crystal (powder mode) and FluoPowder components can also be tested.
1919*
20- * %Example: Test_PowderN.instr reflections="Fe_bcc229_lt13deg.dat" -n1e7 TTH=13.4 d_phi=45 frac_i=0 Detector: Sph_mon_I=2.68295e-14
21- * %Example: Test_PowderN.instr E0=15 Detector: Sph_mon_I=6.24257e-12
22- * %Example: Test_PowderN.instr E0=15 d_phi=10 Detector: Sph_mon_I=6.59782e-13
23- * %Example: Test_PowderN.instr E0=15 directbeam=1 SPLITS=2 Detector: Sph_mon_I=7.94366e-10
24- * %Example: Test_PowderN.instr E0=15 directbeam=1 SPLITS=5 Detector: Sph_mon_I=7.94366e-10
25- * %Example: Test_PowderN.instr E0=15 directbeam=1 SPLITS=10 Detector: Sph_mon_I=7.94366e-10
26- * %Example: Test_PowderN.instr E0=15 directbeam=1 SPLITS=20 Detector: Sph_mon_I=7.94366e-10
20+ * %Example: index=1 Detector: Sph_mon_I=1.26755e-11
21+ * %Example: index=2 Detector: Sph_mon_I=4.44793e-13
22+ * %Example: index=3 Detector: Sph_mon_I=5.23579e-11
2723*
2824* %Parameters
2925* E0: [keV] Source energy (width 1 keV)
3430* frac_c: [1] Fraction of stats assigned to coherent scattering
3531* frac_i: [1] Fraction of stats assigned to incoherent scattering
3632* frac_t: [1] Fraction of stats assigned to unscattered, "direct beam"
37- * TTH: [deg] Rotation of secondary detector arm.
3833* d_phi: [deg] Angle corresponding to the vertical angular range to focus to, e.g. detector height. 0 for no focusing.
39- * index: [1] Index of the sample component to use. 1=PowderN, 2=Single_crystal
34+ * index: [1] Index of the sample component to use. 1=PowderN, 2=Single_crystal, 3=FluoPowder
4035*
4136* %End
4237*******************************************************************************/
43- DEFINE INSTRUMENT Test_PowderN(E0=15, L1=10, int directbeam=0, string reflections="LaB6_660b_AVID2.hkl",
44- int SPLITS=1, frac_c=0.8, frac_i=0.1, frac_t=0.1, d_phi=0, TTH=0, int index=1)
38+ DEFINE INSTRUMENT Test_PowderN(E0=15, L1=10, int directbeam=0, string reflections="LaB6.cif",
39+ int SPLITS=1, frac_c=0.8, frac_i=0.1, frac_t=0.1, d_phi=0, int index=1)
4540
4641TRACE
4742
@@ -61,7 +56,7 @@ SPLIT SPLITS COMPONENT sample_cradle = Arm()
6156COMPONENT Pow = PowderN(
6257 radius=0.5e-4, yheight=1e-3, reflections=reflections,format={ 4,5,7,0,0,0,0,0 },
6358 p_inc=frac_i, p_transmit=frac_t, p_interact=frac_c,
64- d_phi=d_phi, pack = 0.5, Vc = 123 )
59+ d_phi=d_phi, pack = 0.5)
6560WHEN (index == 1)
6661AT (0, 0, 0) RELATIVE sample_cradle
6762EXTEND %{
@@ -74,7 +69,7 @@ EXTEND %{
7469
7570COMPONENT SX = Single_crystal(
7671 radius=0.5e-4, yheight=1e-3, reflections=reflections,powder=1,
77- p_transmit=frac_t, mosaic=1e-3 , sigma_inc=-1)
72+ p_transmit=frac_t, mosaic=1 , sigma_inc=-1)
7873WHEN (index == 2)
7974AT (0, 0, 0) RELATIVE sample_cradle
8075EXTEND %{
@@ -85,20 +80,24 @@ EXTEND %{
8580 }
8681%}
8782
83+ COMPONENT FlPow = FluoPowder(
84+ radius=0.5e-4, yheight=1e-3, material=reflections, powder_d_phi=d_phi,
85+ packing_factor = 0.5, p_interact=frac_c)
86+ WHEN (index == 3)
87+ AT (0, 0, 0) RELATIVE sample_cradle
88+ EXTEND %{
89+ if(INSTRUMENT_GETPAR(directbeam) == 0) {
90+ if (!SCATTERED) {
91+ ABSORB;
92+ }
93+ }
94+ %}
95+
8896// detectors -------------------------------------------------------------------
8997
9098COMPONENT Sph_mon = PSD_monitor_4PI(nx=200,ny=200, radius=1, restore_xray=1, filename="Sphere")
9199 AT (0, 0, 0) RELATIVE PREVIOUS
92100
93- COMPONENT ttharm= Arm()
94- AT(0,0,0) RELATIVE Pow
95- ROTATED (0,TTH,0) RELATIVE Pow
96-
97- COMPONENT detector2 = PSD_monitor(
98- nx=200, ny=200, xwidth=2e-3, yheight=1e-2, filename="psd2",restore_xray=1
99- )
100- AT(0,0,0.1) RELATIVE ttharm
101-
102101// ideal "banana" detector
103102COMPONENT det_angle = Monitor_nD(options="abs theta limits=[5 90]",
104103 radius=0.6, yheight=1e-2, bins=10000)
0 commit comments