[Ifeffit] linear combination using program code of athena

Bruce Ravel bravel at anl.gov
Mon Jan 8 07:36:05 CST 2007

On Sunday 07 January 2007 20:31, Bernd Griesebock wrote:
> I have a little problem using ifeffit with program code taken from athena.
> I try to make some linear combination calculations. Using Athena it
> works but using the code with ifeffit, I get some errors. Everything
> works fine untill the following lines:
> unguess
> erase @group l___cf
> set l___cf.eee = rh.energy+0
> set l___cf_npts = npts(l___cf.energy)
> set l___cf.data = splint(l___cf.eee,  rh.flat, l___cf.energy)
> ** cannot set scalar value to array **
>     l___cf.data = splint(l___cf.eee,rh.flat,l___cf.energy)
> The problem here seems to be the array "l___cf.energy". It is empty and
> I never found some declarations for it. At the beginning of my program I
> also load all macros athena is loading. Someone have an idea what is
> wrong with that code?

For some reason, when I wrote the code that generates those lines of
Ifeffit commands, I decided not to use Ifefift's slice and nofx
commands to construct the energy array.  The thing that is missing
from that sequence of commands is the bit where the energy array is
set to the contents of the eee array between emin and emax.  This is
done because the interpolations of the data and the minimization are
then done on the grid of the fit.  Rather than doing that chore using
Ifeffit commands, I chose to manipulate those arrays directly in perl.
I wrote that code almost 3 years ago, so I don't remember my

The lines I suggest below should do what you need done, assuming that
you replace emin and emax with the correct values of absolute energy
of the range over which you are doing the fit.

  set l___cf.eee = rh.energy+0

  set xmin = nofx(l___cf.eee, emin)
  set xmax = nofx(l___cf.eee, emax)
  set l___cf.energy = slice(l___cf.eee, xmin, xmax)

  set l___cf_npts = npts(l___cf.energy)
  set l___cf.data = splint(l___cf.eee,  rh.flat, l___cf.energy)



 Bruce Ravel  ---------------------------------------------- bravel at anl.gov

 Molecular Environmental Science Group, Building 203, Room E-165
 MRCAT, Sector 10, Advance Photon Source, Building 433, Room B007

 Argonne National Laboratory         phone and voice mail: (1) 630 252 5033
 Argonne IL 60439, USA                                fax: (1) 630 252 9793

 My homepage:    http://cars9.uchicago.edu/~ravel 
 EXAFS software: http://cars9.uchicago.edu/~ravel/software/

More information about the Ifeffit mailing list