Skip to content

Focus scan

focus_scan(camera, start=1, end=299, step=1)

Runs through transfocator Z to find the best focus

Parameters

camera: str, required camera where you want to focus

int, optional

step size of transfocator movements

int, optional

starting transfocator position

int, optional

final transfocator position

Examples: mfx dg1 yag is MFX:DG1:P6740 mfx dg2 yag is MFX:DG2:P6740 mfx dg3 yag is MFX:GIGE:02:IMAGE1

Operations

Source code in mfx/focus_scan.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def focus_scan(camera, start=1, end=299, step=1):
    """
    Runs through transfocator Z to find the best focus

    Parameters
    ----------
    camera: str, required
        camera where you want to focus

    step: int, optional
	step size of transfocator movements

    start: int, optional
	starting transfocator position

    end: int, optional
	final transfocator position

    Examples:
    mfx dg1 yag is MFX:DG1:P6740
    mfx dg2 yag is MFX:DG2:P6740
    mfx dg3 yag is MFX:GIGE:02:IMAGE1

    Operations
    ----------

    """
    # cd /reg/g/pcds/pyps/apps/hutch-python/mfx/mfx
    # from mfx.transfocator_scan import *
    from mfx.transfocator_scan import transfocator_aligner
    import numpy as np
    from mfx.db import tfs

    trf_align = transfocator_aligner(camera)
    trf_pos = np.arange(start, end, step)
    trf_align.scan_transfocator(tfs.translation,trf_pos,1)