File: ISIS_IMAT.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 (214 lines) | stat: -rw-r--r-- 7,762 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
/*******************************************************************************
*
* Instrument: ISIS_IMAT_proto
* %Identification
* Written by: Genoveva Burca (Genoveva.Burca@stfc.ac.uk)
* Date: October 2017
* Version: 2017_01 
* Origin: ISIS
* %INSTRUMENT_SITE: ISIS
*
* IMAT: McStas instrument file of the imaging and diffraction parts of the IMAT instrument.
*
* %Description
*
* McStas instrument for simulating the IMAT - imaging and diffraction
* New McStas moderator file (G. Skoro, ISIS Facility) was added
* \\ISIS\Shares\NeutronicsTeam\TS-2\HydroMod_Upgrade\McStas_TS2_HydroMod_Base_newVirtMod_350mm\Let_Base.mcstas
* Components positions were extracted from IMAT final design (March 2016) 
* Choppers were not added to this model
* Diffraction detectors are
*
* IMPORTANT NOTES:
* 1. For reference use G. Burca et al., Modelling of an imaging beamline at the ISIS pulsed neutron source, 
* Journal of Instrumentation, 8 (2013), no 10, http://dx.doi.org/10.1088/1748-0221/8/10/P10001
* 2. Results from calculations published in the previous paper were obtained using McStas ISIS_moderator component (Face="W5")  
* 
*
* %Parameters
* INPUT PARAMETERS:
* l_min: [AA]   Low wavelength sampled.
* l_max: [AA]   High wavelength sampled.
* t_min: [t]    Low detector time limit.
* t_max: [t]    High detector time limit.
* theta: [deg]  Angle that the detector banks are set at.
*
* %Link 
* <a href="http://www.isis.stfc.ac.uk/instruments/imat">
* %End

*******************************************************************************/

DEFINE INSTRUMENT ISIS_IMAT(l_min=1, l_max=10, t_min=0, t_max=0.2, theta=90)

DECLARE
%{ 
	double e_min, e_max, SDD,SDI; 
%}

INITIALIZE 
%{ 
	e_min=81.799/l_max/l_max;
	e_max=81.799/l_min/l_min;
        /*sample-detector distance diffraction= 2 m.*/
        SDD=2;
%}

TRACE

COMPONENT Origin =Arm ()
  AT (0,0,0) ABSOLUTE

/* New McStas IMAT moderator component (L-H2)*/

COMPONENT moderator=ViewModISIS(Face="TS2.imat", E0 = e_min, E1 = e_max,
  modPosition=0, xw=0.004, yh = 0.01, dist = 56)  
AT (0.0, 0.0, 0.0) RELATIVE Origin

/*define the source_position for mantid*/
COMPONENT sourceMantid = Arm()
AT(0,0,0) RELATIVE moderator

/* Old version of McStas IMAT moderator L-H2/S-Ch4 (W5 port on TS-2) */
/*COMPONENT moderator = ISIS_moderator(Face ="w5", Emin = e_min, Emax = e_max, dist = 1.688,
    focus_xw = 0.11, focus_yh = 0.11, xwidth=0.11, yheight=0.11, CAngle = 0, SAC = 1, Lmin=l_min, Lmax=l_max)
  AT (0.0, 0.0, 0.00) RELATIVE Origin*/

COMPONENT lmon_s = L_monitor(xwidth=0.1, yheight=0.1, filename="lmon_s",Lmin=l_min, Lmax=l_max, nL=100)
AT(0,0,1e-3) RELATIVE Origin

COMPONENT shutter = Guide(
    w1 = 0.10, h1 = 0.10, w2 = 0.10, h2 = 0.10, l = 1.948, m = 3)
  AT (0.0, 0.0, 1.688) RELATIVE Origin
COMPONENT lmon1 = COPY(lmon_s)(filename="lmon1")
AT(0,0,1.948+1e-3) RELATIVE PREVIOUS

COMPONENT guide1 = Guide(
    w1 = 0.095, h1 = 0.095, w2 = 0.095, h2 = 0.095, l = 7.8125, m = 3)
  AT (0.0, 0.0, 3.7222) RELATIVE Origin

/* 2nd piece of guide before the 1st double disk chopper */  
COMPONENT guide2 = Guide(
    w1 = 0.095, h1 = 0.095, w2 = 0.095, h2 = 0.095, l = 0.4866, m = 3)
  AT (0.0, 0.0, 11.6797) RELATIVE Origin

/* 3rd piece of guide before T0 chopper */  
COMPONENT guide3 = Guide(
    w1 = 0.095, h1 = 0.095, w2 = 0.095, h2 = 0.095, l = 0.4556, m = 3)
  AT (0.0, 0.0, 12.2333) RELATIVE Origin

COMPONENT guide4 = Guide(
    w1 = 0.095, h1 = 0.095, w2 = 0.095, h2 = 0.095, l =6.757, m = 3)
  AT (0.0, 0.0, 13.0259) RELATIVE Origin

/* 5th piece of guide before the 2nd double disk chopper */
COMPONENT guide5 = Guide(
    w1 = 0.095, h1 = 0.095, w2 = 0.095, h2 = 0.095, l =0.52, m = 3)
  AT (0.0, 0.0, 19.8459) RELATIVE Origin

COMPONENT guide6 = Guide(
    w1 = 0.095, h1 = 0.095, w2 = 0.095, h2 = 0.095, l =0.428, m = 3)
  AT (0.0, 0.0, 20.4339) RELATIVE Origin
  
