Re: [Ifeffit] Pseudo Voigt crash Athena

2019-05-01 Thread Matt Newville
Hi Craig,

On Wed, May 1, 2019 at 10:51 AM Lawley Craig Richard (PSI) <
craig.law...@psi.ch> wrote:

> Dear Mailing list,
>
>
>
> I have run into an issue with the peak fitting section included in Athena.
> If I include a peak that is a Pseudo-Voigt and then save the project file.
> Upon trying to reopen the same project file, Athena becomes non responsive
> with the error message “PV is not yet implemented”.
>

This may sound like a broken record, but I strongly encourage you to try
Larch and the XAS Viewer application for peak fitting of XAS spectra.  The
ifeffit library is really old (has not been updated in 5 years), not
supported, and its interface to peak fitting is primitive.

Larch (and the lmfit library it uses) and the XAS Viewer GUI are all
supported. Peak-fitting of XANES is one feature which I am confident to say
is definitely better than Athena. I'm willing to take 100% of the blame for
this, but peak-fitting does not work well in Athena. XAS Viewer has more
lineshapes including both PseudoVoigt and (true!) Voigt lineshape
functions.  It also supports better mechanisms for applying mathematical
constraints and for applying bounds on parameters which can be important
for modeling XANES with multiple peaks.lmfit/Larch also provides more
and better fit statistics, such as reporting FWHM (and its uncertainty) for
each peak, and (for XANES) the centroid of the pre-edge peaks.  Though not
supported directly in the GUI, lmfit/Larch does allow one to do a more
thorough estimate of uncertainties and to use minimization methods other
than Levenberg-Marquardt.  My experience is that these seem to be not so
important for peak-fitting of XANES data, but I don't know that this is
always the case (and to be clear, there are certain classes of "line shape
fitting" where these are important).  Like Athena, XAS Viewer records all
the code actually run making it easy to turn a GUI session into a Larch
script or Python program to do more detailed analysis or to help write
analysis scripts for batch processing.

Hope that helps,

--Matt
___
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] Pseudo Voigt crash Athena

2019-05-01 Thread Lawley Craig Richard (PSI)
Dear Mailing list,

I have run into an issue with the peak fitting section included in Athena. If I 
include a peak that is a Pseudo-Voigt and then save the project file. Upon 
trying to reopen the same project file, Athena becomes non responsive with the 
error message "PV is not yet implemented".

The log file for the crash is as follows:

Started at 2019-05-01T17:37:06
Win7Enterprise (64-bit) Service Pack 1  Service Pack 16176012102561

PATH is:
   
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Users\lawley_c\AppData\Roaming\DemeterPerl\c\bin;C:\Users\lawley_c\AppData\Roaming\DemeterPerl\perl\site\bin;C:\Users\lawley_c\AppData\Roaming\DemeterPerl\perl\bin;C:\Users\lawley_c\AppData\Roaming\DemeterPerl\c\bin\gnuplot\bin
DEMETER_BASE is:
   C:\Users\lawley_c\AppData\Roaming\DemeterPerl
IFEFFIT_DIR is:
   C:\Users\lawley_c\AppData\Roaming\DemeterPerl\c\share\ifeffit\

perl version: v5.24.0
backend: ifeffit

@INC:
   
C:/Users/lawley_c/AppData/Roaming/DemeterPerl/perl/site/lib/MSWin32-x64-multi-thread
   C:/Users/lawley_c/AppData/Roaming/DemeterPerl/perl/site/lib
   C:/Users/lawley_c/AppData/Roaming/DemeterPerl/perl/vendor/lib
   C:/Users/lawley_c/AppData/Roaming/DemeterPerl/perl/lib
   .
Demeter version 0.9.26

Can't call method "SetValue" on an undefined value at 
C:/Users/lawley_c/AppData/Roaming/DemeterPerl/perl/site/lib/Demeter/UI/Athena/PeakFit.pm
 line 916.


Where lines 910-920 in the PeakFit.pm file readout as:

910   if ($result == wxID_NO) {
911   $::app->{main}->status("Not deleting lineshape.");
912   return 0;
913   };
914   ## demolish the LineShape object, if it exists
915   $this->{'lineshape'.$n}->DEMOLISH if exists $this->{'lineshape'.$n};
916   ## dig through the hierarchy of the StaticBox and Remove/Destroy each 
element
917   foreach my $s ($this->{'func'.$n}->GetChildren) {
918foreach my $w ($s->GetSizer->GetChildren) {
919$w->GetWindow->Destroy if defined($w->GetWindow);

I couldnt find any previous thread regarding this issue. If anyone knows a 
solution or could link me to a pre existing thread I would much appreciate it.

Thanks in advance
Craig

___
Paul Scherrer Institut
Craig Lawley
OFLB/U109
Forschungsstrasse 111
5232 Villigen PSI
Schweiz


Telefon: +41 56 310 5054
E-Mail: craig.law...@psi.ch
www.psi.ch

___
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] Larch 0.9.43

2019-05-01 Thread Matt Newville
Hi Folks,

Larch 0.9.43 is now available, with installers for Windows, MacOS, and Linux
at
   https://millenia.cars.aps.anl.gov/xraylarch/installation.html

If you already have installed Larch, you should be able to update to the latest
version with
~>  conda update -c gsecars xraylarch

from a terminal on Linux or Mac OSX.  On Windows, you may have to specify
the full path with something like:
   C:\Users\\AppData\Local\Continuum\xraylarch\Scripts\conda.exe -c
gsecars xraylarch

If you have any trouble upgrading, you can simply remove the xraylarch
installation
folder and reinstall. If you would like to install Larch into a different
Python environment, please read
https://xraypy.github.io/xraylarch/installation.html

Version 0.9.43 has several improvements to the XAS Viewer GUI application,
including:
  -  better handling of read/write cycles of multiple Athena project files.
  -  better default normalization and better control over normalization,
especially for XANES data.
  -  improved PCA analysis (in part from the recent discussion here with
Joselaine Cáceres Gonzalez),  so that it now reports IND values to help
determine the number of components and reports eigenvalues from simple
matrix inversion (not SVD) so that they more closely match those in the
XAFS literature.
  -  addition of Partial Least Squares and LASSO regression analysis for
selection and prediction of external quantities (valence, for example)
based on training sets of XANES data with known values for these
quantities. This machine-learning approach is based on work of M Dyar, et
al in a series of papers over the past several years.


I encourage and request anyone interested, and especially MacOS users, to
try out the XAS Viewer app and let us know what needs improvement.

For people interested in using Larch from Python, Version 0.9.43 includes a
complete refactoring of the code to make Larch work better as a "normal"
Python library.  Specifically, the previous code organization with most of
the real analysis code in "plugins" has been replaced with all code now
placed within the main larch module, still organized by topic.  This
improves packaging -- `pip install xraylarch` can now work.  This code
reorganization also means that the python programmer can use more normal
imports to get at the Larch library so that one can simply do


>>> from larch.xafs import pre_edge, autobk, xftf

We also fixed a serious and deep flaw that selected a matplotlib plotting
library too early, making larch difficult to use with Jupyter, Spyder, or
other Qt-based GUIs.  This is now fixed, and import statements like the one
above can be seamlessly used in Jupyter notebooks.

I should note that the documentation and examples are definitely lagging
behind the code especially regarding the most recent developments, but this
will be worked on.  If you having any questions, trouble, or suggestions on
any part of Larch, please let us know.

--Matt Newville
___
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