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)
3026* L1: [m] Source-sample distance
3127* directbeam: [1] Suppress direct beam (0) or not (1)
32- * reflections: [str] List of powder reflections, LAU/CIF format.
28+ * reflections: [str] List of powder reflections, LAU/LAZ/ CIF format.
3329* SPLITS: [1] Number of SPLIT's before sample
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
@@ -55,11 +50,13 @@ COMPONENT src = Source_flat(
5550
5651SPLIT SPLITS COMPONENT sample_cradle = Arm()
5752 AT (0, 0, L1) RELATIVE PREVIOUS
53+
54+ // samples -------------------------------------------------------------------
5855
5956COMPONENT Pow = PowderN(
6057 radius=0.5e-4, yheight=1e-3, reflections=reflections,format={ 4,5,7,0,0,0,0,0 },
6158 p_inc=frac_i, p_transmit=frac_t, p_interact=frac_c,
62- d_phi=d_phi, pack = 0.5, Vc = 123 )
59+ d_phi=d_phi, pack = 0.5)
6360WHEN (index == 1)
6461AT (0, 0, 0) RELATIVE sample_cradle
6562EXTEND %{
@@ -72,7 +69,7 @@ EXTEND %{
7269
7370COMPONENT SX = Single_crystal(
7471 radius=0.5e-4, yheight=1e-3, reflections=reflections,powder=1,
75- p_transmit=frac_t, mosaic=5 , sigma_inc=-1)
72+ p_transmit=frac_t, mosaic=1 , sigma_inc=-1)
7673WHEN (index == 2)
7774AT (0, 0, 0) RELATIVE sample_cradle
7875EXTEND %{
@@ -83,19 +80,24 @@ EXTEND %{
8380 }
8481%}
8582
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+
96+ // detectors -------------------------------------------------------------------
8697
8798COMPONENT Sph_mon = PSD_monitor_4PI(nx=200,ny=200, radius=1, restore_xray=1, filename="Sphere")
8899 AT (0, 0, 0) RELATIVE PREVIOUS
89100
90- COMPONENT ttharm= Arm()
91- AT(0,0,0) RELATIVE Pow
92- ROTATED (0,TTH,0) RELATIVE Pow
93-
94- COMPONENT detector2 = PSD_monitor(
95- nx=200, ny=200, xwidth=2e-3, yheight=1e-2, filename="psd2",restore_xray=1
96- )
97- AT(0,0,0.1) RELATIVE ttharm
98-
99101// ideal "banana" detector
100102COMPONENT det_angle = Monitor_nD(options="abs theta limits=[5 90]",
101103 radius=0.6, yheight=1e-2, bins=10000)
0 commit comments