COMPONENT guide7 = Guide(
    w1 = 0.095, h1 = 0.095, w2 = 0.095, h2 = 0.095, l =24.582, m = 3)
  AT (0.0, 0.0, 21.0069) RELATIVE Origin

/* Pinhole selector could be one of 5, 10, 20, 40 or 80 mm for imaging or fully open position (e.g. 100mm) for diffraction*/
COMPONENT pinhole = Slit(radius = 0.05)
  AT (0.0, 0.0, 46) RELATIVE Origin

/* Five pairs of jaws for shaping and defining the beam size */  

COMPONENT slit1 = Slit(xwidth = 0.089882, yheight = 0.089882)
  AT (0.0, 0.0, 1.55731) RELATIVE pinhole

COMPONENT slit2 = Slit(xwidth = 0.08088, yheight = 0.08088)
  AT (0.0, 0.0, 2.94097) RELATIVE pinhole
  
COMPONENT slit3 = Slit(xwidth = 0.07168, yheight = 0.07168)
  AT (0.0, 0.0, 4.3562) RELATIVE pinhole

COMPONENT slit4 = Slit(xwidth = 0.06012, yheight = 0.06012)
  AT (0.0, 0.0, 6.13597) RELATIVE pinhole

COMPONENT slit5 = Slit(xwidth = 0.048549, yheight = 0.048549)
  AT (0.0, 0.0, 7.91614) RELATIVE pinhole

/* Slit 6 is used for diffraction measurements being possible to move it close to the sample */

COMPONENT slit6 = Slit(xwidth = 0.004, yheight = 0.15)
AT (0.0, 0.0, 55.996) RELATIVE Origin

/* Sample placed at 10m after the pinhole */

COMPONENT PSDpre = PSD_monitor(nx = 1024, ny = 1024, filename = "PSDpre.dat", xmin =-0.1, xmax =0.1, ymin = -0.1, ymax =0.1, restore_neutron=1)
AT (0.0, 0.0, 10.00) RELATIVE pinhole

// we can not use anymore the Lazy define with cogen3, as the vector assignment 
// must here be static, but the grammar tests for a '{' as fisrt char. The 'Lazy'
// #define is indeed a {value}, but not replaced before the code generation takes
// place.
COMPONENT sample = PowderN(reflections="Na2Ca3Al2F14.laz", radius = 0.002, yheight = 0.01,
        Vc = 1079.1, sigma_abs = 2.9464e-3, sigma_inc = 3.4176, d_phi=60, format={17,6,0,0,0,0,0,13,0 })
AT (0.0, 0.0, 56) RELATIVE Origin
EXTEND
%{
    if(!SCATTERED) ABSORB;
%}

/*define mantid sample point*/
COMPONENT sampleMantid = Arm()
AT(0,0,0) RELATIVE sample


/* Position sensitive detector for imaging setup; maximum field-of-view of 200 x 200 mm2 */
COMPONENT PSDdet = PSD_monitor(nx = 1024, ny = 1024, filename = "PSD.dat", xmin =-0.1, xmax =0.1, ymin = -0.1, ymax =0.1, restore_neutron=1)
AT (0.0, 0.0, 10.01) RELATIVE pinhole
GROUP imaging

COMPONENT catchall_PSDdet = Arm()
AT(0,0,0) RELATIVE PREVIOUS
GROUP imaging
EXTEND
%{
    SCATTER;
%}

COMPONENT psd4pi = PSD_monitor_4PI(radius=0.5, restore_neutron=1, filename="psd4pi")
AT(0,0,0) RELATIVE sample

COMPONENT north_a = Arm()
AT(0,0,0) RELATIVE sample
ROTATED (0, theta, 0) RELATIVE sample

COMPONENT south_a = Arm()
AT(0,0,0) RELATIVE sample
ROTATED (0,-theta,0) RELATIVE sample

/* Diffraction setup; pixel size of 4mm width x 100 mm height */
/*north bank - 2 flat detector modules*/
COMPONENT nD_Mantid_1 = Monitor_nD(
	xwidth=400e-3, yheight=100e-3, filename="north_1.dat",restore_neutron=1,
	options="mantid square x limits=[-200e-3,200e-3] bins=100, y limits=[-50e-3,50e-3] bins=2 neutron pixel t, list all neutrons")
AT(0,-(5e-3+50e-3),SDD) RELATIVE north_a 
GROUP detectors

COMPONENT nD_Mantid_2 = COPY(nD_Mantid_1)(filename="north_2.dat",
	options="mantid square x limits=[-200e-3,200e-3] bins=100, y limits=[-50e-3,50e-3] bins=2 neutron pixel min 200 t, list all neutrons")
AT(0,+(5e-3+50e-3),SDD) RELATIVE north_a
GROUP detectors

/*south bank - 2 flat detector modules*/
COMPONENT nD_Mantid_3 = Monitor_nD(
	xwidth=400e-3, yheight=100e-3, filename="south_1.dat",restore_neutron=1,
	options="mantid square x limits=[-200e-3,200e-3] bins=100, y limits=[-50e-3,50e-3] bins=2 neutron pixel min 400 t, list all neutrons")
AT(0,-(5e-3+50e-3),SDD) RELATIVE south_a 
GROUP detectors

COMPONENT nD_Mantid_4 = COPY(nD_Mantid_1)(filename="south_2.dat",
	options="mantid square x limits=[-200e-3,200e-3] bins=100, y limits=[-50e-3,50e-3] bins=2 neutron pixel min 600 t, list all neutrons")
AT(0,+(5e-3+50e-3),SDD) RELATIVE south_a
GROUP detectors

END