syned 1.0.43__tar.gz → 1.0.44__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {syned-1.0.43 → syned-1.0.44}/PKG-INFO +15 -2
- {syned-1.0.43 → syned-1.0.44}/setup.py +1 -1
- {syned-1.0.43 → syned-1.0.44}/syned/widget/widget_decorator.py +2 -2
- {syned-1.0.43 → syned-1.0.44}/syned.egg-info/PKG-INFO +15 -2
- {syned-1.0.43 → syned-1.0.44}/syned.egg-info/SOURCES.txt +0 -5
- syned-1.0.43/examples/__init__.py +0 -1
- syned-1.0.43/examples/example_beamline.py +0 -106
- syned-1.0.43/examples/example_double_slit.py +0 -67
- syned-1.0.43/examples/example_json_input_output.py +0 -111
- syned-1.0.43/syned/version.py +0 -11
- {syned-1.0.43 → syned-1.0.44}/LICENSE +0 -0
- {syned-1.0.43 → syned-1.0.44}/MANIFEST.in +0 -0
- {syned-1.0.43 → syned-1.0.44}/README.rst +0 -0
- {syned-1.0.43 → syned-1.0.44}/setup.cfg +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/beamline.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/beamline_element.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/element_coordinates.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_element.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_element_with_surface_shape.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/absorbers/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/absorbers/absorber.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/absorbers/beam_stopper.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/absorbers/filter.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/absorbers/holed_filter.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/absorbers/slit.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/crystals/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/crystals/crystal.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/gratings/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/gratings/grating.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/ideal_elements/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/ideal_elements/ideal_element.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/ideal_elements/ideal_fzp.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/ideal_elements/ideal_lens.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/ideal_elements/screen.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/mirrors/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/mirrors/mirror.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/refractors/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/refractors/crl.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/refractors/interface.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/refractors/lens.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/beamline/shape.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/storage_ring/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/storage_ring/electron_beam.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/storage_ring/empty_light_source.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/storage_ring/light_source.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/storage_ring/magnetic_structure.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/storage_ring/magnetic_structures/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/storage_ring/magnetic_structures/bending_magnet.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/storage_ring/magnetic_structures/insertion_device.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/storage_ring/magnetic_structures/undulator.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/storage_ring/magnetic_structures/wiggler.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/syned_object.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/util/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/util/json_tools.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned/widget/__init__.py +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned.egg-info/dependency_links.txt +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned.egg-info/not-zip-safe +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned.egg-info/requires.txt +0 -0
- {syned-1.0.43 → syned-1.0.44}/syned.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: syned
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.44
|
|
4
4
|
Summary: SYNED (SYNchrotron Elements Dictionary) kernel library
|
|
5
5
|
Home-page: https://github.com/oasys-kit/syned
|
|
6
6
|
Download-URL: https://github.com/oasys-kit/syned
|
|
@@ -26,6 +26,19 @@ License-File: LICENSE
|
|
|
26
26
|
Requires-Dist: setuptools
|
|
27
27
|
Requires-Dist: numpy
|
|
28
28
|
Requires-Dist: scipy
|
|
29
|
+
Dynamic: author
|
|
30
|
+
Dynamic: author-email
|
|
31
|
+
Dynamic: classifier
|
|
32
|
+
Dynamic: description
|
|
33
|
+
Dynamic: download-url
|
|
34
|
+
Dynamic: home-page
|
|
35
|
+
Dynamic: keywords
|
|
36
|
+
Dynamic: license
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
Dynamic: maintainer
|
|
39
|
+
Dynamic: maintainer-email
|
|
40
|
+
Dynamic: requires-dist
|
|
41
|
+
Dynamic: summary
|
|
29
42
|
|
|
30
43
|
=====
|
|
31
44
|
syned
|
|
@@ -24,14 +24,14 @@ class WidgetDecorator(object):
|
|
|
24
24
|
if not multi_input:
|
|
25
25
|
from orangewidget.widget import Input
|
|
26
26
|
|
|
27
|
-
return Input(name="
|
|
27
|
+
return Input(name="Syned Data",
|
|
28
28
|
type=Beamline,
|
|
29
29
|
id="SynedData",
|
|
30
30
|
default=True, auto_summary=False)
|
|
31
31
|
else:
|
|
32
32
|
from orangewidget.widget import MultiInput
|
|
33
33
|
|
|
34
|
-
return MultiInput(name="
|
|
34
|
+
return MultiInput(name="Syned Data",
|
|
35
35
|
type=Beamline,
|
|
36
36
|
id="SynedData",
|
|
37
37
|
default=True, auto_summary=False)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: syned
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.44
|
|
4
4
|
Summary: SYNED (SYNchrotron Elements Dictionary) kernel library
|
|
5
5
|
Home-page: https://github.com/oasys-kit/syned
|
|
6
6
|
Download-URL: https://github.com/oasys-kit/syned
|
|
@@ -26,6 +26,19 @@ License-File: LICENSE
|
|
|
26
26
|
Requires-Dist: setuptools
|
|
27
27
|
Requires-Dist: numpy
|
|
28
28
|
Requires-Dist: scipy
|
|
29
|
+
Dynamic: author
|
|
30
|
+
Dynamic: author-email
|
|
31
|
+
Dynamic: classifier
|
|
32
|
+
Dynamic: description
|
|
33
|
+
Dynamic: download-url
|
|
34
|
+
Dynamic: home-page
|
|
35
|
+
Dynamic: keywords
|
|
36
|
+
Dynamic: license
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
Dynamic: maintainer
|
|
39
|
+
Dynamic: maintainer-email
|
|
40
|
+
Dynamic: requires-dist
|
|
41
|
+
Dynamic: summary
|
|
29
42
|
|
|
30
43
|
=====
|
|
31
44
|
syned
|
|
@@ -2,13 +2,8 @@ LICENSE
|
|
|
2
2
|
MANIFEST.in
|
|
3
3
|
README.rst
|
|
4
4
|
setup.py
|
|
5
|
-
examples/__init__.py
|
|
6
|
-
examples/example_beamline.py
|
|
7
|
-
examples/example_double_slit.py
|
|
8
|
-
examples/example_json_input_output.py
|
|
9
5
|
syned/__init__.py
|
|
10
6
|
syned/syned_object.py
|
|
11
|
-
syned/version.py
|
|
12
7
|
syned.egg-info/PKG-INFO
|
|
13
8
|
syned.egg-info/SOURCES.txt
|
|
14
9
|
syned.egg-info/dependency_links.txt
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__author__ = 'srio'
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from syned.storage_ring.electron_beam import ElectronBeam
|
|
3
|
-
from syned.storage_ring.magnetic_structures.undulator import Undulator
|
|
4
|
-
from syned.storage_ring.light_source import LightSource
|
|
5
|
-
from syned.beamline.shape import *
|
|
6
|
-
|
|
7
|
-
from syned.beamline.optical_elements.ideal_elements.screen import Screen
|
|
8
|
-
from syned.beamline.optical_elements.ideal_elements.ideal_lens import IdealLens
|
|
9
|
-
from syned.beamline.optical_elements.absorbers.filter import Filter
|
|
10
|
-
from syned.beamline.optical_elements.absorbers.slit import Slit
|
|
11
|
-
from syned.beamline.optical_elements.absorbers.beam_stopper import BeamStopper
|
|
12
|
-
|
|
13
|
-
from syned.beamline.optical_elements.mirrors.mirror import Mirror
|
|
14
|
-
from syned.beamline.optical_elements.crystals.crystal import Crystal
|
|
15
|
-
from syned.beamline.optical_elements.gratings.grating import Grating
|
|
16
|
-
|
|
17
|
-
from syned.beamline.beamline import BeamlineElement, Beamline
|
|
18
|
-
from syned.beamline.element_coordinates import ElementCoordinates
|
|
19
|
-
|
|
20
|
-
from syned.util.json_tools import load_from_json_file
|
|
21
|
-
|
|
22
|
-
#
|
|
23
|
-
# example of setting a beamline in SYNED.
|
|
24
|
-
#
|
|
25
|
-
if __name__ == "__main__":
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
print("==================== LightSource: ==================")
|
|
29
|
-
|
|
30
|
-
src1 = ElectronBeam.initialize_as_pencil_beam(energy_in_GeV=6.0,current=0.2)
|
|
31
|
-
|
|
32
|
-
src2 = Undulator()
|
|
33
|
-
src2.set_value_from_key_name("K_horizontal",33)
|
|
34
|
-
# just to be sure...
|
|
35
|
-
assert (33 == src2.get_value_from_key_name("K_horizontal"))
|
|
36
|
-
|
|
37
|
-
src = LightSource("test",src1,src2)
|
|
38
|
-
|
|
39
|
-
# check file o/i for test
|
|
40
|
-
src.to_json("tmp.json") # write to file
|
|
41
|
-
tmp = load_from_json_file("tmp.json") # read from file
|
|
42
|
-
print("returned class: ", type(tmp))
|
|
43
|
-
print(src.to_dictionary())
|
|
44
|
-
print(tmp.to_dictionary())
|
|
45
|
-
assert(src.to_dictionary() == tmp.to_dictionary())
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
print("==================== Optical elements: ==================")
|
|
49
|
-
|
|
50
|
-
#
|
|
51
|
-
# ideal elements
|
|
52
|
-
#
|
|
53
|
-
|
|
54
|
-
screen1 = Screen("screen1")
|
|
55
|
-
lens1 = IdealLens("lens1",3.0)
|
|
56
|
-
|
|
57
|
-
#
|
|
58
|
-
# absorbers
|
|
59
|
-
#
|
|
60
|
-
filter1 = Filter("filter1","H2O",3.0e-6)
|
|
61
|
-
|
|
62
|
-
slit1 = Slit(name="slit1",boundary_shape=Rectangle(-0.5e-3,0.5e-3,-2e-3,2e-3))
|
|
63
|
-
|
|
64
|
-
slit2 = Slit(name="slit2")
|
|
65
|
-
slit2.set_rectangle(width=3e-4,height=5e-4)
|
|
66
|
-
slit2.set_circle(radius=3e-4)
|
|
67
|
-
|
|
68
|
-
stopper1 = BeamStopper(name="stopper1",boundary_shape=Rectangle(-0.5e-3,0.5e-3,-2e-3,2e-3))
|
|
69
|
-
|
|
70
|
-
stopper2 = BeamStopper(name="stopper2")
|
|
71
|
-
|
|
72
|
-
stopper2.set_rectangle(width=3e-4,height=5e-4)
|
|
73
|
-
stopper2.set_circle(radius=3e-4)
|
|
74
|
-
|
|
75
|
-
#
|
|
76
|
-
# elements with shape: mirror, gratings, crystals
|
|
77
|
-
#
|
|
78
|
-
|
|
79
|
-
mirror1 = Mirror(name="mirror1")
|
|
80
|
-
|
|
81
|
-
crystal1 = Crystal(name="crystal1")
|
|
82
|
-
|
|
83
|
-
grating1 = Grating(name="grating1")
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
print("==================== BeamLine: ==================")
|
|
87
|
-
|
|
88
|
-
beamline1 = Beamline()
|
|
89
|
-
|
|
90
|
-
beamline1.set_light_source(src)
|
|
91
|
-
|
|
92
|
-
list_oe = [screen1, lens1, filter1, slit1, slit2, stopper1, stopper2, mirror1, crystal1, grating1]
|
|
93
|
-
for i, optical_element in enumerate(list_oe):
|
|
94
|
-
coordinates=ElementCoordinates(p=1.1*i, q=1.2*i)
|
|
95
|
-
be = BeamlineElement(optical_element=optical_element, coordinates=coordinates)
|
|
96
|
-
beamline1.append_beamline_element(be)
|
|
97
|
-
|
|
98
|
-
print(beamline1.info())
|
|
99
|
-
|
|
100
|
-
# check file o/i for test
|
|
101
|
-
beamline1.to_json("tmp_beamline1.json")
|
|
102
|
-
tmp = load_from_json_file("tmp_beamline1.json")
|
|
103
|
-
print("returned class: ",type(tmp))
|
|
104
|
-
print(beamline1.to_dictionary())
|
|
105
|
-
print(tmp.to_dictionary())
|
|
106
|
-
assert(beamline1.to_dictionary() == tmp.to_dictionary())
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from syned.util.json_tools import load_from_json_file
|
|
3
|
-
|
|
4
|
-
from syned.storage_ring.electron_beam import ElectronBeam
|
|
5
|
-
from syned.storage_ring.magnetic_structures.undulator import Undulator
|
|
6
|
-
from syned.beamline.optical_elements.ideal_elements.screen import Screen
|
|
7
|
-
from syned.beamline.optical_elements.absorbers.slit import Slit
|
|
8
|
-
|
|
9
|
-
from syned.storage_ring.light_source import LightSource
|
|
10
|
-
|
|
11
|
-
from syned.beamline.beamline import Beamline
|
|
12
|
-
from syned.beamline.beamline_element import BeamlineElement
|
|
13
|
-
from syned.beamline.element_coordinates import ElementCoordinates
|
|
14
|
-
|
|
15
|
-
from syned.beamline.shape import MultiplePatch
|
|
16
|
-
|
|
17
|
-
# this is an example of a double slit (a slit with two rectangular apertures).
|
|
18
|
-
if __name__ == "__main__":
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# source
|
|
22
|
-
src1 = ElectronBeam.initialize_as_pencil_beam(energy_in_GeV=6.0,current=0.2)
|
|
23
|
-
src2 = Undulator()
|
|
24
|
-
|
|
25
|
-
lightsource1 = LightSource("test_source",src1, src2)
|
|
26
|
-
|
|
27
|
-
# check file o/i for test
|
|
28
|
-
lightsource1.to_json("tmp.json")
|
|
29
|
-
tmp = load_from_json_file("tmp.json")
|
|
30
|
-
print("returned class: ",type(tmp))
|
|
31
|
-
print(lightsource1.to_dictionary())
|
|
32
|
-
print(tmp.to_dictionary())
|
|
33
|
-
assert (lightsource1.to_dictionary() == tmp.to_dictionary())
|
|
34
|
-
|
|
35
|
-
#optical elements
|
|
36
|
-
patches = MultiplePatch()
|
|
37
|
-
patches.append_rectangle(-0.02,-0.01,-0.001,0.001)
|
|
38
|
-
patches.append_rectangle(0.01,0.02,-0.001,0.001)
|
|
39
|
-
slit1 = Slit(name="slit1", boundary_shape=patches)
|
|
40
|
-
|
|
41
|
-
# check file o/i for test individual elements
|
|
42
|
-
mylist = [src1, src2, slit1]
|
|
43
|
-
for i,element in enumerate(mylist):
|
|
44
|
-
element.to_json("tmp_%d.json"%i)
|
|
45
|
-
|
|
46
|
-
for i, element in enumerate(mylist):
|
|
47
|
-
print("\nloading element %d"%i)
|
|
48
|
-
tmp = load_from_json_file("tmp_%d.json"%i)
|
|
49
|
-
print("returned class: ",type(tmp))
|
|
50
|
-
print(mylist[i].to_dictionary())
|
|
51
|
-
print(tmp.to_dictionary())
|
|
52
|
-
assert (mylist[i].to_dictionary() == tmp.to_dictionary())
|
|
53
|
-
|
|
54
|
-
# test Beamline
|
|
55
|
-
|
|
56
|
-
bl_slit1 = BeamlineElement(optical_element=slit1, coordinates=ElementCoordinates(p=10.0,q=3.0))
|
|
57
|
-
BL = Beamline(light_source=lightsource1, beamline_elements_list=[bl_slit1])
|
|
58
|
-
|
|
59
|
-
# check file o/i for test full beamline
|
|
60
|
-
BL.to_json("tmp_bl.json")
|
|
61
|
-
tmp = load_from_json_file("tmp_bl.json")
|
|
62
|
-
print("returned class: ",type(tmp))
|
|
63
|
-
print(BL.to_dictionary())
|
|
64
|
-
print(tmp.to_dictionary())
|
|
65
|
-
assert(BL.to_dictionary() == tmp.to_dictionary())
|
|
66
|
-
|
|
67
|
-
print(BL.info())
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from syned.util.json_tools import load_from_json_file
|
|
3
|
-
|
|
4
|
-
from syned.storage_ring.electron_beam import ElectronBeam
|
|
5
|
-
from syned.storage_ring.magnetic_structures.undulator import Undulator
|
|
6
|
-
from syned.beamline.optical_elements.ideal_elements.screen import Screen
|
|
7
|
-
from syned.beamline.optical_elements.ideal_elements.ideal_lens import IdealLens
|
|
8
|
-
from syned.beamline.optical_elements.absorbers.filter import Filter
|
|
9
|
-
from syned.beamline.optical_elements.absorbers.slit import Slit
|
|
10
|
-
from syned.beamline.optical_elements.absorbers.beam_stopper import BeamStopper
|
|
11
|
-
from syned.beamline.optical_elements.mirrors.mirror import Mirror
|
|
12
|
-
from syned.beamline.optical_elements.crystals.crystal import Crystal
|
|
13
|
-
from syned.beamline.optical_elements.gratings.grating import Grating
|
|
14
|
-
|
|
15
|
-
from syned.beamline.shape import SurfaceShape, Conic, Ellipsoid, Plane, Toroid
|
|
16
|
-
from syned.beamline.shape import Rectangle
|
|
17
|
-
from syned.storage_ring.light_source import LightSource
|
|
18
|
-
|
|
19
|
-
from syned.beamline.beamline import Beamline
|
|
20
|
-
from syned.beamline.beamline_element import BeamlineElement
|
|
21
|
-
from syned.beamline.element_coordinates import ElementCoordinates
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if __name__ == "__main__":
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
src1 = ElectronBeam.initialize_as_pencil_beam(energy_in_GeV=6.0,current=0.2)
|
|
30
|
-
src2 = Undulator()
|
|
31
|
-
lightsource1 = LightSource("test_source", src1, src2)
|
|
32
|
-
|
|
33
|
-
screen1 = Screen("screen1")
|
|
34
|
-
lens1 = IdealLens(name="lens1",focal_y=6.0,focal_x=None,)
|
|
35
|
-
filter1 = Filter("filter1","H2O",3.0e-6)
|
|
36
|
-
slit1 = Slit(name="slit1",boundary_shape=Rectangle(-0.5e-3,0.5e-3,-2e-3,2e-3))
|
|
37
|
-
stopper1 = BeamStopper(name="stopper1",boundary_shape=Rectangle(-0.5e-3,0.5e-3,-2e-3,2e-3))
|
|
38
|
-
mirror1 = Mirror(name="mirror1",boundary_shape=Rectangle(-0.5e-3,0.5e-3,-2e-3,2e-3), surface_shape=Toroid())
|
|
39
|
-
grating1 = Grating(name="grating1",surface_shape=Conic())
|
|
40
|
-
crystal1 = Crystal(name="crystal1",surface_shape=Plane())
|
|
41
|
-
|
|
42
|
-
mylist = [lightsource1, screen1, lens1, filter1, slit1, stopper1, mirror1, crystal1, grating1]
|
|
43
|
-
|
|
44
|
-
#
|
|
45
|
-
# test individual elements
|
|
46
|
-
#
|
|
47
|
-
|
|
48
|
-
for i,element in enumerate(mylist):
|
|
49
|
-
element.to_json("tmp_%d.json"%i)
|
|
50
|
-
|
|
51
|
-
for i,element in enumerate(mylist):
|
|
52
|
-
print("loading element %d"%i)
|
|
53
|
-
tmp = load_from_json_file("tmp_%d.json"%i)
|
|
54
|
-
print("returned class: ",type(tmp))
|
|
55
|
-
print(element.to_dictionary())
|
|
56
|
-
print(tmp.to_dictionary())
|
|
57
|
-
# assert (element.to_dictionary() == tmp.to_dictionary())
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
#
|
|
62
|
-
# test full beamline
|
|
63
|
-
#
|
|
64
|
-
|
|
65
|
-
SCREEN1 = BeamlineElement(screen1, coordinates=ElementCoordinates(p=11.0))
|
|
66
|
-
LENS1 = BeamlineElement(lens1, coordinates=ElementCoordinates(p=12.0))
|
|
67
|
-
FILTER1 = BeamlineElement(filter1, coordinates=ElementCoordinates(p=13.0))
|
|
68
|
-
SLIT1 = BeamlineElement(slit1, coordinates=ElementCoordinates(p=15.0))
|
|
69
|
-
STOPPER1 = BeamlineElement(stopper1, coordinates=ElementCoordinates(p=16.0))
|
|
70
|
-
MIRROR1 = BeamlineElement(mirror1, coordinates=ElementCoordinates(p=17.0))
|
|
71
|
-
GRATING1 = BeamlineElement(grating1, coordinates=ElementCoordinates(p=18.0))
|
|
72
|
-
CRYSTAL1 = BeamlineElement(crystal1, coordinates=ElementCoordinates(p=19.0))
|
|
73
|
-
|
|
74
|
-
MyList = [SCREEN1,LENS1,FILTER1,SLIT1,STOPPER1,MIRROR1,CRYSTAL1,GRATING1]
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
#
|
|
78
|
-
# test BeamlineElement
|
|
79
|
-
#
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
# for i,element in enumerate(MyList):
|
|
83
|
-
#
|
|
84
|
-
# element.to_json("tmp_%d.json"%(100+i))
|
|
85
|
-
# tmp = load_from_json_file("tmp_%d.json"%(100+i))
|
|
86
|
-
# print("returned class: ",type(tmp))
|
|
87
|
-
# print("\n-----------Info on: \n",tmp.info(),"----------------\n\n")
|
|
88
|
-
|
|
89
|
-
#
|
|
90
|
-
# test Beamline
|
|
91
|
-
#
|
|
92
|
-
|
|
93
|
-
BL = Beamline(LightSource(name="test",electron_beam=src1,magnetic_structure=src2),
|
|
94
|
-
[SCREEN1,LENS1,FILTER1,SLIT1,STOPPER1,MIRROR1,CRYSTAL1,GRATING1])
|
|
95
|
-
|
|
96
|
-
BL.to_json("tmp_200.json")
|
|
97
|
-
|
|
98
|
-
tmp = load_from_json_file("tmp_200.json")
|
|
99
|
-
print("returned class: ",type(tmp))
|
|
100
|
-
print(BL.to_full_dictionary())
|
|
101
|
-
print(tmp.to_full_dictionary())
|
|
102
|
-
# assert(BL.to_full_dictionary() == tmp.to_full_dictionary())
|
|
103
|
-
|
|
104
|
-
#
|
|
105
|
-
# print(tmp.get_light_source().info())
|
|
106
|
-
# for element in tmp.get_beamline_elements():
|
|
107
|
-
# print("list element class: ",type(element))
|
|
108
|
-
# print(element.info())
|
|
109
|
-
# #
|
|
110
|
-
# #
|
|
111
|
-
# print("\n-----------Info on: \n",tmp.info(),"----------------\n\n")
|
syned-1.0.43/syned/version.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{syned-1.0.43 → syned-1.0.44}/syned/beamline/optical_elements/ideal_elements/ideal_element.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|