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
65 changes: 35 additions & 30 deletions process/io/plot_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
)
from process.models.physics.current_drive import ElectronBernstein, ElectronCyclotron
from process.models.physics.impurity_radiation import read_impurity_file
from process.models.physics.solovev_equilibrium import plot_analytic_equilibrium
from process.models.tfcoil.superconducting import SUPERCONDUCTING_TF_TYPES
from process.objectives import OBJECTIVE_NAMES

Expand Down Expand Up @@ -13262,9 +13263,13 @@ def main_plot(

plot_plasma_coloumb_logarithms(figs[15].add_subplot(231), m_file, scan)

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

# Plot poloidal cross-section
poloidal_cross_section(
figs[16].add_subplot(121, aspect="equal"),
figs[17].add_subplot(121, aspect="equal"),
m_file,
scan,
demo_ranges,
Expand All @@ -13274,80 +13279,80 @@ def main_plot(

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

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

ax18 = figs[17].add_subplot(211)
ax18 = figs[18].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[18].add_subplot(211)
ax185 = figs[19].add_subplot(211)
ax185.set_position([0.1, 0.61, 0.8, 0.32])

ax18b = figs[18].add_subplot(212)
ax18b = figs[19].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[19].add_subplot(221, aspect="equal")
ax19 = figs[20].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[19])
plot_superconducting_tf_wp(ax19, m_file, scan, figs[20])

# TF coil turn structure
ax20 = figs[20].add_subplot(325, aspect="equal")
ax20 = figs[21].add_subplot(325, aspect="equal")
ax20.set_position([0.025, 0.5, 0.4, 0.4])
plot_tf_cable_in_conduit_turn(ax20, figs[20], m_file, scan)
plot_205 = figs[20].add_subplot(223, aspect="equal")
plot_tf_cable_in_conduit_turn(ax20, figs[21], m_file, scan)
plot_205 = figs[21].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[20], m_file, scan)
plot_cable_in_conduit_cable(plot_205, figs[21], m_file, scan)
else:
ax19 = figs[19].add_subplot(211, aspect="equal")
ax19 = figs[20].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[19])
plot_resistive_tf_info(ax19, m_file, scan, figs[19])
plot_resistive_tf_wp(ax19, m_file, scan, figs[20])
plot_resistive_tf_info(ax19, m_file, scan, figs[20])
plot_tf_coil_structure(
figs[21].add_subplot(111, aspect="equal"), m_file, scan, colour_scheme
figs[22].add_subplot(111, aspect="equal"), m_file, scan, colour_scheme
)

plot_plasma_outboard_toroidal_ripple_map(figs[22], m_file, scan)
plot_plasma_outboard_toroidal_ripple_map(figs[23], m_file, scan)

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

plot_current_profiles_over_time(figs[24].add_subplot(111), m_file, scan)
plot_current_profiles_over_time(figs[25].add_subplot(111), m_file, scan)

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

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

plot_blkt_pipe_bends(figs[27], m_file, scan)
ax_blanket = figs[27].add_subplot(122, aspect="equal")
plot_blkt_pipe_bends(figs[28], m_file, scan)
ax_blanket = figs[28].add_subplot(122, aspect="equal")
plot_blanket(ax_blanket, m_file, scan, radial_build, colour_scheme)
plot_firstwall(ax_blanket, m_file, scan, radial_build, colour_scheme)
ax_blanket.set_xlabel("Radial position [m]")
Expand Down Expand Up @@ -13390,13 +13395,13 @@ def main_plot(
)

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

ax24 = figs[29].add_subplot(111)
ax24 = figs[30].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[29])
plot_system_power_profiles_over_time(ax24, m_file, scan, figs[30])


def create_thickness_builds(m_file, scan: int):
Expand Down Expand Up @@ -13473,7 +13478,7 @@ def main(args=None):

# create main plot
# Increase range when adding new page
pages = [plt.figure(figsize=(12, 9), dpi=80) for i in range(30)]
pages = [plt.figure(figsize=(12, 9), dpi=80) for i in range(31)]

# run main_plot
main_plot(
Expand Down
Loading
Loading