syned 1.0.45__tar.gz → 1.0.47__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.45/syned.egg-info → syned-1.0.47}/PKG-INFO +1 -1
- {syned-1.0.45 → syned-1.0.47}/setup.py +1 -1
- syned-1.0.47/syned/beamline/optical_elements/multilayers/__init__.py +46 -0
- syned-1.0.47/syned/beamline/optical_elements/multilayers/multilayer.py +47 -0
- {syned-1.0.45 → syned-1.0.47}/syned/storage_ring/electron_beam.py +11 -9
- {syned-1.0.45 → syned-1.0.47/syned.egg-info}/PKG-INFO +1 -1
- {syned-1.0.45 → syned-1.0.47}/syned.egg-info/SOURCES.txt +2 -0
- {syned-1.0.45 → syned-1.0.47}/LICENSE +0 -0
- {syned-1.0.45 → syned-1.0.47}/MANIFEST.in +0 -0
- {syned-1.0.45 → syned-1.0.47}/README.rst +0 -0
- {syned-1.0.45 → syned-1.0.47}/setup.cfg +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/__test/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/__test/test.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/beamline.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/beamline_element.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/element_coordinates.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_element.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_element_with_surface_shape.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/absorbers/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/absorbers/absorber.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/absorbers/beam_stopper.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/absorbers/filter.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/absorbers/holed_filter.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/absorbers/slit.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/crystals/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/crystals/crystal.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/gratings/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/gratings/grating.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/ideal_elements/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/ideal_elements/ideal_element.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/ideal_elements/ideal_fzp.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/ideal_elements/ideal_lens.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/ideal_elements/screen.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/mirrors/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/mirrors/mirror.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/refractors/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/refractors/crl.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/refractors/interface.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/optical_elements/refractors/lens.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/beamline/shape.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/storage_ring/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/storage_ring/empty_light_source.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/storage_ring/light_source.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/storage_ring/magnetic_structure.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/storage_ring/magnetic_structures/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/storage_ring/magnetic_structures/bending_magnet.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/storage_ring/magnetic_structures/insertion_device.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/storage_ring/magnetic_structures/undulator.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/storage_ring/magnetic_structures/wiggler.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/syned_object.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/util/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/util/json_tools.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/widget/__init__.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned/widget/widget_decorator.py +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned.egg-info/dependency_links.txt +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned.egg-info/not-zip-safe +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned.egg-info/requires.txt +0 -0
- {syned-1.0.45 → syned-1.0.47}/syned.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# ----------------------------------------------------------------------- #
|
|
4
|
+
# Copyright (c) 2025, UChicago Argonne, LLC. All rights reserved. #
|
|
5
|
+
# #
|
|
6
|
+
# Copyright 2025. UChicago Argonne, LLC. This software was produced #
|
|
7
|
+
# under U.S. Government contract DE-AC02-06CH11357 for Argonne National #
|
|
8
|
+
# Laboratory (ANL), which is operated by UChicago Argonne, LLC for the #
|
|
9
|
+
# U.S. Department of Energy. The U.S. Government has rights to use, #
|
|
10
|
+
# reproduce, and distribute this software. NEITHER THE GOVERNMENT NOR #
|
|
11
|
+
# UChicago Argonne, LLC MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR #
|
|
12
|
+
# ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE. If software is #
|
|
13
|
+
# modified to produce derivative works, such modified software should #
|
|
14
|
+
# be clearly marked, so as not to confuse it with the version available #
|
|
15
|
+
# from ANL. #
|
|
16
|
+
# #
|
|
17
|
+
# Additionally, redistribution and use in source and binary forms, with #
|
|
18
|
+
# or without modification, are permitted provided that the following #
|
|
19
|
+
# conditions are met: #
|
|
20
|
+
# #
|
|
21
|
+
# * Redistributions of source code must retain the above copyright #
|
|
22
|
+
# notice, this list of conditions and the following disclaimer. #
|
|
23
|
+
# #
|
|
24
|
+
# * Redistributions in binary form must reproduce the above copyright #
|
|
25
|
+
# notice, this list of conditions and the following disclaimer in #
|
|
26
|
+
# the documentation and/or other materials provided with the #
|
|
27
|
+
# distribution. #
|
|
28
|
+
# #
|
|
29
|
+
# * Neither the name of UChicago Argonne, LLC, Argonne National #
|
|
30
|
+
# Laboratory, ANL, the U.S. Government, nor the names of its #
|
|
31
|
+
# contributors may be used to endorse or promote products derived #
|
|
32
|
+
# from this software without specific prior written permission. #
|
|
33
|
+
# #
|
|
34
|
+
# THIS SOFTWARE IS PROVIDED BY UChicago Argonne, LLC AND CONTRIBUTORS #
|
|
35
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
|
|
36
|
+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #
|
|
37
|
+
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UChicago #
|
|
38
|
+
# Argonne, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #
|
|
39
|
+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #
|
|
40
|
+
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #
|
|
41
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #
|
|
42
|
+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT #
|
|
43
|
+
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN #
|
|
44
|
+
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
|
|
45
|
+
# POSSIBILITY OF SUCH DAMAGE. #
|
|
46
|
+
# ----------------------------------------------------------------------- #
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# TODO: move this to syned
|
|
2
|
+
|
|
3
|
+
from syned.beamline.shape import SurfaceShape
|
|
4
|
+
from syned.beamline.optical_element_with_surface_shape import OpticalElementsWithSurfaceShape
|
|
5
|
+
|
|
6
|
+
class Multilayer(OpticalElementsWithSurfaceShape):
|
|
7
|
+
"""
|
|
8
|
+
Constructor.
|
|
9
|
+
|
|
10
|
+
Parameters
|
|
11
|
+
----------
|
|
12
|
+
name : str
|
|
13
|
+
The name of the optical element.
|
|
14
|
+
surface_shape : instance of SurfaceShape, optional
|
|
15
|
+
The geometry of the crystal surface. if None, it is initialized to SurfaceShape().
|
|
16
|
+
boundary_shape : instance of BoundaryShape, optional
|
|
17
|
+
The geometry of the slit aperture. if None, it is initialized to BoundaryShape().
|
|
18
|
+
structure : str, optional
|
|
19
|
+
The multilayer structure e.g. [B,W]x50+Si.
|
|
20
|
+
period : float, optional
|
|
21
|
+
The period of the repeated bilayer in A.
|
|
22
|
+
Gamma : float, optional
|
|
23
|
+
The gamma factor.
|
|
24
|
+
"""
|
|
25
|
+
def __init__(self,
|
|
26
|
+
name="Undefined",
|
|
27
|
+
surface_shape=SurfaceShape(),
|
|
28
|
+
boundary_shape=None,
|
|
29
|
+
structure='[B/W]x50+Si',
|
|
30
|
+
period=25.0,
|
|
31
|
+
Gamma=0.5,
|
|
32
|
+
):
|
|
33
|
+
|
|
34
|
+
super().__init__(name, surface_shape, boundary_shape)
|
|
35
|
+
self._structure = structure
|
|
36
|
+
self._period = period
|
|
37
|
+
self._Gamma = Gamma
|
|
38
|
+
# support text containg name of variable, help text and unit. Will be stored in self._support_dictionary
|
|
39
|
+
self._set_support_text([
|
|
40
|
+
("name", "Name" , "" ),
|
|
41
|
+
("surface_shape", "Surface shape", "" ),
|
|
42
|
+
("boundary_shape", "Boundary shape", "" ),
|
|
43
|
+
("structure", "structure ([Odd,Even]xN+Substrate)", "" ),
|
|
44
|
+
("period", "period of the repeated structure", "A"),
|
|
45
|
+
("Gamma", "Gamma factor [thickness ratio Even)/(Odd+Even)", ""),
|
|
46
|
+
] )
|
|
47
|
+
|
|
@@ -130,16 +130,18 @@ class ElectronBeam(SynedObject):
|
|
|
130
130
|
|
|
131
131
|
@classmethod
|
|
132
132
|
def _emittance_without_dispersion(cls, moment_ss, moment_sa, moment_aa):
|
|
133
|
-
return numpy.sqrt(moment_ss * moment_aa - moment_sa**2)
|
|
133
|
+
return float(numpy.sqrt(moment_ss * moment_aa - moment_sa**2))
|
|
134
134
|
|
|
135
135
|
@classmethod
|
|
136
136
|
def _emittance_with_dispersion(cls, moment_ss, moment_sa, moment_aa, energy_spread, dispersion_s, dispersion_a):
|
|
137
|
-
return numpy.sqrt((moment_ss + (dispersion_s * energy_spread) ** 2) *
|
|
138
|
-
|
|
137
|
+
return float(numpy.sqrt((moment_ss + (dispersion_s * energy_spread) ** 2) *
|
|
138
|
+
(moment_aa + (dispersion_a * energy_spread) ** 2) -
|
|
139
|
+
(moment_sa + dispersion_s * dispersion_a * energy_spread ** 2) ** 2))
|
|
139
140
|
|
|
140
141
|
@classmethod
|
|
141
142
|
def _get_twiss_from_moments(cls, moment_ss, moment_sa, moment_aa):
|
|
142
143
|
emittance = cls._emittance_without_dispersion(moment_ss, moment_sa, moment_aa)
|
|
144
|
+
|
|
143
145
|
if emittance == 0.0:
|
|
144
146
|
warnings.warn(message="All moments are 0.0 and the calculation is not possible. \u03b5 = \u03b1 = \u03b2 = \u03b3 = 0.0 is returned.",
|
|
145
147
|
category=UserWarning, stacklevel=2)
|
|
@@ -168,7 +170,7 @@ class ElectronBeam(SynedObject):
|
|
|
168
170
|
|
|
169
171
|
moment_sa = 0.0 if moment_sa == 0 else moment_sa # to avoid -0.0
|
|
170
172
|
|
|
171
|
-
return moment_ss, moment_sa, moment_aa
|
|
173
|
+
return float(moment_ss), float(moment_sa), float(moment_aa)
|
|
172
174
|
|
|
173
175
|
@classmethod
|
|
174
176
|
def _get_moments_with_dispersion(cls, moment_ss, moment_sa, moment_aa, energy_spread, dispersion_s, dispersion_a):
|
|
@@ -176,7 +178,7 @@ class ElectronBeam(SynedObject):
|
|
|
176
178
|
moment_sa_disp = moment_sa + dispersion_s * dispersion_a * (energy_spread ** 2)
|
|
177
179
|
moment_aa_disp = moment_aa + (dispersion_a * energy_spread) ** 2
|
|
178
180
|
|
|
179
|
-
return moment_ss_disp, moment_sa_disp, moment_aa_disp
|
|
181
|
+
return float(moment_ss_disp), float(moment_sa_disp), float(moment_aa_disp)
|
|
180
182
|
|
|
181
183
|
|
|
182
184
|
# --- GETTERS
|
|
@@ -195,7 +197,7 @@ class ElectronBeam(SynedObject):
|
|
|
195
197
|
|
|
196
198
|
moment_xx, _, moment_xpxp = self.get_moments_horizontal(dispersion)
|
|
197
199
|
|
|
198
|
-
return numpy.sqrt(moment_xx), numpy.sqrt(moment_xpxp)
|
|
200
|
+
return float(numpy.sqrt(moment_xx)), float(numpy.sqrt(moment_xpxp))
|
|
199
201
|
|
|
200
202
|
def get_sigmas_vertical(self, dispersion=True):
|
|
201
203
|
"""
|
|
@@ -209,7 +211,7 @@ class ElectronBeam(SynedObject):
|
|
|
209
211
|
"""
|
|
210
212
|
moment_yy, _, moment_ypyp = self.get_moments_vertical(dispersion)
|
|
211
213
|
|
|
212
|
-
return numpy.sqrt(moment_yy), numpy.sqrt(moment_ypyp)
|
|
214
|
+
return float(numpy.sqrt(moment_yy)), float(numpy.sqrt(moment_ypyp))
|
|
213
215
|
|
|
214
216
|
def get_sigmas_all(self, dispersion=True):
|
|
215
217
|
"""
|
|
@@ -237,7 +239,7 @@ class ElectronBeam(SynedObject):
|
|
|
237
239
|
( <x^2>, <x x'>, <x'^2>)
|
|
238
240
|
|
|
239
241
|
"""
|
|
240
|
-
if not dispersion: return self._moment_xx, self._moment_xxp, self._moment_xpxp
|
|
242
|
+
if not dispersion: return float(self._moment_xx), float(self._moment_xxp), float(self._moment_xpxp)
|
|
241
243
|
else: return self._get_moments_with_dispersion(self._moment_xx,
|
|
242
244
|
self._moment_xxp,
|
|
243
245
|
self._moment_xpxp,
|
|
@@ -256,7 +258,7 @@ class ElectronBeam(SynedObject):
|
|
|
256
258
|
|
|
257
259
|
"""
|
|
258
260
|
|
|
259
|
-
if not dispersion: return self._moment_yy, self._moment_yyp, self._moment_ypyp
|
|
261
|
+
if not dispersion: return float(self._moment_yy), float(self._moment_yyp), float(self._moment_ypyp)
|
|
260
262
|
else: return self._get_moments_with_dispersion(self._moment_yy,
|
|
261
263
|
self._moment_yyp,
|
|
262
264
|
self._moment_ypyp,
|
|
@@ -37,6 +37,8 @@ syned/beamline/optical_elements/ideal_elements/ideal_lens.py
|
|
|
37
37
|
syned/beamline/optical_elements/ideal_elements/screen.py
|
|
38
38
|
syned/beamline/optical_elements/mirrors/__init__.py
|
|
39
39
|
syned/beamline/optical_elements/mirrors/mirror.py
|
|
40
|
+
syned/beamline/optical_elements/multilayers/__init__.py
|
|
41
|
+
syned/beamline/optical_elements/multilayers/multilayer.py
|
|
40
42
|
syned/beamline/optical_elements/refractors/__init__.py
|
|
41
43
|
syned/beamline/optical_elements/refractors/crl.py
|
|
42
44
|
syned/beamline/optical_elements/refractors/interface.py
|
|
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
|
{syned-1.0.45 → syned-1.0.47}/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
|