🎨 Plot PF mutual inductance matrix#4277
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new summary plot to visualise the PF/CS/plasma mutual inductance matrix, and updates PF coil output to write the mutual inductance elements into the MFILE so the plot can be populated. It also shifts summary page indices and increases the page count to accommodate the new figure.
Changes:
- Added
plot_pf_cs_plasma_mutual_inductanceto render the PF/CS/plasma mutual inductance matrix from MFILE data. - Wrote
ind_pf_cs_plasma_mutual[i,j]elements to the MFILE from the PF coil inductance output. - Updated summary figure/page indexing and increased plot summary page count from 36 to 37.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| process/models/pfcoil.py | Writes mutual inductance matrix elements to MFILE and tweaks CS existence output ordering. |
| process/core/io/plot/summary.py | Adds the new mutual inductance matrix plot and shifts subsequent page indices; increases total pages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for coil in range(n_pf_cs_plasma_circuits): | ||
| for circuit in range(n_pf_cs_plasma_circuits): | ||
| mutual_inductance[coil, circuit] = m_file.get( | ||
| f"ind_pf_cs_plasma_mutual[{coil},_{circuit}]", | ||
| scan=scan, | ||
| ) | ||
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4277 +/- ##
==========================================
- Coverage 49.35% 49.30% -0.06%
==========================================
Files 151 151
Lines 29407 29441 +34
==========================================
+ Hits 14514 14515 +1
- Misses 14893 14926 +33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
6eb8f57 to
1e48f3b
Compare
geograham
left a comment
There was a problem hiding this comment.
Looks good. I would consider adding PF labels to the x and y-axis of the the plot, just to make it really clear.
This pull request introduces a new plotting function to visualize the mutual inductance between the plasma and PF/CS coils, and updates the summary plotting routines and data output to support this visualization. The main changes include adding the new plot, ensuring the necessary data is written to the MFILE, and updating the figure/page management to accommodate the new plot.
Visualization of PF/CS-Plasma Mutual Inductance:
plot_pf_cs_plasma_mutual_inductanceinsummary.pyto plot the mutual inductance matrix between plasma and PF/CS coils, including value annotations and customized axis labels.main_plotto call this function and adjusting subplot indices for subsequent plots to make space for the new figure.plot_summaryfrom 36 to 37 to accommodate the additional plot.Data Output Enhancements:
pfcoil.pyto output the mutual inductance matrix elements to the MFILE for use by the new plotting function, ensuring all necessary data is available for visualization.outpfto ensure consistent file structure and comments.Checklist
I confirm that I have completed the following checks: