-
Notifications
You must be signed in to change notification settings - Fork 0
/
Simple2.py
executable file
·76 lines (54 loc) · 1.85 KB
/
Simple2.py
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
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Jiao Lin
# California Institute of Technology
# (C) 2005 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
__doc__ = """a simple instrument with just two components: source and monitor
"""
__author__ = 'Jiao Lin'
from mcni.pyre_support.Instrument import Instrument as base
class Instrument(base):
class Inventory( base.Inventory ):
from mcstas2.pyre_support import facility
source = facility( 'sources', 'Source_simple', 'source' )
monitor = facility( 'monitors', 'E_monitor', 'monitor' )
pass # end of Inventory
def __init__(self, name = 'simple2'):
base.__init__(self, name)
return
def _defaults(self):
base._defaults(self)
self.inventory.sequence = ['source', 'monitor']
geometer = self.inventory.geometer
geometer.inventory.source = (0,0,0), (0,0,0)
geometer.inventory.monitor = (0,0,10), (0,0,0)
source = self.inventory.source
source.inventory.dist = 10
source.inventory.xw = 0.1
source.inventory.yh = 0.1
source.inventory.radius = 0.02
source.inventory.E0 = 60
source.inventory.dE = 5
monitor = self.inventory.monitor
monitor.inventory.Emin = 10
monitor.inventory.Emax = 100
monitor.inventory.nchan = 20
monitor.inventory.xwidth = 0.1
monitor.inventory.yheight = 0.1
return
pass # end of Instrument
def main():
simple2=Instrument()
simple2.run()
return
if __name__ == '__main__' : main()
# version
__id__ = "$Id$"
# End of file