Add optional keywords to SyntheticRadiograph to directly control detector orientation & source particle orientation#2968
Conversation
…tion in create_particles
|
Thank you for submitting this pull request (PR)! ✨ PlasmaPy depends on contributors like you, so we deeply appreciate it! The bottom of this page shows several checks that are run for every PR. ✅ Don't worry if something broke! We break stuff all the time. 😅 Click on "Details" to learn why a check didn't pass. Please also feel free to ask for help. We do that all the time as well! 🌸 We invite you to our weekly community meeting (2 pm ET on most Tuesdays) and office hours (3 pm ET on most Thursdays). After this PR is marked as ready for review, someone should stop by to provide a code review and offer suggestions soon. 👥 If we don't provide a review within a few days, please feel free to send us a reminder. 🎗 PlasmaPy's contributor guide has information on:
Tip 📚 For a documentation preview, click on Details next to docs/readthedocs.org:plasmapy. For cryptic documentation errors, see the documentation troubleshooting guide. Tip 🧹 Automatically fix most pre-commit.ci failures by commenting We thank you once again! 🌌 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2968 +/- ##
==========================================
- Coverage 95.40% 94.61% -0.79%
==========================================
Files 107 107
Lines 9662 9664 +2
Branches 1462 1464 +2
==========================================
- Hits 9218 9144 -74
- Misses 257 327 +70
- Partials 187 193 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@namurphy I'm sure you probably dread seeing a new CPR PR pop up, but this one should be quick and easy to review! :) |
In contrast, it brightens my day to see new PRs to PlasmaPy! |
There was a problem hiding this comment.
Thank you for doing this! I have a few suggestions but it looks pretty close to ready to merge.
tests/diagnostics/charged_particle_radiography/test_synthetic_radiography.py
Show resolved
Hide resolved
src/plasmapy/diagnostics/charged_particle_radiography/synthetic_radiography.py
Show resolved
Hide resolved
src/plasmapy/diagnostics/charged_particle_radiography/synthetic_radiography.py
Show resolved
Hide resolved
src/plasmapy/diagnostics/charged_particle_radiography/synthetic_radiography.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Thank you for the clarifications! Happy to approve this.
To approximately quote Grand Moff Tarkin: "You may [merge] when ready."
…://github.com/pheuer/PlasmaPy into synthetic_radiography_detailed_setup_keywords
|
Thanks! |
The SyntheticRadiography module tracks particles (usually randomly generated by the
create_particlesmethod) through a grid onto a detector plane (defined by two perpendicular vectors and a center point). The initial particle velocities are distributed around the source-detector axis.In the current version, these vectors are set up automatically in a reasonable way (e.g. assuming the detector is looking at the origin, particles go along the source-detector axis). However, experimental setups are sometimes non-ideal, and in those cases the user might want direct control over the orientation of the detector and the initial velocity vector.
This PR just adds a couple keywords to explicitly set the detector_vdir (a keyword already existed for detector_hdir) and the vector around which the velocities of particles in
create_particlesare centered. Both keywords are optional and default to the previous behavior, so this a non-breaking feature.Also, corrected a bug in the docs where the default detector_hdir was incorrectly described as (source-detector X Z-axis) when in reality it was (origin-detector X Z-axis).