Skip to content

Conversation

@chris-ashe
Copy link
Collaborator

@chris-ashe chris-ashe commented Dec 1, 2025

This pull request enhances the plasma radiation plotting functionality by introducing a new 2D contour plot for radiation density and refactoring the profile generation logic for improved clarity and consistency. The main updates include the addition of the plot_rad_contour function, adjustments to how plasma profiles are constructed, and integration of the new contour plot into the main plotting workflow, with appropriate handling for unsupported plasma shapes.

Major changes:

1. New Feature: 2D Radiation Contour Plot

  • Added the plot_rad_contour function to generate 2D contour plots of radiation density using plasma profile and impurity data, including mirrored plotting for both plasma halves and enhanced plot formatting.
  • Integrated the new contour plot into the main plotting workflow (main_plot), displaying it when the plasma shape supports closed boundaries, and providing a user-friendly message when not supported.

2. Plasma Profile Calculation Refactor

  • Refactored the construction of plasma density and temperature profiles in plot_radprofile to ensure consistent use of the n_plasma_profile_elements parameter and to clarify the logic for both non-pedestal and pedestal cases. [1] [2]

3. Bug Fixes and Consistency Improvements

  • Fixed the normalization logic for density and temperature profile calculations in the pedestal region by removing unnecessary min(0.9999, ...) calls, ensuring correct profile behaviour near the plasma edge.
image

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 Dec 1, 2025
@chris-ashe chris-ashe added Output Files Issues related to the output data files Radiation Plasma radiated power labels Dec 1, 2025
@codecov-commenter
Copy link

codecov-commenter commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 3.30579% with 117 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.63%. Comparing base (26bfc59) to head (68ec297).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
process/io/plot_proc.py 3.30% 117 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3996      +/-   ##
==========================================
- Coverage   46.03%   42.63%   -3.41%     
==========================================
  Files         123      123              
  Lines       28964    32455    +3491     
==========================================
+ Hits        13335    13837     +502     
- Misses      15629    18618    +2989     

☔ 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 plot_proc_radiation_contour_plot branch from f11588c to d44aaca Compare December 3, 2025 09:42
@chris-ashe chris-ashe force-pushed the plot_proc_radiation_contour_plot branch from d44aaca to ed03f98 Compare December 3, 2025 09:45
@chris-ashe chris-ashe requested a review from jonmaddock December 3, 2025 10:08
Copy link
Contributor

@jonmaddock jonmaddock left a comment

Choose a reason for hiding this comment

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

Found the plotting calculations quite hard to follow, especially when double or triple-indexing arrays: please add some comments. I don't understand the profile calculations like you do, but do you have a docs reference for:

ne = nd_plasma_electron_on_axis * (1 - rho**2) ** alphan

?

@chris-ashe chris-ashe force-pushed the plot_proc_radiation_contour_plot branch from 25df405 to 68ec297 Compare December 8, 2025 14:36
@jonmaddock jonmaddock self-requested a review December 8, 2025 15:25
@chris-ashe chris-ashe requested review from timothy-nunn and removed request for timothy-nunn December 8, 2025 15:29
@jonmaddock jonmaddock merged commit fa5d0c2 into main Dec 8, 2025
18 checks passed
@jonmaddock jonmaddock deleted the plot_proc_radiation_contour_plot branch December 8, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Output Files Issues related to the output data files Radiation Plasma radiated power

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants