Skip to content

Add EBW/ECRH coupling efficiency graph plotting functionality#3984

Merged
timothy-nunn merged 3 commits intomainfrom
ecrh_ebw_coupling_graph
Dec 5, 2025
Merged

Add EBW/ECRH coupling efficiency graph plotting functionality#3984
timothy-nunn merged 3 commits intomainfrom
ecrh_ebw_coupling_graph

Conversation

@chris-ashe
Copy link
Copy Markdown
Collaborator

@chris-ashe chris-ashe commented Nov 14, 2025

This pull request adds a new plot to visualize the coupling efficiency of Electron Bernstein Waves (EBW) and Electron Cyclotron Resonance Heating (ECRH) as a function of the toroidal B-field. The implementation includes the creation of a new plotting function, integration of this plot into the main plotting workflow, and necessary imports and resource management updates. Additionally, there is a minor correction in the calculation of the electron cyclotron frequency.

New EBW/ECRH Coupling Efficiency Plot Integration:

  • Added a new function plot_ebw_ecrh_coupling_graph to plot_proc.py that generates a plot of EBW and ECRH coupling efficiency versus the on-axis toroidal B-field for the first three harmonics, including both O-mode and X-mode for ECRH. The plot is styled with different colors and line styles for clarity.
  • Integrated the new plot into the main plotting workflow by:
    • Adding a new figure (fig26/page26) for the plot.
    • Calling the new plotting function within main_plot and saving/closing the figure in the appropriate places.
    • Passing the new figure throughout the plotting pipeline.
  • Imported ElectronBernstein and ElectronCyclotron from process.current_drive to support the new plotting function.
image

🐛 Bugs

  • Removed unnecessary division by 1.0e19 in the calculation of the electron cyclotron frequency in electron_cyclotron_freethy. This caused the EC to always never couple 🤯

Checklist

I confirm that I have completed the following checks:

  • My changes follow the PROCESS style guide
  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

@chris-ashe chris-ashe self-assigned this Nov 14, 2025
@chris-ashe chris-ashe added the Input/Output Files Issues related to the input and output data files label Nov 14, 2025
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 3.33333% with 58 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.99%. Comparing base (26bfc59) to head (c4eacba).

Files with missing lines Patch % Lines
process/io/plot_proc.py 3.38% 57 Missing ⚠️
process/current_drive.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3984      +/-   ##
==========================================
- Coverage   46.03%   45.99%   -0.05%     
==========================================
  Files         123      123              
  Lines       28964    28998      +34     
==========================================
+ Hits        13335    13337       +2     
- Misses      15629    15661      +32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chris-ashe chris-ashe force-pushed the ecrh_ebw_coupling_graph branch from 6c14d7b to 305ac71 Compare December 2, 2025 09:04
@chris-ashe chris-ashe requested a review from j-a-foster December 2, 2025 09:25
@chris-ashe chris-ashe marked this pull request as ready for review December 2, 2025 09:25
Copy link
Copy Markdown
Collaborator

@j-a-foster j-a-foster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with plot addition.

@timothy-nunn timothy-nunn merged commit 230767a into main Dec 5, 2025
14 of 18 checks passed
@timothy-nunn timothy-nunn deleted the ecrh_ebw_coupling_graph branch December 5, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Input/Output Files Issues related to the input and output data files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants