File: jupyter_demo.instr

package info (click to toggle)
python-mcstasscript 0.0.46%2Bgit20250402111921.bfa5a26-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,440 kB
  • sloc: python: 13,421; makefile: 14
file content (92 lines) | stat: -rw-r--r-- 2,199 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
/********************************************************************************
* 
* McStas, neutron ray-tracing package
*         Copyright (C) 1997-2008, All rights reserved
*         Risoe National Laboratory, Roskilde, Denmark
*         Institut Laue Langevin, Grenoble, France
* 
* This file was written by McStasScript, which is a 
* python based McStas instrument generator written by 
* Mads Bertelsen in 2019 while employed at the 
* European Spallation Source Data Management and 
* Software Center
* 
* Instrument jupyter_demo
* 
* %Identification
* Written by: Python McStas Instrument Generator
* Date: 08:19:46 on May 15, 2019
* Origin: ESS DMSC
* %INSTRUMENT_SITE: Generated_instruments
* 
* 
* %Parameters
* 
* %End 
********************************************************************************/

DEFINE INSTRUMENT jupyter_demo (
double wavelength = 3 // Wavelength emmited from source
)

DECLARE 
%{
%}

INITIALIZE 
%{
// Start of initialize for generated jupyter_demo
%}

TRACE 
COMPONENT Source = Source_simple(
 yheight = 0.08, xwidth = 0.06,
 dist = 2, focus_xw = 0.05,
 focus_yh = 0.05, lambda0 = wavelength,
 dlambda = 0.1)
AT (0,0,0) ABSOLUTE
ROTATED (0,0,0) ABSOLUTE

COMPONENT Guide = Guide_gravity(
 w1 = 0.05, h1 = 0.05,
 w2 = 0.05, h2 = 0.05,
 l = 8, m = 3.5,
 G = -9.2)
AT (0,0,2) RELATIVE Source
ROTATED (0,0,0) RELATIVE Source

COMPONENT sample = PowderN(
 reflections = "Cu.laz", radius = 0.015,
 yheight = 0.05)
AT (0,0,9) RELATIVE Guide
ROTATED (0,0,0) RELATIVE Guide

COMPONENT PSD_4PI = PSD_monitor_4PI(
 nx = 300, ny = 300,
 filename = "PSD_4PI.dat", radius = 1,
 restore_neutron = 1)
AT (0,0,0) RELATIVE sample
ROTATED (0,0,0) RELATIVE sample

COMPONENT PSD = PSD_monitor(
 nx = 200, ny = 200,
 filename = "PSD.dat", xwidth = 0.1,
 yheight = 0.1, restore_neutron = 1)
AT (0,0,1) RELATIVE sample
ROTATED (0,0,0) RELATIVE sample

// Wavelength monitor for narrow range
COMPONENT L_mon = L_monitor(
 nL = 150, filename = "L_mon.dat",
 xwidth = 0.1, yheight = 0.1,
 Lmin = wavelength - 0.3, Lmax = wavelength + 0.3,
 restore_neutron = 1)
AT (0,0,0) RELATIVE PSD
ROTATED (0,0,0) RELATIVE PSD

FINALLY 
%{
// Start of finally for generated jupyter_demo
%}

END