Skip to content

radial_build

Radial build lookup utilities used by geometry and magnet plots.

cumulative_radial_build(section, mfile, scan)

Function for calculating the cumulative radial build up to and including the given section.

Parameters:

Name Type Description Default
section

section of the radial build to go up to

required
mfile MFile

MFILE data object

required
scan int

scan number to use

required

Returns:

Type Description

cumulative_build:cumulative radial build up to section given

Source code in process/core/io/plot/summary/radial_build.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
def cumulative_radial_build(section, mfile: MFile, scan: int):
    """Function for calculating the cumulative radial build up to and
    including the given section.

    Parameters
    ----------
    section :
        section of the radial build to go up to
    mfile :
        MFILE data object
    scan :
        scan number to use

    Returns
    -------
    :
        cumulative_build:cumulative radial build up to section given
    """
    complete = False
    cumulative_build = 0
    for item in RADIAL_BUILD:
        if item in {"rminori", "rminoro"}:
            cumulative_build += mfile.get("rminor", scan=scan)
        elif item in {"vvblgapi", "vvblgapo"}:
            cumulative_build += mfile.get("dr_shld_blkt_gap", scan=scan)
        elif "dr_vv_inboard" in item:
            cumulative_build += mfile.get("dr_vv_inboard", scan=scan)
        elif "dr_vv_outboard" in item:
            cumulative_build += mfile.get("dr_vv_outboard", scan=scan)
        else:
            cumulative_build += mfile.get(item, scan=scan)
        if item == section:
            complete = True
            break

    if complete is False:
        print("radial build parameter ", section, " not found")
    return cumulative_build

cumulative_radial_build2(section, mfile, scan)

Function for calculating the cumulative radial build up to and including the given section.

Parameters:

Name Type Description Default
section

section of the radial build to go up to

required
mfile MFile

MFILE data object

required
scan int

scan number to use

required

Returns:

Type Description

cumulative_build → cumulative radial build up to and including section given previous → cumulative radial build up to section given

Source code in process/core/io/plot/summary/radial_build.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
def cumulative_radial_build2(section, mfile: MFile, scan: int):
    """Function for calculating the cumulative radial build up to and
    including the given section.

    Parameters
    ----------
    section :
        section of the radial build to go up to
    mfile :
        MFILE data object
    scan :
        scan number to use

    Returns
    -------
    :
        cumulative_build --> cumulative radial build up to and including
        section given
        previous         --> cumulative radial build up to section given
    """
    cumulative_build = 0
    build = 0
    for item in RADIAL_BUILD:
        if item in {"rminori", "rminoro"}:
            build = mfile.get("rminor", scan=scan)
        elif item in {"vvblgapi", "vvblgapo"}:
            build = mfile.get("dr_shld_blkt_gap", scan=scan)
        elif "dr_vv_inboard" in item:
            build = mfile.get("dr_vv_inboard", scan=scan)
        elif "dr_vv_outboard" in item:
            build = mfile.get("dr_vv_outboard", scan=scan)
        else:
            build = mfile.get(item, scan=scan)
        cumulative_build += build
        if item == section:
            break
    previous = cumulative_build - build
    return (cumulative_build, previous)