[Ifeffit] linear combination using program code of athena

Bernd Griesebock griesebock at uni-wuppertal.de
Tue Jan 9 18:15:52 CST 2007


Thank you very much Bruce, that help me a lot. I finally fixed it by
using a slightly modulated part of the source code of Athena.

At this point I just want to report a little bug I found using the
linear combination function of Athena. Since I didn't use the plot
window I didn't realized it before.

initial position:
opened in Athena for example 3 standards and 2 groups of data sets.
Highlighted group1, switching to linear combination fitting (lcf).
If one switch now to group2 (still in lcf-window) the results of the fit
wont be what one expects cause the xmin and xmax for minimization
function is not recalculated. There can be a big difference in results
if one uses for example 2 groups of data sets, where e0 values are not
really close to each other.

I hope that maybe helps a bit.

Best regards,
Bernd


Bruce Ravel schrieb:
> 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
> reasoning.
>
> 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)
>
>
> B
>
>   
>
>   




More information about the Ifeffit mailing list