feat(eqdsk): add R,Z to flux coordinate interpolation and Sphinx docs#254
feat(eqdsk): add R,Z to flux coordinate interpolation and Sphinx docs#254krystophny merged 2 commits intomainfrom
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||||
Add methods to eqdsk_file class for converting cylindrical (R, Z) coordinates to flux coordinates (s_pol, theta): - psi_at_rz: interpolate poloidal flux at arbitrary (R, Z) points - spol_at_rz: compute normalized poloidal flux (0 at axis, 1 at LCFS) - theta_geometric_at_rz: compute geometric poloidal angle - rz_to_flux_coords: combined conversion to (s_pol, theta) Uses scipy RegularGridInterpolator with cubic interpolation. Automatically handles COCOS sign convention mismatches. Also adds: - Sphinx documentation with usage examples for plotting scalar data against flux coordinates - GitHub Actions workflow to build and deploy docs to GitHub Pages - Docs landing page at root, test dashboard at /test/
cb7d1ba to
dd486d3
Compare
Visual Evidence: AUG 30835 @ 3200msTested the flux coordinate interpolation with AUG shot 30835 at 3200ms. Left: Flux surface contours ( Middle: Same surfaces in Right: Radial profiles along midplane (R = 1.0 to 2.6 m) comparing Results: |

User description
Summary
eqdsk_fileclass in Python libraryNew Features
Flux Coordinate Interpolation
The
eqdsk_fileclass now supports converting arbitrary (R, Z) cylindrical coordinates to flux coordinates:Individual methods are also available:
psi_at_rz(R, Z)- raw poloidal flux interpolationspol_at_rz(R, Z)- normalized flux coordinatetheta_geometric_at_rz(R, Z)- geometric angleSphinx Documentation
docs/directory with Sphinx configurationGitHub Pages
/test/subdirectoryTest plan
PR Type
Enhancement, Documentation, Tests
Description
Add flux coordinate interpolation methods to
eqdsk_fileclasspsi_at_rz(): interpolate poloidal flux at arbitrary (R, Z) pointsspol_at_rz(): compute normalized poloidal flux (0 at axis, 1 at LCFS)theta_geometric_at_rz(): compute geometric poloidal anglerz_to_flux_coords(): combined conversion to (s_pol, theta) coordinatesSet up Sphinx documentation infrastructure with usage examples
Add comprehensive test suite with 14 unit tests for interpolation methods
Configure GitHub Actions workflow to build and deploy docs to GitHub Pages
/test/subdirectoryDiagram Walkthrough
File Walkthrough
1 files
Add flux coordinate interpolation methods1 files
Add comprehensive interpolation method tests6 files
Sphinx configuration for documentationDocumentation landing page and navigationInstallation instructions and requirementsEQDSK usage guide with coordinate conversion examplesAuto-generated API reference documentationSphinx build automation makefile1 files
Add docs build and GitHub Pages deployment workflow1 files
Add docs dependencies group