-
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
Issue085 line shapes #88
base: master
Are you sure you want to change the base?
Conversation
…ions that can be shared amongst similar broadening mechanisms
…s together. Not done yet
…analytic equations
…g as a model for Suprathermal ion
@fsciortino Let me know if you observe any bugs are ways to improve |
Checks are failing because they can't find numpy? |
@cjperks7 I have the same issue with regression tests :( it is probably caused likely by different versions of Python used to install the numpy and the actual python. It might be possible to fixit by changing meta.yaml file, but I have not succeeded yet. So if you have any ideas, please try it. |
One idea for your pull request. If the instrumental function is not Gaussian, it is usually described as the sum of Gaussians. Then you can use the same trick, because the convolution of Gaussian is again just a Gaussian. Convolution of Gaussian and Lorentz distributions is Voigt distribution In conclusion, if this is used for synthetic diagnostics in Bayesian inference, where the computation time matters, |
@odstrcilt Thanks for the feedback. It should be easy to give a user a choose to model instrumental broadening for a number different Gaussians per whatever they find best fits high-quality ray-tracing. To get to your point on Bayesian optimization, that wasn't actually my intention. I've documented my reasonings for these various extensions under my initial Issue description #85 I specifically want to use this for inferring ion temperature from high-resolution spectroscopy as a trick you can use in your tomographic inversions can very naturally handle the convolution of an arbitrary number of Gaussians representing your instrumental broadening given you know their characteristic widths alongside the typical Doppler profile (ref: Section 3 in M.L. Reinke et al, RSI 83, 113504 (2012)). You have touched on a sort of philosophic debate that's been going on in my head as I work on ImpRad. I've been mainly working with a high-resolution spectrometer (XICS), but lines integrated over the broadening profile to ignore the specific details of how the photons are redistributed. I once had a conversation with Francesco where he said he initially was doing this though later got pressed into doing Bayesian inferencing on the whole spectrum. I recall he said that it was a worthwhile endeavor, but now that I know better I feel as though I need to question the merit of that. To me, it seems like doing full spectrum Bayesian inferences only convolutes more uncertainties from 1) your ion temperature profile, 2) your knowledge on the instrumental broadening (therefore diagnostic geometry), and 3) the quality of your atomic data for a larger number of exotic transitions. Sure, you get constraints on other charge states via satellite lines, but I feel I can get by just fine using low-resolution VUV spectroscopy. So it seems more effort than its worth to me. Hence why I didn't worry about speed and instead checked that my numerical method matches simple cases to analytically derive. What do you think? Do you or @fsciortino find utility in doing full spectrum Bayesian inferences? Do you personally use it? |
} | ||
|
||
# Calculates Instrumental broadening | ||
def _get_Instru( |
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.
Generalize this to give the user a choose in the number of Gaussian/Lorentzian profiles that they've determined best models their instrumental broadening
If you care only about the number of photons, you can sum the intensity of all pixels measuring your line. The line shape does not matter. The reason why we are fitting the peak and not summing the pixels is mainly to get a better signal-noise ratio. Also, even if the fitting function is not perfect, it will be somewhere higher and somewhere lower, so on average it it will give you a very good estimate of the total integral, even of the fit is not perfect. |
Interesting, we're having similar conversations about analyzing real data for SPARC. Admittedly I've elected to go with the moments method because 1) like you said, it's easy to do and 2) I'm used to it from making CMOD Ti profiles. It's been working fairly well for a bunch of performance scoping I've been doing with fake density/temp profiles. But we do expect to explore the Bayesian approach once we start dealing with real data. I have Francesco/Norman's BSFC code, but haven't really tried using it yet. I'm still curious as to if you still need to include instrumental broadening via this model in Aurora as part of your Bayesian analysis. I would imagine you could create a high-quality synthetic diagnostic and calculate a transfer matrix (local emissivity to counts) via volume-of-sight integration, hence automatically convoluting instrumental broadening, that you only have to do once and then can save? Or are you just sticking with line-of-sight integration that you run during the analysis? |
It is possible that the moment approach will be better, but I would like to try the direct approach. To make it fast, I plan to calculate a transfer matrix between the 2D pixel grid and local spectra on the outer midplane grid.
What do you mean by "volume-of-sight integration, hence automatically convoluting instrumental broadening" |
Therefore my transfer matrix is really a discretized version of |
And oh yeah, we plan to have at least one calibration source (money fights...). Probably then assume it applies the same to all the spectrometers. Another theoretical method we'll try is comparing the broadening of bright lines from different impurities (hence mass). The details haven't been flushed out at this stage. We're just post-PDR now. |
This is very interesting, I didn't know that the Einstein coefficients have such a steep Z dependence. |
hey guys, interesting dicussion -- sorry for not being so engaged. To reply to @cjperks7 , I think that if you want to really do the highest quality assessment of impurity transport coefficients, you need to avoid model inadequacies in all the possible forms. This is practically impossible, but one must try. Doing full-spectrum analysis helped me to understand what were systematic errors and where my analysis was actually at fault. I found it educational, but actually a lot of work. Depending on your objective, I would stay away from this level of detail... but it's not a trivial choice. It may even vary for different devices, where other lines may pop up and you may be underestimating them at first. For example, I remember that the K-alpha spectrum of Ar had some annoying Mo lines in the middle - I did extensive analysis to convince myself that it was all fine in my case. You cannot come to such conclusions if you don't look at the details. It's not as bad in the VUV, because there you have many more lines and full fitting is anyway a waste of time (you can only hope that no other lines are overlapping, based on a lot of experiments with different non-intrinsic species). In ITER and SPARC, lots of W will be flying around. IIRC, the W spectrum for XICS is quite dangerous because of potential overlaps... I remember discussing this with John. Sine @cjperks7 is working with him, I'm sure you discussed this extensively. Worth looping in @odstrcilt on these challenges, since he's working on the ITER XICS. The folks at WEST have seen some of the issues in experiment, I believe. W7-X also has some W experiments (W injections). |
@fsciortino that's a very good observation. Indeed with the Ne-like Xe spectrum (useful for low-temp regions) we are finding that there's a nearly degenerate line emitted from Al-like W with the 3D line (brightest) that we'd like to use for Ti measurements. The Te ranges that these charge states are significantly populated at least only slightly overlap so it's part of the decision making when to trust those channels over the He-like Kr (useful for high-temp regions) per the moments approach. The He-like Kr spectrum has so far appeared clean of pollutants. The Li-like satellites are shifted around differently than in the K-alpha spectrum for Ar you mention, so may/may not cause strife depending on if we rely on the w line (which may/may not have a lot of natural broadening error already) or z line (which is a little less bright so signal-to-noise concerns). So another sort of decision making of moments v. Bayesian we have to make once we have real data. It's so convenient when you have fake data to turn off the troubling bits haha! Hence I've enjoyed the moments method for quickly scoping performance per diagnostic design. I do hope to bring ImpRad to WEST one day (once they give me shot time....) to run new experiments for my ICRH-impurity pumpout project I have on CMOD data. ImpRad has been showing some very exciting results! So you are reminding me that I probably need to worry about full spectrum modeling there.... Especially because I want to focus on some of those polluting W lines. @odstrcilt and yeah, I would find it very beneficial to keep a collaboration on this stuff open. I've had a few very interesting conversations with other people working on ITER XICS that I've reflected on and applied to my own work. A particular conversation I enjoyed with Oleksandr Marchuk were they pointed an important population mechanism in atomic data modeling we both were independently doing for a few Ne-like W lines that I had been missing. Which is helpful because we both want to use that spectrum. |
To anyone interested, I swear I'll get to closing this out in a week or two, but adding to my to-do list
|
…efficient is related to: either central wavelength or adf15 isel
…aussians each with a known variance. NOTE: Assumes no systematic shift as isgit add aurora/line_broaden.py git add aurora/line_broaden.py
Finally, I have time to work on the synthetics CIXS diagnostics for ITER. @cjperks7, would you recommend some literature for me to read? So far, I have found these: Matt Reinke's RSI 2012 paper about the Alcator C-mod system was also very interesting. |
@odstrcilt yeah, sure I can. How about I follow up in an email since I imagine we could have quite a long conversation? Any other interested party with visibility on this PR speak now if you want to be CC-ed. As a first go, what you list are pretty big ones. I have some more on CIXS and microcalorimeters that I can share. More theory on the former as for SPARC we were far in the design process before considering a microcalorimeter and ended up ruling it out based on available space. For W atomic data, I should advertise I have EBIT experiments at LLNL coming up in the Spring to look at this for polluting a Ne-like Xe spectrometer that you'd probably want to take advantage of. I know ITER people (I think Novimir was PI) have other EBIT data I want as well. Anyway, as a heads up I'll be posting a report either this evening or tomorrow morning implementing your feedback and opening this PR back up for review. last bits of debugging. I'll tag you and Francesco when I do. |
…hod so included an alternative using scipy's built-in function
@odstrcilt @fsciortino Okay, this branch should be ready for another round of reviews. What's new: Instrumental Broadening
Voigt profiles
2-photon emission
|
… of adf15 files with many types
Oh sick, thanks! What was the issue? From what I understand reading your changes, I was supposed to the Gaussian/Lorentzian parts using the same, combined FWHM? |
Exactly, both needs to use the same FWHM called "f" on wikipedia |
Okay, let me know if you see anymore problems. If we're good then before merging then I'll make the pseudo-Voigt the default |
You don't have to make pseudo-Voigt default. It is just an approximation, which is useful only if you want to evaluate the line shape really fast, for example, for fast synthetics diagnostic. |
What's New
line_broaden
to manage various line broadening mechanisms a user can toggle on\offDoppler
andSuprathermal_Ions
options at the same timeaurora.line_broaden.get_line_broaden()
accepts fromaurora.radiation.get_local_spectrum()
an array of transition wavelengths and a dictionary,dbroad
, whose keys are the various broadening mechanisms of interest and whose entries are the necessary physics for the associated modelUsing Doppler Broadening
aurora.radiation.get_local_spectrum(dbroad=None)
then it is assumed you just want Doppler broadening so everything runs the same as beforeUsing Instrumental Broadening
- What the user gives is the Gaussian FWHM in units [\AA]
- NOTE: It's pretty obvious how the inputs of this option can be leveraged to include any Gaussian broadening from some external model
-
- The blue curve (analytic) is behind the red curve (computed)
Minimum working code (simulating He-like Kr):
Using Natural Broadening
dbroad['Natural']
dictionary is a transition wavelength (hopefully you've read your ADF15 file) with it's associated Einstein coefficientMinimum working code (simulating He-like Kr):
Using Suprathermal Ion
Minimum working code (simulating He-like Kr):