|
15 | 15 | * Simply a model source illuminating a SX sample. |
16 | 16 | * The sample itself is a Mo bulk crystal. |
17 | 17 | * |
18 | | -* %Example: TTH=13.4 index=1 Detector: psd4pi_I=7.95747e-10 |
19 | | -* %Example: TTH=13.4 index=2 Detector: psd4pi_I=7.95747e-10 |
| 18 | +* %Example: index=1 Detector: psd4pi_I=1.18843e-13 |
| 19 | +* %Example: index=2 Detector: psd4pi_I=4.80386e-13 |
20 | 20 | * |
21 | 21 | * %Parameters |
22 | | -* TTH: [deg] Two theta rotation. Only places the last detector. |
23 | 22 | * reflections: [str] List of powder reflections, LAU/CIF format. |
24 | 23 | * index: [1] Index of the sample component to use. 1=Single_crystal, 2=FluoCrystal |
25 | 24 | * |
26 | 25 | * %End |
27 | 26 | *******************************************************************************/ |
28 | 27 |
|
29 | | -DEFINE INSTRUMENT Test_SX(TTH=13.4, string reflections="Mo.lau", index=1) |
| 28 | +DEFINE INSTRUMENT Test_SX(string reflections="Mo.lau", index=1) |
| 29 | + |
| 30 | +USERVARS %{ |
| 31 | + int Stype; |
| 32 | +%} |
30 | 33 |
|
31 | 34 | TRACE |
32 | 35 | COMPONENT src = Source_flat( |
33 | 36 | yheight = 1e-3, xwidth = 1e-3, dist = 10, focus_xw = 1e-3, |
34 | 37 | focus_yh = 1e-3, E0 = 7, dE = 6.9) |
35 | 38 | AT (0, 0, 0) ABSOLUTE |
36 | 39 |
|
37 | | -COMPONENT psd0 = PSD_monitor( |
38 | | - nx = 100, ny = 100, filename = "psd0", xwidth = 2e-3, yheight = 2e-3) |
39 | | -AT (0, 0, 1e-9) RELATIVE src |
40 | | - |
41 | 40 | COMPONENT sample_pos=Arm() |
42 | 41 | AT (0, 0, 10) RELATIVE PREVIOUS |
43 | 42 |
|
44 | 43 | COMPONENT sample = Single_crystal(reflections=reflections, material_datafile="NULL", |
45 | | - radius = .5e-4, yheight = 1e-3,mosaic=1e-4) |
| 44 | + radius = .5e-4, yheight = 1e-3, mosaic=1) |
46 | 45 | WHEN(index==1) |
47 | 46 | AT (0, 0, 0) RELATIVE sample_pos |
48 | | -/*EXTEND %{*/ |
49 | | -/* if(!SCATTERED) ABSORB;*/ |
50 | | -/*%}*/ |
| 47 | +EXTEND %{ |
| 48 | + if(!SCATTERED) ABSORB; |
| 49 | + else Stype=DIFFRACTION; |
| 50 | +%} |
51 | 51 |
|
52 | 52 | COMPONENT sampleF = FluoCrystal(material=reflections, |
53 | | - radius = .5e-4, yheight = 1e-3,sx_mosaic=5) |
| 53 | + radius = .5e-4, yheight = 1e-3, sx_mosaic=5) |
54 | 54 | WHEN(index==2) |
55 | 55 | AT (0, 0, 0) RELATIVE sample_pos |
| 56 | +EXTEND %{ |
| 57 | + if(!SCATTERED) ABSORB; |
| 58 | + else Stype=type; |
| 59 | +%} |
56 | 60 |
|
57 | 61 | COMPONENT psd4pi = PSD_monitor_4PI( |
58 | 62 | nx = 180, ny = 180, filename = "psd4pi", radius = 0.1, restore_xray = 1) |
59 | 63 | AT (0, 0, 0) RELATIVE sample |
60 | 64 |
|
61 | | -/*COMPONENT detector = PSD_monitor(*/ |
62 | | -/* nx=200, ny=200, xwidth=0.1, yheight=0.1, filename="psd1",restore_xray=1)*/ |
63 | | -/*AT(0,0,0.1) RELATIVE sample*/ |
64 | | -/**/ |
65 | | -/*COMPONENT ttharm= Arm()*/ |
66 | | -/*AT(0,0,0) RELATIVE sample*/ |
67 | | -/*ROTATED (TTH,TTH,0) RELATIVE sample*/ |
68 | | -/**/ |
69 | | -/*COMPONENT detector2 = PSD_monitor(*/ |
70 | | -/* nx=200, ny=200, xwidth=2e-3, yheight=1e-2, filename="psd2",restore_xray=1)*/ |
71 | | -/*AT(0,0,0.1) RELATIVE ttharm*/ |
| 65 | +COMPONENT psd_Diff = PSD_monitor_4PI( |
| 66 | + nx = 180, ny = 180, filename = "psd4pi_diff", radius = 0.1, restore_xray = 1) |
| 67 | +WHEN (Stype == DIFFRACTION) |
| 68 | +AT (0, 0, 0) RELATIVE sample |
| 69 | + |
72 | 70 | END |
0 commit comments