Re: [Ifeffit] Ifeffit Digest, Vol 254, Issue 4
Hi Matt, Thank you so much for your thorough and insightful response. Your explanation has brought clarity to several areas that were previously unclear to me. After implementing your advice and conducting initial checks, I'm happy to report ZjQcmQRYFpfptBannerStart This Message Is From an External Sender This message came from outside your organization. ZjQcmQRYFpfptBannerEnd Hi Matt, Thank you so much for your thorough and insightful response. Your explanation has brought clarity to several areas that were previously unclear to me. After implementing your advice and conducting initial checks, I'm happy to report significant improvements in the initial fits. The results now make much more sense. Your expertise and guidance in navigating these technical aspects have been invaluable, and I truly appreciate your assistance. Best regards, Ryan -Original Message- From: Ifeffit On Behalf Of ifeffit-requ...@millenia.cars.aps.anl.gov Sent: Monday, April 8, 2024 5:15 AM To: ifeffit@millenia.cars.aps.anl.gov Subject: Ifeffit Digest, Vol 254, Issue 4 Send Ifeffit mailing list submissions to ifeffit@millenia.cars.aps.anl.gov To subscribe or unsubscribe via the World Wide Web, visit https://urldefense.us/v3/__http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit__;!!G_uCfscf7eWS!bIQDP35bOjkwwoLQYNohYeyscpvOgIYuFTH6r0oOx9btvRgVmmo1Gffn_M4PcgITHEb1j8LyoBTyAau5KrSzQIqjQfzQS_BlVIQ$ or, via email, send a message with subject or body 'help' to ifeffit-requ...@millenia.cars.aps.anl.gov You can reach the person managing the list at ifeffit-ow...@millenia.cars.aps.anl.gov When replying, please edit your Subject line so it is more specific than "Re: Contents of Ifeffit digest..." Today's Topics: 1. Re: Peak-Fitting Process in Larix (Matt Newville) -- Message: 1 Date: Sun, 7 Apr 2024 23:13:53 -0500 From: Matt Newville To: XAFS Analysis using Ifeffit Subject: Re: [Ifeffit] Peak-Fitting Process in Larix Message-ID: Content-Type: text/plain; charset="utf-8" Hi Ryan, There are a couple of different questions here. And it turns out that this is also coming up against a few small bugs in code that are in the process of being resolved ;). I think this is going to be a long answer, first the "how to do this", then a warning about the bug-let, then on pseudo-Voigt in general. First, on doing peak fitting with arc-tangents in Larix: > The parameters for the arctangent function are initially estimated > using the 'pick values from plot' > feature. However, modifying these parameters doesn't result in corresponding changes in the graph, > making it difficult to ascertain if it aligns with the data points. Considering this, would it be acceptable to > set the arctangent's amplitude to 1 (normalised edge jump) and > position its centre a couple of eV below > E0? Yes, you can definitely change the initial values (and set bounds -- but be careful about setting these too tightly). Picking default values from the plot is meant to be a rough value anyway. The amplitude should be about 1 (and you could set this to be "positive"), and the center is "halfway up the edge". These values should refine well. Be careful using arc-tangents in general. I know that is what many people (including Farges et al) used. I find that "line + Lorentzian" for the main peak just works better. But, I also get that you're trying to reproduce that earlier work, which is fine. So, also: note that "fit baseline" in Larix Pre-Edge Peak Fitting fits that baseline and assigns fit components named "bline" and "bpeak" ("b" for baseline) -- these are in your model. If you want, you can simply delete these components of the model. > Following this, two pseudo-Voigt functions are introduced, with their parameters initially estimated. > Then, to replicate the conditions of '1.3 eV 2? width and 45% Gaussian,' do I set the pseud_fraction > to 0.45 and pseud_sigma to 2? I'm uncertain about where to input the > 1.3 eV width and whether this > choice is optimal, especially considering that the natural width of > the atomic K level at the Mn edge is > 1.16 eV (Krause, 1979). Actually, to reproduce Farge's settings, use 'fraction' of 0.55. Here "fraction" is the fraction of the Lorentzian. Sigma is a little trickier, because I am not 100% certain of the definition of pseudo-Voigt that they used. As far as I can tell, most definitions (and the one we use) have sigma as the sigma for the Lorentzian (ie, HWFM), and set a sigma for the Gaussian so that the FWHM are the same for both Lorentzian and Gaussian. This is not really that well justified physically (more below), but a common approach. With all that, you should then set the sigma to be 0.65, so that 2*sigma is 1.3. I think that is all of the "technical bits" and mechanics of doing the fits. Second, on buglets: There are 2 bugs
Re: [Ifeffit] Ifeffit Digest, Vol 250, Issue 5
%) (init = 2.467005) bpoly_slope: 8.9825e-04 +/- 9.2664e-05 (10.32%) (init = -0.000347) gauss1_amplitude: 0.10390560 +/- 0.00363058 (3.49%) (init = 0.14991) gauss1_center: 7111.52424 +/- 0.02714092 (0.00%) (init = 7112.452) gauss1_sigma: 0.75932812 +/- 0.02151410 (2.83%) (init = 1.315216) gauss1_fwhm: 1.78808103 +/- 0.05066183 (2.83%) == '2.3548200*gauss1_sigma' gauss1_height: 0.05459081 +/- 7.8147e-04 (1.43%) == '0.3989423*gass1_amplitude/max(1e-15, gauss1_sigma)' gauss2_amplitude: 0.03945700 +/- 0.00329914 (8.36%) (init = 0.116005) gauss2_center: 7113.18957 +/- 0.04258439 (0.00%) (init = 7113.403) gauss2_sigma: 0.57985874 +/- 0.03338641 (5.76%) (init = 0.556759) gauss2_fwhm: 1.36546297 +/- 0.07861898 (5.76%) == '2.3548200*gauss2_sigma' gauss2_height: 0.02714638 +/- 0.00110204 (4.06%) == '0.3989423*gauss2_amplitude/max(1e-15, gauss2_sigma)' fit_centroid: 7111.98258 +/- 0.01448240 (0.00%) == '(gauss1_amplitude*gauss1_center +gauss2_amplitude*gauss2_center )/(gauss1_amplitude+gauss2_amplitude)' [[Correlations]] (unreported correlations are < 0.100) C(bpoly_intercept, bpoly_slope) = -1. C(bpeak_amplitude, bpeak_center) = +0.9722 C(gauss1_amplitude, gauss1_sigma) = +0.9186 C(gauss1_amplitude, gauss2_amplitude) = -0.7900 So there are 2 "gaussN_amplitude" Parameters for the area under each Gaussian, with a strong negative correlation.If you do >>> uvars = peakresult.result.uvars >>> print(uvars['gauss1_amplitude'], uvars['gauss2_amplitude']) >>> >>> print(uvars['gauss1_amplitude'] + uvars['gauss2_amplitude']) You'll get the area of the sum of the two Gaussians as 0.104+/-0.004 0.0395+/-0.0033 0.1434+/-0.0023 That is, one might expect the uncertainties in 'gauss1_amplitude' and 'gauss2_amplitude' should add in quadrature, but that would overestimate the uncertainty in the sum by almost ~2x because the parameters are highly (and negatively) correlated. The uncertainty in the reported peak heights and the centroid of the two peaks also takes the correlations into account. Such calculations are not too hard to do from the Larch buffer or Python script, but we might think about how that could be exposed more flexibly. I can be persuaded to just add a Parameter "peaks_area" = the sum of the amplitudes, which would then have this value and uncertainty. Any suggestions for what should be exposed here? Cheers, --Matt On Thu, Dec 14, 2023 at 10:47?AM Ryan Parmenter wrote: > > Hello, > > > > I successfully fitted Gaussian curves to my pre-edge peaks using Larix (XAS > Viewer), yielding the centroid energy for indicating Fe oxidation state. The > expected trends are observed, however, in reviewing articles, I noticed they > report the area and integrated intensities of Gaussian curves, often > automated with Peakfit software. Can Larix generate these values in its > statistical report? If not, how can I calculate the area and integrated > intensity using Larix's provided values, considering the absence of standard > deviation? > > > > Thanks, > > Ryan > > > > ___ > Ifeffit mailing list > Ifeffit@millenia.cars.aps.anl.gov > http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit > Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit -- Subject: Digest Footer ___ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit -- End of Ifeffit Digest, Vol 250, Issue 5 *** ___ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
[Ifeffit] Larix Pre-edge Statistics
Hello, I successfully fitted Gaussian curves to my pre-edge peaks using Larix (XAS Viewer), yielding the centroid energy for indicating Fe oxidation state. The expected trends are observed, however, in reviewing articles, I noticed they report the area and integrated intensities of Gaussian curves, often automated with Peakfit software. Can Larix generate these values in its statistical report? If not, how can I calculate the area and integrated intensity using Larix's provided values, considering the absence of standard deviation? Thanks, Ryan ___ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
[Ifeffit] Argument "h_rmax = 4" isn't numeric in array or hash
Hi all, I have been using the Demeter package for a year now and have recently been experiencing an issue when importing data. The following message pops up when importing data into Athena: 10:23:55: Argument "h_rmax = 4" isn't numeric in array or hash lookup at AppData/Roaming/DemeterPerl/perl/site/lib/Demeter/StrTypes.pm line 139. Line 139 contains: coerce Window, from Str, via { ($_ =~ m{[0-5]}) ? $window_list[$_] : $_ }; This usually pertains to line 139, but the following errors appear after the data import window is closed. 10:23:58: Argument "h_rmax = 4" isn't numeric in array or hash lookup at AppData/Roaming/DemeterPerl/perl/site/lib/Demeter/StrTypes.pm line 139, line 19. 10:23:58: Argument "h_rmax = 4" isn't numeric in array or hash lookup at AppData/Roaming/DemeterPerl/perl/site/lib/Demeter/StrTypes.pm line 139, line 27. 10:23:58: Argument "h_rmax = 4" isn't numeric in array or hash lookup at AppData/Roaming/DemeterPerl/perl/site/lib/Demeter/StrTypes.pm line 139, line 35. 10:23:58: Argument "h_rmax = 4" isn't numeric in array or hash lookup at AppData/Roaming/DemeterPerl/perl/site/lib/Demeter/StrTypes.pm line 139, line 43. 10:23:58: Argument "h_rmax = 4" isn't numeric in array or hash lookup at AppData/Roaming/DemeterPerl/perl/site/lib/Demeter/StrTypes.pm line 139, line 51. 10:23:58: Argument "h_rmax = 4" isn't numeric in array or hash lookup at AppData/Roaming/DemeterPerl/perl/site/lib/Demeter/StrTypes.pm line 139, line 59. 10:23:58: Argument "h_rmax = 4" isn't numeric in array or hash lookup at AppData/Roaming/DemeterPerl/perl/site/lib/Demeter/StrTypes.pm line 139, line 67. The programme still runs; however, this pop-up is becoming slightly frustrating, given the amount of data I have. I have tried to use an older version, but the issue persists. This occurs with new and old data files, which were fine in the past. Do you have any ideas on how I can resolve this? I appreciate any help you can give me. ___ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit