-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function to calculate the thermal bremsstrahlung spectrum #892
Conversation
Check out this pull request on Review Jupyter notebook visual diffs & provide feedback on notebooks. Powered by ReviewNB |
Codecov Report
@@ Coverage Diff @@
## master #892 +/- ##
==========================================
+ Coverage 96.18% 96.20% +0.02%
==========================================
Files 59 60 +1
Lines 5367 5397 +30
==========================================
+ Hits 5162 5192 +30
Misses 205 205
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this! This will be a great addition to the formulary. I have a feel initial suggestions and will try to take another look at it later, but it's looking pretty close to done. The tentative suggestions I made shouldn't be accepted just by themselves, since variable name changes etc. will require changes elsewhere in the code too. Thank you again!
plasmapy/formulary/radiation.py
Outdated
ne: u.m ** -3, | ||
Te: u.K, | ||
ni: u.m ** -3 = None, | ||
ion_species: Union[str, Particle] = "H+", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we can use the @particle_input
decorator from plasmapy.particles
, which will automatically convert a string representation of a particle into a Particle
object. If I remember correctly, the decorator will make sure that the particle is an ion if the argument is named ion
.
ion_species: Union[str, Particle] = "H+", | |
ion: Particle = None, |
I've also been thinking that we should avoid setting default particles, since lab plasma physicists may assume a different default particle than space plasma physicists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea: I'll use the decorator. I see your point about the potential for confusion, but as a lab plasma physicist I think H+ would still be my assumption? The benefit of having a default is the ability to do a quick calculation without having to be familiar with the particle class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍 Thanks for doing this!
Co-authored-by: Dominik Stańczak <[email protected]>
…nto bremsstrahlung
The py36_minimal_conda [linux] failure is unrelated (#894 attempted a fix), so let's merge it 🎉 Thanks! |
Wrong button! |
I wrote a function to calculate the power spectrum of thermal bremsstrahlung emitted by a Maxwellian plasma using the equations given on the Wikipedia page. I also created the appropriate documentation (docstring, an ipynb example).
I wasn't sure where to put this: it doesn't fit into any of the existing Formulary categories so I created a new one for "Radiation". Alternate names could maybe be "EMradiation" or something?