Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 37 additions & 32 deletions process/core/io/plot/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
PlasmaCurrentModel,
PlasmaDiamagneticCurrentModel,
)
from process.models.physics.solovev_equilibrium import plot_analytic_equilibrium
from process.models.superconductors import SuperconductorModel
from process.models.tfcoil.base import TFCoilShapeModel

Expand Down Expand Up @@ -13819,9 +13820,13 @@ def main_plot(

plot_larmor_radius_profile(figs[18].add_subplot(313), m_file, scan)

ax25 = figs[19].add_subplot(222, aspect="equal")
ax25.set_position([0.6, 0.55, 0.45, 0.45])
plot_analytic_equilibrium(ax25, m_file, scan, figs[19])

# Plot poloidal cross-section
poloidal_cross_section(
figs[19].add_subplot(121, aspect="equal"),
figs[20].add_subplot(121, aspect="equal"),
m_file,
scan,
demo_ranges,
Expand All @@ -13831,98 +13836,98 @@ def main_plot(

# Plot toroidal cross-section
toroidal_cross_section(
figs[19].add_subplot(122, aspect="equal"),
figs[20].add_subplot(122, aspect="equal"),
m_file,
scan,
demo_ranges,
colour_scheme,
)

# Plot color key
ax17 = figs[19].add_subplot(222)
ax17 = figs[20].add_subplot(222)
ax17.set_position([0.5, 0.5, 0.5, 0.5])
color_key(ax17, m_file, scan, colour_scheme)

plot_full_machine_poloidal_cross_section(
figs[20].add_subplot(111, aspect="equal"),
figs[21].add_subplot(111, aspect="equal"),
m_file,
scan,
radial_build,
colour_scheme,
)

ax18 = figs[21].add_subplot(211)
ax18 = figs[22].add_subplot(211)
ax18.set_position([0.1, 0.33, 0.8, 0.6])
plot_radial_build(ax18, m_file, colour_scheme)

# Make each axes smaller vertically to leave room for the legend
ax185 = figs[22].add_subplot(211)
ax185 = figs[23].add_subplot(211)
ax185.set_position([0.1, 0.61, 0.8, 0.32])

ax18b = figs[22].add_subplot(212)
ax18b = figs[23].add_subplot(212)
ax18b.set_position([0.1, 0.13, 0.8, 0.32])
plot_upper_vertical_build(ax185, m_file, colour_scheme)
plot_lower_vertical_build(ax18b, m_file, colour_scheme)

# Can only plot WP and turn structure if superconducting coil at the moment
if m_file.get("i_tf_sup", scan=scan) == 1:
# TF coil with WP
ax19 = figs[23].add_subplot(221, aspect="equal")
ax19 = figs[24].add_subplot(221, aspect="equal")
ax19.set_position([
0.025,
0.45,
0.5,
0.5,
]) # Half height, a bit wider, top left
plot_superconducting_tf_wp(ax19, m_file, scan, figs[23])
plot_superconducting_tf_wp(ax19, m_file, scan, figs[24])

# TF coil turn structure
ax20 = figs[24].add_subplot(325, aspect="equal")
ax20 = figs[25].add_subplot(325, aspect="equal")
ax20.set_position([0.025, 0.5, 0.4, 0.4])
plot_tf_cable_in_conduit_turn(ax20, figs[24], m_file, scan)
plot_205 = figs[24].add_subplot(223, aspect="equal")
plot_tf_cable_in_conduit_turn(ax20, figs[25], m_file, scan)
plot_205 = figs[25].add_subplot(223, aspect="equal")
plot_205.set_position([0.075, 0.1, 0.3, 0.3])
plot_cable_in_conduit_cable(plot_205, figs[24], m_file, scan)
plot_cable_in_conduit_cable(plot_205, figs[25], m_file, scan)
else:
ax19 = figs[23].add_subplot(211, aspect="equal")
ax19 = figs[24].add_subplot(211, aspect="equal")
ax19.set_position([0.06, 0.55, 0.675, 0.4])
plot_resistive_tf_wp(ax19, m_file, scan, figs[23])
plot_resistive_tf_info(ax19, m_file, scan, figs[23])
plot_resistive_tf_wp(ax19, m_file, scan, figs[24])
plot_resistive_tf_info(ax19, m_file, scan, figs[24])
plot_tf_coil_structure(
figs[25].add_subplot(111, aspect="equal"), m_file, scan, colour_scheme
figs[26].add_subplot(111, aspect="equal"), m_file, scan, colour_scheme
)

plot_plasma_outboard_toroidal_ripple_map(figs[26], m_file, scan)
plot_plasma_outboard_toroidal_ripple_map(figs[27], m_file, scan)

plot_tf_stress(figs[27].subplots(nrows=3, ncols=1, sharex=True).flatten(), m_file)
plot_tf_stress(figs[28].subplots(nrows=3, ncols=1, sharex=True).flatten(), m_file)

plot_current_profiles_over_time(figs[28].add_subplot(111), m_file, scan)
plot_current_profiles_over_time(figs[29].add_subplot(111), m_file, scan)

plot_cs_coil_structure(
figs[29].add_subplot(121, aspect="equal"), figs[29], m_file, scan
figs[30].add_subplot(121, aspect="equal"), figs[30], m_file, scan
)
plot_cs_turn_structure(
figs[29].add_subplot(224, aspect="equal"), figs[29], m_file, scan
figs[30].add_subplot(224, aspect="equal"), figs[30], m_file, scan
)

plot_first_wall_top_down_cross_section(
figs[30].add_subplot(221, aspect="equal"), m_file, scan
figs[31].add_subplot(221, aspect="equal"), m_file, scan
)
plot_first_wall_poloidal_cross_section(figs[30].add_subplot(122), m_file, scan)
plot_fw_90_deg_pipe_bend(figs[30].add_subplot(337), m_file, scan)
plot_first_wall_poloidal_cross_section(figs[31].add_subplot(122), m_file, scan)
plot_fw_90_deg_pipe_bend(figs[31].add_subplot(337), m_file, scan)

plot_blkt_pipe_bends(figs[31], m_file, scan)
ax_blanket = figs[31].add_subplot(122, aspect="equal")
plot_blkt_structure(ax_blanket, figs[31], m_file, scan, radial_build, colour_scheme)
plot_blkt_pipe_bends(figs[32], m_file, scan)
ax_blanket = figs[32].add_subplot(122, aspect="equal")
plot_blkt_structure(ax_blanket, figs[32], m_file, scan, radial_build, colour_scheme)

plot_main_power_flow(
figs[32].add_subplot(111, aspect="equal"), m_file, scan, figs[32]
figs[33].add_subplot(111, aspect="equal"), m_file, scan, figs[33]
)

ax24 = figs[33].add_subplot(111)
ax24 = figs[34].add_subplot(111)
# set_position([left, bottom, width, height]) -> height ~ 0.66 => ~2/3 of page height
ax24.set_position([0.08, 0.35, 0.84, 0.57])
plot_system_power_profiles_over_time(ax24, m_file, scan, figs[33])
plot_system_power_profiles_over_time(ax24, m_file, scan, figs[34])


def create_thickness_builds(m_file, scan: int):
Expand Down Expand Up @@ -14004,7 +14009,7 @@ def plot_summary(
):
# create main plot
# Increase range when adding new page
pages = [plt.figure(figsize=(12, 9), dpi=80) for i in range(34)]
pages = [plt.figure(figsize=(12, 9), dpi=80) for i in range(35)]

# run main_plot
main_plot(
Expand Down
Loading
Loading