-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add Zeeman splitting and Doppler broadening to StarkBroadenedLine and move line shapes models to a dedicated submodule #400
base: development
Are you sure you want to change the base?
Conversation
…cts to StarkBroadenedLine.
…s as in B.A. Lomanowski 2015 NF paper.
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.
Looks good. Test coverage, documentation and demo provision is good for the new additions. Since the beam line shape classes have also been moved, could you add some tests for both BeamLineShapeModel
and BeamEmissionMultiplet
which pass both before and after the refactoring too, just to guarantee no backwards incompatibility?
STARK_MODEL_COEFFICIENTS_DEFAULT = { | ||
Line(hydrogen, 0, (3, 2)): (3.71e-18, 0.7665, 0.064), | ||
Line(hydrogen, 0, (4, 2)): (8.425e-18, 0.7803, 0.050), | ||
Line(hydrogen, 0, (5, 2)): (1.31e-15, 0.6796, 0.030), | ||
Line(hydrogen, 0, (6, 2)): (3.954e-16, 0.7149, 0.028), | ||
Line(hydrogen, 0, (7, 2)): (6.258e-16, 0.712, 0.029), | ||
Line(hydrogen, 0, (8, 2)): (7.378e-16, 0.7159, 0.032), | ||
Line(hydrogen, 0, (9, 2)): (8.947e-16, 0.7177, 0.033), | ||
Line(hydrogen, 0, (4, 3)): (1.330e-16, 0.7449, 0.045), | ||
Line(hydrogen, 0, (5, 3)): (6.64e-16, 0.7356, 0.044), | ||
Line(hydrogen, 0, (6, 3)): (2.481e-15, 0.7118, 0.016), | ||
Line(hydrogen, 0, (7, 3)): (3.270e-15, 0.7137, 0.029), | ||
Line(hydrogen, 0, (8, 3)): (4.343e-15, 0.7133, 0.032), | ||
Line(hydrogen, 0, (9, 3)): (5.588e-15, 0.7165, 0.033), | ||
Line(deuterium, 0, (3, 2)): (3.71e-18, 0.7665, 0.064), | ||
Line(deuterium, 0, (4, 2)): (8.425e-18, 0.7803, 0.050), | ||
Line(deuterium, 0, (5, 2)): (1.31e-15, 0.6796, 0.030), | ||
Line(deuterium, 0, (6, 2)): (3.954e-16, 0.7149, 0.028), | ||
Line(deuterium, 0, (7, 2)): (6.258e-16, 0.712, 0.029), | ||
Line(deuterium, 0, (8, 2)): (7.378e-16, 0.7159, 0.032), | ||
Line(deuterium, 0, (9, 2)): (8.947e-16, 0.7177, 0.033), | ||
Line(deuterium, 0, (4, 3)): (1.330e-16, 0.7449, 0.045), | ||
Line(deuterium, 0, (5, 3)): (6.64e-16, 0.7356, 0.044), | ||
Line(deuterium, 0, (6, 3)): (2.481e-15, 0.7118, 0.016), | ||
Line(deuterium, 0, (7, 3)): (3.270e-15, 0.7137, 0.029), | ||
Line(deuterium, 0, (8, 3)): (4.343e-15, 0.7133, 0.032), | ||
Line(deuterium, 0, (9, 3)): (5.588e-15, 0.7165, 0.033), | ||
Line(tritium, 0, (3, 2)): (3.71e-18, 0.7665, 0.064), | ||
Line(tritium, 0, (4, 2)): (8.425e-18, 0.7803, 0.050), | ||
Line(tritium, 0, (5, 2)): (1.31e-15, 0.6796, 0.030), | ||
Line(tritium, 0, (6, 2)): (3.954e-16, 0.7149, 0.028), | ||
Line(tritium, 0, (7, 2)): (6.258e-16, 0.712, 0.029), | ||
Line(tritium, 0, (8, 2)): (7.378e-16, 0.7159, 0.032), | ||
Line(tritium, 0, (9, 2)): (8.947e-16, 0.7177, 0.033), | ||
Line(tritium, 0, (4, 3)): (1.330e-16, 0.7449, 0.045), | ||
Line(tritium, 0, (5, 3)): (6.64e-16, 0.7356, 0.044), | ||
Line(tritium, 0, (6, 3)): (2.481e-15, 0.7118, 0.016), | ||
Line(tritium, 0, (7, 3)): (3.270e-15, 0.7137, 0.029), | ||
Line(tritium, 0, (8, 3)): (4.343e-15, 0.7133, 0.032), | ||
Line(tritium, 0, (9, 3)): (5.588e-15, 0.7165, 0.033) | ||
} |
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.
I think this should live in the "default_data" directory that was discussed here.
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.
Done. The data is moved to cherab/core/atomic/data
and new methods zeeman_triplet_parameters
and stark_model_coefficients
are added to the AtomicData
interface. Now the LineShapeModel
and BeamLineShapeModel
have AtomicData
as an additional initialisation argument and as an attribute. This argument is provided by the PlasmaModel
or the BeamModel
, so user code should not be affected, except perhaps in some tests when the line shape models are used stand-alone.
Please consider the implementation of zeeman_triplet_parameters
and stark_model_coefficients
in the core AtomicData
interface only as a workaround until the refactoring of the atomic data repository is complete. Proper get/add/update functionality for all the default data will be added in #377. I hope, we'll have both this and #377 in the same release.
…let to the default atomic data repository.
Thanks for the review. I added a test for |
This PR fixes #393 and #396.
StarkBroadenedLine
now takes into account Zeeman splitting and Doppler broadening and usesZeemanLineShapeModel
as a base class.Additional changes:
add_lorentzian_line()
is added by analogy toadd_gaussian_line()
show_supported_transitions()
ofStarkBroadenedLine
andParametrisedZeemanTriplet
has been made a class method, because the user cannot initialise instants without knowing what transitions are supported by these classes.stark_broadening.py
now plots in logscale to show the Lorentzian nature of the spectral line wings.stark_zeeman.py
is added to show the Zeeman splitting of the Stark-broadened line. The plasma parameters are set the same as in Figure 2 in B. Lomanowski et al.test_lineshapes.py
is updated to reflect the changes inStarkBroadenedLine
.