core
core copied to clipboard
Add Zeeman splitting and Doppler broadening to StarkBroadenedLine and move line shapes models to a dedicated submodule
This PR fixes #393 and #396.
- The line shape models are moved to a separate submodule following the file structure proposed in #396. This change does not affect the user code.
- The
StarkBroadenedLinenow takes into account Zeeman splitting and Doppler broadening and usesZeemanLineShapeModelas a base class.- Following B. Lomanowski et al, Zeeman and Stark effects are considered independently, namely, each Zeeman feature is a Stark-Doppler line. This is a simplification and in the future we may consider switching to multi-parametric fit of the J. Rosato et al model.
- Unlike B. Lomanowski et al, the convolution of Stark and Doppler profiles is replaced with the weighted sum to speed up computations. Both the weight of the Stark profile and the FWHM of the resulting line shape are fitted to match the exact convolution. See #393 for analysis of accuracy.
- Unlike B. Lomanowski et al, where the ADAS603 data is used for the Zeeman structure, here the splitting is modelled as a simple triplet. It seems superfluous to consider the exact fine structure of atomic levels in a magnetic field without taking into account the interplay of the Zeeman and Stark effects. In addition, ADAS603 data is not publicly available.
Additional changes:
- The function
add_lorentzian_line()is added by analogy toadd_gaussian_line() - The method
show_supported_transitions()ofStarkBroadenedLineandParametrisedZeemanTriplethas been made a class method, because the user cannot initialise instants without knowing what transitions are supported by these classes. - The demo
stark_broadening.pynow plots in logscale to show the Lorentzian nature of the spectral line wings. - The new demo
stark_zeeman.pyis 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. - The
test_lineshapes.pyis updated to reflect the changes inStarkBroadenedLine. - All related documentation is updated.
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?
Thanks for the review. I added a test for BeamEmissionMultiplet. And BeamLineShapeModel is just a virtual class.