File: Test_DiskChoppers.instr

package info (click to toggle)
mccode 3.5.19%2Bds5-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,113,256 kB
  • sloc: ansic: 40,697; python: 25,137; yacc: 8,438; sh: 5,405; javascript: 4,596; lex: 1,632; cpp: 742; perl: 296; lisp: 273; makefile: 226; fortran: 132
file content (138 lines) | stat: -rw-r--r-- 2,970 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*******************************************************************************
* Instrument: Test_DiskChoppers
*
* %I
* Written by: Peter Willendrup <pkwi@fysik.dtu.dk>
* Date: September 2018
* Origin: DTU
* %INSTRUMENT_SITE: Tests_optics
*
* Simple test instrument that compares the use of 2 DiskChoppers with one MultiDiskChopper
*
* %D
* Simple test instrument that compares the use of 2 DiskChoppers with one MultiDiskChopper
*
* %Example: Test_DiskChoppers.instr chopper=0 Detector: Tofl_I=0.00277
* %Example: Test_DiskChoppers.instr chopper=1 Detector: Tofl_I=0.00277
* %P
* chopper:  [int] chopper=0 selects two DiskChoppers, chopper=1 selects one MultiDiskChopper
* lambda:   [AA] Mean wavelength produced from the source 
* dlambda: [AA] Halfwidth of wavelenghts produced from the source
* deltay:     [m]  Vertical displacement of MultiDiskChopper vertical centre of rotation (default is to be positioned like DiskChopper)
*
* %L
*
* %E
*******************************************************************************/
DEFINE INSTRUMENT Test_DiskChoppers(chopper=0,lambda=10, dlambda=9.9,deltay=-0.19)

DECLARE
%{
%}

INITIALIZE
%{
%}

TRACE

COMPONENT origin = Progress_bar()
AT (0, 0, 0) RELATIVE ABSOLUTE


COMPONENT source_gen = Source_gen(
    flux_file="NULL", 
    xdiv_file="NULL", 
    ydiv_file="NULL", 
    radius=0.0, 
    dist=10, 
    focus_xw=0.045, 
    focus_yh=0.12, 
    focus_aw=0, 
    focus_ah=0, 
    E0=0, 
    dE=0, 
    lambda0=lambda, 
    dlambda=dlambda, 
    I1=1, 
    yheight=0.1, 
    xwidth=0.1, 
    verbose=0, 
    T1=0, 
    flux_file_perAA=0, 
    flux_file_log=0, 
    Lmin=0, 
    Lmax=0, 
    Emin=0, 
    Emax=0, 
    T2=0, 
    I2=0, 
    T3=0, 
    I3=0, 
    zdepth=0, 
    target_index=+1)
AT (0, 0, 0) RELATIVE PREVIOUS
ROTATED (0, 0, 0) RELATIVE PREVIOUS
EXTEND %{
  t=rand01();
%}

COMPONENT diskchopper0 = DiskChopper(
    theta_0=5, 
    radius=0.25, 
    yheight=0.12, 
    nu=10, 
    nslit=1, 
    isfirst=0)
WHEN (chopper==0) AT (0, 0, 10) RELATIVE PREVIOUS
GROUP Disks

COMPONENT diskchopper1= DiskChopper(
    phase=45,
    theta_0=5, 
    radius=0.25, 
    yheight=0.12, 
    nu=10, 
    nslit=1, 
    isfirst=0)
WHEN (chopper==0) AT (0, 0, 0) RELATIVE PREVIOUS
GROUP Disks

COMPONENT diskArm = Arm()
WHEN (chopper==1) AT (0, 0, 0) RELATIVE PREVIOUS
GROUP Disks
EXTEND %{
  if (INSTRUMENT_GETPAR(chopper)==1) SCATTER;
%}

COMPONENT multi = MultiDiskChopper(
    slit_center="0 45",
    slit_width="5 5",
    radius=0.25, 
    delta_y=deltay,
    nu=10, 
    nslits=2, 
    isfirst=0, abs_out=1)
WHEN (chopper==1) AT (0, 0, 10) ABSOLUTE

COMPONENT Tofl = TOFLambda_monitor(
    tmin=0, 
    tmax=1e6, 
    filename="TOFlambda", 
    xwidth=0.05, 
    yheight=0.13, 
    Lmin=lambda-dlambda, 
    Lmax=lambda+dlambda)
AT (0, 0, 0.001) RELATIVE PREVIOUS

COMPONENT psd_monitor = PSD_monitor(
    filename="PSD", 
    xwidth=0.05, 
    yheight=0.13)
AT (0, 0, 0.001) RELATIVE PREVIOUS

FINALLY
%{
%}

END