Offline Calculator
offline_calculator
Attributes
Classes
TFS_Calculator
Bases: object
Source code in tfs/offline_calculator.py
Attributes
Functions
check_forbidden
Source code in tfs/offline_calculator.py
combinations
All possible combinations of the given lenses
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Returns
|
|
required | |
combos
|
List of LensConnect objects |
required |
Source code in tfs/offline_calculator.py
find_solution
Find a combination to reach a specific focus
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
The desired position of the focal plane in accelerator coordinates |
required | |
n
|
int
|
The maximum number of lenses in a valid combination. This saves time by avoiding calculating the focal plane of combinations with a large number of lenses |
4
|
z_obj
|
float
|
The source point of the beam |
0.0
|
Returns:
| Name | Type | Description |
|---|---|---|
array |
LensConnect
|
An array of lens combinations with the closest possible image to the target_image |
Steps |
|
|
1) find the right pre-focussing lens. These are pre-defined based on
|
|
|
the photon energy (see prefocus_energy_range) and add it to the combos.
|
|
|
2) Calculate the focus and the difference to the target for each TFS
|
|
|
lens combination.
|
|
|
3) Pick the combo with the smallest difference
|
|