xcoll 0.5.0__py3-none-any.whl → 0.5.2__py3-none-any.whl
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.
Potentially problematic release.
This version of xcoll might be problematic. Click here for more details.
- xcoll/beam_elements/__init__.py +3 -2
- xcoll/beam_elements/base.py +1 -1
- xcoll/general.py +1 -1
- xcoll/initial_distribution.py +5 -5
- xcoll/interaction_record/interaction_record.py +3 -3
- xcoll/line_tools.py +3 -3
- {xcoll-0.5.0.dist-info → xcoll-0.5.2.dist-info}/METADATA +1 -1
- {xcoll-0.5.0.dist-info → xcoll-0.5.2.dist-info}/RECORD +11 -11
- {xcoll-0.5.0.dist-info → xcoll-0.5.2.dist-info}/LICENSE +0 -0
- {xcoll-0.5.0.dist-info → xcoll-0.5.2.dist-info}/NOTICE +0 -0
- {xcoll-0.5.0.dist-info → xcoll-0.5.2.dist-info}/WHEEL +0 -0
xcoll/beam_elements/__init__.py
CHANGED
|
@@ -10,7 +10,8 @@ from .blowup import BlowUp
|
|
|
10
10
|
from .monitor import EmittanceMonitor
|
|
11
11
|
|
|
12
12
|
block_classes = tuple(v for v in globals().values()
|
|
13
|
-
if isinstance(v, type) and issubclass(v, BaseBlock) and v != BaseBlock
|
|
13
|
+
if isinstance(v, type) and issubclass(v, BaseBlock) and v != BaseBlock
|
|
14
|
+
and v != BaseCollimator and v != BaseCrystal)
|
|
14
15
|
# Includes crystals
|
|
15
16
|
collimator_classes = tuple(v for v in globals().values()
|
|
16
17
|
if isinstance(v, type) and (issubclass(v, BaseCollimator) or issubclass(v, BaseCrystal))
|
|
@@ -18,7 +19,7 @@ collimator_classes = tuple(v for v in globals().values()
|
|
|
18
19
|
crystal_classes = tuple(v for v in globals().values()
|
|
19
20
|
if isinstance(v, type) and issubclass(v, BaseCrystal) and v != BaseCrystal)
|
|
20
21
|
|
|
21
|
-
element_classes = block_classes +
|
|
22
|
+
element_classes = block_classes + (BlowUp, EmittanceMonitor)
|
|
22
23
|
|
|
23
24
|
_all_collimator_classes = collimator_classes
|
|
24
25
|
_all_crystal_classes = crystal_classes
|
xcoll/beam_elements/base.py
CHANGED
|
@@ -629,7 +629,7 @@ class BaseCollimator(BaseBlock):
|
|
|
629
629
|
raise ValueError("When using `twiss`, need to provide the name as well.")
|
|
630
630
|
else:
|
|
631
631
|
tw_up = twiss.rows[name]
|
|
632
|
-
tw_down = twiss.rows[twiss.
|
|
632
|
+
tw_down = twiss.rows[twiss.rows.indices[[name]]+1]
|
|
633
633
|
if not np.isclose(tw_up.s[0] + self.length, tw_down.s[0]):
|
|
634
634
|
raise ValueError(f"Downstream twiss not compatible with length {self.length}m.")
|
|
635
635
|
self._optics = {
|
xcoll/general.py
CHANGED
xcoll/initial_distribution.py
CHANGED
|
@@ -61,13 +61,13 @@ def generate_pencil_on_collimator(line, name, num_particles, *, side='+-', penci
|
|
|
61
61
|
if is_converging:
|
|
62
62
|
# pencil at front of jaw
|
|
63
63
|
match_at_s = s_front
|
|
64
|
-
sigma = beam_sizes.rows[name:f'{name}
|
|
65
|
-
sigma_transv = beam_sizes.rows[name:f'{name}
|
|
64
|
+
sigma = beam_sizes.rows[name:f'{name}>>1'][f'sigma_{plane}'][0]
|
|
65
|
+
sigma_transv = beam_sizes.rows[name:f'{name}>>1'][f'sigma_{transv_plane}'][0]
|
|
66
66
|
else:
|
|
67
67
|
# pencil at back of jaw
|
|
68
68
|
match_at_s = s_back
|
|
69
|
-
sigma = beam_sizes.rows[name:f'{name}
|
|
70
|
-
sigma_transv = beam_sizes.rows[name:f'{name}
|
|
69
|
+
sigma = beam_sizes.rows[name:f'{name}>>1'][f'sigma_{plane}'][1]
|
|
70
|
+
sigma_transv = beam_sizes.rows[name:f'{name}>>1'][f'sigma_{transv_plane}'][1]
|
|
71
71
|
dr_sigmas = pencil_spread/sigma
|
|
72
72
|
|
|
73
73
|
# Generate 4D coordinates
|
|
@@ -157,7 +157,7 @@ def generate_delta_from_dispersion(line, at_element, *, plane, position_mm, nemi
|
|
|
157
157
|
twiss = line.twiss()
|
|
158
158
|
|
|
159
159
|
beam_sizes = twiss.get_beam_covariance(nemitt_x=nemitt_x, nemitt_y=nemitt_y)
|
|
160
|
-
beam_sizes = beam_sizes.rows[at_element:f'{at_element}
|
|
160
|
+
beam_sizes = beam_sizes.rows[at_element:f'{at_element}>>1'][f'sigma_{plane}']
|
|
161
161
|
sigma = beam_sizes[0] if match_at_front else beam_sizes[1]
|
|
162
162
|
delta = (position_mm - betatron_cut*sigma - twiss.rows[at_element][plane])
|
|
163
163
|
delta /= twiss.rows[at_element][f'd{plane}']
|
|
@@ -264,7 +264,7 @@ class InteractionRecord(xt.BeamElement):
|
|
|
264
264
|
|
|
265
265
|
|
|
266
266
|
def _get_xcoll_elements(line=None, elements=None, names=None):
|
|
267
|
-
from xcoll import
|
|
267
|
+
from xcoll.beam_elements import block_classes
|
|
268
268
|
if names is not None and names is not False and \
|
|
269
269
|
(not hasattr(names, '__iter__') or isinstance(names, str)):
|
|
270
270
|
names = [names]
|
|
@@ -278,7 +278,7 @@ def _get_xcoll_elements(line=None, elements=None, names=None):
|
|
|
278
278
|
if elements is not None and elements is not False:
|
|
279
279
|
raise ValueError("Cannot provide both line and elements!")
|
|
280
280
|
if names is None or names is True:
|
|
281
|
-
elements, names = line.get_elements_of_type(
|
|
281
|
+
elements, names = line.get_elements_of_type(block_classes)
|
|
282
282
|
if len(names) == 0:
|
|
283
283
|
raise ValueError("No Xcoll elements in line!")
|
|
284
284
|
elif names is False:
|
|
@@ -291,7 +291,7 @@ def _get_xcoll_elements(line=None, elements=None, names=None):
|
|
|
291
291
|
raise ValueError(f"Element {name} not found in line!")
|
|
292
292
|
elements = [line[name] for name in names]
|
|
293
293
|
for idx, element in enumerate(elements):
|
|
294
|
-
if not isinstance(element,
|
|
294
|
+
if not isinstance(element, block_classes):
|
|
295
295
|
name = name[idx] if names is not None else element.__class__.__name__
|
|
296
296
|
raise ValueError(f"Element {name} not an Xcoll element!")
|
|
297
297
|
return elements, names
|
xcoll/line_tools.py
CHANGED
|
@@ -26,9 +26,9 @@ def get_optics_at(names, *, twiss=None, line=None):
|
|
|
26
26
|
twiss = line.twiss()
|
|
27
27
|
if not hasattr(names, '__iter__') and not isinstance(names, str):
|
|
28
28
|
names = [names]
|
|
29
|
-
|
|
30
|
-
tw_entry = twiss.rows[
|
|
31
|
-
tw_exit = twiss.rows[
|
|
29
|
+
coll_entry_indices = twiss.rows.indices[names]
|
|
30
|
+
tw_entry = twiss.rows[coll_entry_indices]
|
|
31
|
+
tw_exit = twiss.rows[coll_entry_indices+1]
|
|
32
32
|
tw_exit.name = tw_entry.name
|
|
33
33
|
return tw_entry, tw_exit
|
|
34
34
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
2
2
|
NOTICE,sha256=6DO_E7WCdRKc42vUoVVBPGttvQi4mRt9fAcxj9u8zy8,74
|
|
3
3
|
xcoll/__init__.py,sha256=dUv7QzbojU0SfOiKPe6-XThev2ir9jhqzRIUhTz8y84,1021
|
|
4
|
-
xcoll/beam_elements/__init__.py,sha256=
|
|
4
|
+
xcoll/beam_elements/__init__.py,sha256=gJRYzcDjoimFrHiLvYQYLDtP_5A97Qbg0XL6q-j2uC4,1210
|
|
5
5
|
xcoll/beam_elements/absorber.py,sha256=teLGFiO22S8ItXa3ftsjg7oAN7Ypw0iJhkJmjbtGlL4,2502
|
|
6
|
-
xcoll/beam_elements/base.py,sha256=
|
|
6
|
+
xcoll/beam_elements/base.py,sha256=vX3fvRgGa-penwdpUnyHIa8WMIwzcbFDx2S1Ezv7F7E,50922
|
|
7
7
|
xcoll/beam_elements/blowup.py,sha256=0YdKTzMRt_ABGyFwHvnnYFBq0oHMs0ezHrU3hUTMp7Q,7879
|
|
8
8
|
xcoll/beam_elements/elements_src/black_absorber.h,sha256=ERDortSn5pVFec-9b9DWkHQEkgfHKeUDNqeJ6-DU5Zg,5027
|
|
9
9
|
xcoll/beam_elements/elements_src/black_crystal.h,sha256=rrrQ9RW8ltiZ47-w2ZZM91iLBEwn4C5SJrwQiiXBJ4M,4622
|
|
@@ -15,16 +15,16 @@ xcoll/beam_elements/elements_src/everest_crystal.h,sha256=UCLq62yKoKq-qrfrX8naWU
|
|
|
15
15
|
xcoll/beam_elements/everest.py,sha256=jlPDmUq11DFxJXuT1f-GVYI18aKo7PMwzGjnPa8Yqls,8367
|
|
16
16
|
xcoll/beam_elements/monitor.py,sha256=yInXQYVDM_9opcp7CyywUBsAJbSr3B18ZjkKmlOK7b4,16778
|
|
17
17
|
xcoll/colldb.py,sha256=rSSR_j19tsPAWBGZYnFVgOMEP2fbywhfXA0WiVN8Wkw,31027
|
|
18
|
-
xcoll/general.py,sha256=
|
|
18
|
+
xcoll/general.py,sha256=wK6veBvEA_MhE0ux3hmOc4uJkD2FzpZ1QY3vBocghNY,534
|
|
19
19
|
xcoll/headers/checks.h,sha256=IMLhQMnh3t-t9UhVK-1hfS4GVgl2Mry69H_17By00M0,1582
|
|
20
20
|
xcoll/headers/particle_states.h,sha256=WCzeHAniEK7sX7HTwhoIgewioQ7SibGn01RLrhVI98k,840
|
|
21
|
-
xcoll/initial_distribution.py,sha256=
|
|
21
|
+
xcoll/initial_distribution.py,sha256=RWPwBqusqgdBxeeIgJiyZK4bfiOJ4KCmAalkx6zQxEY,8404
|
|
22
22
|
xcoll/install.py,sha256=v9TdrKa7hjwFH25WN8mQ21Yy6qV3jW3NAH4YhBvEibw,7685
|
|
23
23
|
xcoll/interaction_record/__init__.py,sha256=UFoLiKa-z2oX7YoszP-7Vgdt1nM6kT382v1CaIu8_u0,50
|
|
24
|
-
xcoll/interaction_record/interaction_record.py,sha256=
|
|
24
|
+
xcoll/interaction_record/interaction_record.py,sha256=QzkK27-KAztWD__3l97dB-GvNrB6RJgZnKmGVMppDQ4,13192
|
|
25
25
|
xcoll/interaction_record/interaction_record_src/interaction_record.h,sha256=YCJLbk1dUcuj-I935K8iFwqDDja4afGB9bJ5jNWJSpo,6067
|
|
26
26
|
xcoll/interaction_record/interaction_types.py,sha256=_UGq-PBq30hj1lp29CpNTmmwzsP7tuCng8ZIAALnzCc,2894
|
|
27
|
-
xcoll/line_tools.py,sha256=
|
|
27
|
+
xcoll/line_tools.py,sha256=Zt1VpBwtF_5zm-OMaEYOg6zdxLgk7ZsnCXkalQ41pJQ,3270
|
|
28
28
|
xcoll/lossmap.py,sha256=VOck3CFvra0BUgKzzP2ddmN8bSnSMUXQg01FCmeSBrU,8091
|
|
29
29
|
xcoll/manager.py,sha256=Uy58saX2836q_CZjNa5at611k38Za_L9jQSTqBQXooA,343
|
|
30
30
|
xcoll/rf_sweep.py,sha256=5ABhou9cZcLYQ8DSPYowPpLCea8zJQyhWgUa7JUHJIg,8936
|
|
@@ -406,8 +406,8 @@ xcoll/scattering_routines/geometry/objects.h,sha256=lNFEfqrSDnJuB6sKh59bbg52bGqO
|
|
|
406
406
|
xcoll/scattering_routines/geometry/rotation.h,sha256=AvNwcqAAlhjEUtSbTqi53BTvzR256gtfUYcM5jlXUco,701
|
|
407
407
|
xcoll/scattering_routines/geometry/segments.h,sha256=IAz4IWvarIIpX7Waph-Hh2j6o6n_2uCPmHxxQp8Q3yg,7667
|
|
408
408
|
xcoll/scattering_routines/geometry/sort.h,sha256=wNdQLwEn58jgeSG4B9x-jfm7vOjN4hnAlxZ3SG-SkWg,5763
|
|
409
|
-
xcoll-0.5.
|
|
410
|
-
xcoll-0.5.
|
|
411
|
-
xcoll-0.5.
|
|
412
|
-
xcoll-0.5.
|
|
413
|
-
xcoll-0.5.
|
|
409
|
+
xcoll-0.5.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
410
|
+
xcoll-0.5.2.dist-info/METADATA,sha256=UicliZTLYRdKGKu--FRIX__QNiUGMDp0METIB-1CqSI,2709
|
|
411
|
+
xcoll-0.5.2.dist-info/NOTICE,sha256=6DO_E7WCdRKc42vUoVVBPGttvQi4mRt9fAcxj9u8zy8,74
|
|
412
|
+
xcoll-0.5.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
413
|
+
xcoll-0.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|