Lens
lens
Basic Lens object handling
Attributes
LENS_MOTOR_PVS
module-attribute
LENS_MOTOR_PVS = {2: {'x': 'MFX:TFS:MMS:03', 'y': 'MFX:TFS:MMS:04'}, 3: {'x': 'MFX:TFS:MMS:05', 'y': 'MFX:TFS:MMS:06'}, 4: {'x': 'MFX:TFS:MMS:07', 'y': 'MFX:TFS:MMS:08'}, 5: {'x': 'MFX:TFS:MMS:09', 'y': 'MFX:TFS:MMS:10'}, 6: {'x': 'MFX:TFS:MMS:11', 'y': 'MFX:TFS:MMS:12'}, 7: {'x': 'MFX:TFS:MMS:13', 'y': 'MFX:TFS:MMS:14'}, 8: {'x': 'MFX:TFS:MMS:15', 'y': 'MFX:TFS:MMS:16'}, 9: {'x': 'MFX:TFS:MMS:17', 'y': 'MFX:TFS:MMS:18'}, 10: {'x': 'MFX:TFS:MMS:19', 'y': 'MFX:TFS:MMS:20'}}
Classes
LensCalcMixin
Mixin class to abstract focal length calculation from a variety of lens devices.
Relies on the following methods / attributes from the child class: - self.radius - self.z
Source code in tfs/lens.py
Functions
focus
image_from_obj
Method calculates the image distance in meters along the beam pipeline from a point of origin given the focal length of the lens, location of lens, and location of object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
z_obj
|
Location of object along the beamline in meters (m) |
required |
Returns:
| Type | Description |
|---|---|
image
|
Returns the distance z_im of the image along the beam pipeline from a point of origin in meters (m) |
Note
If the location of the object (z_obj) is equal to the focal length of the lens, this function will return infinity.
Source code in tfs/lens.py
LensConnect
Data structure for a basic system of lenses
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
Lens
|
Lens objects |
()
|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
Variable length argument list of the lenses in the system, their radii, z position, and focal length. |
()
|
Source code in tfs/lens.py
Attributes
effective_radius
property
Method calculates the effective radius of the lens array including prefocusing lens
Returns:
| Type | Description |
|---|---|
float
|
returns the effective radius of the lens array. |
nlens
property
Method calculates the total number of lenses in the Lens array.
Returns:
| Type | Description |
|---|---|
int
|
Returns the total number of lenses in the array. |
tfs_radius
property
Method calculates the effective radius of the lens array excluding prefocusing lens
Returns:
| Type | Description |
|---|---|
float
|
returns the effective radius of the lens array. |
Functions
connect
classmethod
image
Method recursively calculates the z location of the image of a system of lenses and returns it in meters (m)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
z_obj
|
Location of the object along the beam pipline from a designated point of origin in meters (m) |
required |
Returns:
| Type | Description |
|---|---|
float
|
returns the location z of a system of lenses in meters (m). |
Source code in tfs/lens.py
LensTripLimits
Bases: Device
Trip limits for a given pre-focus lens (or lack thereof).
MFXLens
Bases: InOutPVStatePositioner, LensCalcMixin
Data structure for basic Lens object
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prefix
|
str
|
Name of the state record that controls the PV |
required |
prefix_lens
|
str
|
Prefix for the PVs that contain focusing information |
required |
Source code in tfs/lens.py
Attributes
radius
property
Method converts the EPICS lens radius signal into a float that can be used for calculations.
Returns:
| Type | Description |
|---|---|
float
|
Returns the radius of the lens |
sig_focus
property
Method converts the EPICS focal length signal of the lens into a float
Returns:
| Type | Description |
|---|---|
float
|
Returns the focal length of the lens in meters |
x
class-attribute
instance-attribute
y
class-attribute
instance-attribute
z
property
Method converts the z position EPICS signal into a float.
Returns:
| Type | Description |
|---|---|
float
|
Returns the z position of the lens in meters along the beamline |
Functions
OnePVMotorRetry
Bases: OnePVMotor
OnePVMotor with a simple retry-to-tolerance move helper.
Usage: motor.mv_retry(target, retries=3, tolerance=1e-3)
Functions
mv_retry
Move to position with verify-and-retry until within tolerance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
float
|
Desired setpoint in engineering units. |
required |
retries
|
int
|
Number of additional attempts after the first move, by default 3. |
3
|
tolerance
|
float
|
Allowed absolute error |RBV - SP|, by default 1e-2. |
0.01
|
settle_time
|
float
|
Seconds to wait after move completion before checking RBV, by default 0.2. |
0.2
|
timeout
|
float | None
|
Move timeout passed through to the underlying move call. |
None
|