File: Test_SasView_guinier.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 (127 lines) | stat: -rw-r--r-- 3,860 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
/*******************************************************************************
*
* McStas, neutron ray-tracing package
*         Copyright (C) 1997-2008, All rights reserved
*         Risoe National Laboratory, Roskilde, Denmark
*         Institut Laue Langevin, Grenoble, France
*
* Instrument: test_SasView_guinier
*
* %Identification
* Written by: Jose Robledo
* Origin: FZJ / DTU / ESS DMSC
* 
*
* %INSTRUMENT_SITE: Templates
*
* Test instrument for the SasView guinier model component as sample description.
*
* %Description
*
* Very simple test instrument for the SasView_guinier component
*
* %Example: model_scale=1 Detector: detector_I=0.445598
*
* %Parameters
* rg: ([-inf, inf]) Radius of Gyration.
* lambda: [AA]   Mean wavelength of neutrons.
* dlambda: [AA]  Wavelength spread of neutrons.
* model_abs: [ ] Absorption cross section density at 2200 m/s.
* model_scale: [ ] Global scale factor for scattering kernel. For systems without inter-particle interference, the form factors can be related to the scattering intensity by the particle volume fraction.
* xwidth: [m] ([-inf, inf]) Horiz. dimension of sample, as a width.
* yheight: [m] ([-inf, inf]) vert . dimension of sample, as a height for cylinder/box
* zdepth: [m] ([-inf, inf]) depth of sample
* R: [m] Outer radius of sample in (x,z) plane for cylinder/sphere.
* target_x: [m] relative focus target position.
* target_y: [m] relative focus target position.
* target_z: [m] relative focus target position.
* target_index: [ ] Relative index of component to focus at, e.g. next is +1.
* focus_xw: [m] horiz. dimension of a rectangular area.
* focus_yh: [m], vert. dimension of a rectangular area.
* focus_aw: [deg], horiz. angular dimension of a rectangular area.
* focus_ah: [deg], vert. angular dimension of a rectangular area.
* focus_r: [] 
*
* %Link
* %End
*******************************************************************************/
DEFINE INSTRUMENT test_SasView_guinier(
      lambda=6,
      dlambda=0.05,
      
      rg=60.0,


      model_scale=1.0,
      model_abs=0.0,
      xwidth=0.01,
      yheight=0.01,
      zdepth=0.005,  
      R=0,
      int target_index=1,
      target_x=0,
      target_y=0,
      target_z=1,
      focus_xw=0.5,
      focus_yh=0.5,
      focus_aw=0,
      focus_ah=0,
      focus_r=0)
      
DECLARE %{
%}

INITIALIZE %{
%}

TRACE

COMPONENT a1 = Progress_bar()
  AT (0,0,0) ABSOLUTE

COMPONENT arm = Arm(
    )
  AT (0, 0, 0) ABSOLUTE
COMPONENT source = Source_simple(
    radius = 0.02, dist = 3, focus_xw = 0.01, focus_yh = 0.01,
    lambda0 = lambda, dlambda = dlambda, flux = 1e10)
  AT (0, 0, 0) RELATIVE arm

COMPONENT coll1 = Slit(
    radius = 0.005)
  AT (0, 0, 3) RELATIVE arm

COMPONENT coll2 = Slit(
    radius = 0.005)
  AT (0, 0, 6) RELATIVE arm

COMPONENT sample_arm = Arm()
AT (0,0,target_z) RELATIVE coll2


SPLIT COMPONENT sample = SasView_guinier(
        rg=rg,
        model_scale=model_scale, model_abs=model_abs, xwidth=xwidth,
        yheight=yheight, zdepth=zdepth, R=R, target_x=target_x,
        target_y=target_y, target_z=target_z, target_index=target_index,
        focus_xw=focus_xw, focus_yh=focus_yh, focus_aw=focus_aw, focus_ah=focus_ah,focus_r=focus_r)
AT (0,0,0) RELATIVE sample_arm
EXTEND %{
       if (!SCATTERED) ABSORB;
%}

COMPONENT detector = PSD_monitor(
    nx = 128, ny = 128, filename = "PSD.dat", xwidth=focus_xw, yheight=focus_yh)
  AT (target_x, target_y, target_z) RELATIVE sample_arm

COMPONENT Ldetector = L_monitor(
    nL = 200, filename = "Edet.dat", xwidth=focus_xw, yheight=focus_yh,
    Lmin = lambda-dlambda*lambda,
    Lmax = lambda+dlambda*lambda)
  AT (target_x, target_y, target_z) RELATIVE sample_arm

COMPONENT PSDrad = PSD_monitor_rad(
    filename = "psd2.dat", filename_av = "psd2_av.dat", rmax = focus_xw)
  AT (target_x, target_y, target_z) RELATIVE sample_arm

END