Home

Introduction

The apres (APerture REconstruction Suite) package facilitates the automated reconstruction of mechanical apertures in accelerating rings and linacs alike. By leveraging the detailed and updated mechanical modeling from the CAD team, electrical apertures can be automatically reconstructed with the addition or replacement of new hardware along the beamline.

Implementation

Firstly the Aperture object must be imported and instantiated.

from glob import glob

from apres.apres import Aperture

files = glob('*.stl')[:5]
ps = Aperture(files)

For apertures with non-linear geometries, a reference radius and origin should be defined.

from apres.shapes import IrregularRoundedPolygon

ps.reference = IrregularRoundedPolygon().radius,
ps.origin = (0, 0, 1260),

By default, the instantiated object will load the defined mesh files, addeding to the tri attribute which can be depicted using the show() method.

ps.show()

PS Cartesian

The linearize method must be used to convert cartesian toroidal geometries to curvilinear toroidal-poloidal coordianates.

ps.linearize()
ps.show()

PS Linearized

One can then pass a light source along the aperture center and compute ray intersections using the inflate method. Ray source densities can also be specified for higher resolution apertures.

pz.nth = 8
ps.nz = 1000
ps.inflate()

ps.plot_aperture()

PS Aperture

Upon further inspection, one can notice details of certain aperture features such as bellows and pumpout ports.

Bellows

The aperture intersection information is stored in .npy files adjacent to the source .stl.

Inflating across the whole PS for example yields the following aperture reconstruction.

PS Aperture (Full)

And again we can observe further detail upon zooming in.

PS Aperture (Zoomed)