Skip to content

Detector image

detector_image(node=5, det='Rayonix', calibdir=None, ave=1)

Launches detector monitor

Parameters

node: int, optional Node to run detector monitor 1-9 only

str, optional

Detector name. Example 'Rayonix'

str, optional

path to calib directory

int, optional

Average over this number of events

Operations

Source code in mfx/detector_image.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
37
38
39
def detector_image(node=5, det='Rayonix', calibdir=None, ave=1):
    """
    Launches detector monitor

    Parameters
    ----------
    node: int, optional
        Node to run detector monitor 1-9 only

    det: str, optional
        Detector name. Example 'Rayonix'

    calibdir: str, optional
        path to calib directory

    ave: int, optional
        Average over this number of events

    Operations
    ----------

    """
    import logging
    import subprocess
    from mfx.macros import get_exp

    experiment = str(get_exp())

    proc = [
        f"ssh -YAC mfxopr@daq-mfx-mon0{str(node)} "
        f"/cds/group/pcds/pyps/apps/hutch-python/mfx/scripts/"
        f"detector_image.sh {experiment} {str(det)} {str(calibdir)} {str(ave)}"
        ]

    logging.info(proc)

    subprocess.Popen(
        proc, shell=True, 
        stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)

detector_image_kill(node=5)

Kills all detector monitors made with this script

Parameters

node: int, optional Node to run detector monitor 1-9 only

str, optional

Detector name. Example 'Rayonix'

str, optional

path to calib directory

int, optional

Average over this number of events

Operations

Source code in mfx/detector_image.py
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
def detector_image_kill(node=5):
    """
    Kills all detector monitors made with this script

    Parameters
    ----------
    node: int, optional
        Node to run detector monitor 1-9 only

    det: str, optional
        Detector name. Example 'Rayonix'

    calibdir: str, optional
        path to calib directory

    ave: int, optional
        Average over this number of events

    Operations
    ----------

    """
    import logging
    import subprocess

    proc = [
        f"ssh -YAC mfxopr@daq-mfx-mon0{str(node)} " +
        f"/cds/group/pcds/pyps/apps/hutch-python/mfx/scripts/"
        f"detector_image_kill.sh"
        ]

    logging.info(proc)

    subprocess.Popen(
        proc, shell=True)