Dear Bruce, thank you very much for the answer. I forgot to say that I load this macro which athena uses for the step function at the very beginning of using ifeffit. Your advise make me looking at my macro file, where I found a little typing error. That was it! Thank you so much! Regards Bernd
Message: 2 Date: Thu, 31 Aug 2006 09:33:26 -0500 From: Bruce Ravel
Subject: Re: [Ifeffit] problem with normalization To: XAFS Analysis using Ifeffit Message-ID: <200608310933.27010.bravel@anl.gov> Content-Type: text/plain; charset="iso-8859-6" On Thursday 31 August 2006 02:57, Bernd Griesebock wrote:
Hi there,
I have a litte question about normalizing data using the commands that athena uses.
I used the following commands (in an ifeffit shell), which I copied from the ifeffit buffer from athena, but I replaced most of the values with the corresponding variables (see at the "set" commands):
I have taken the liberty of numbering and slightly rearranging the lines of your script.
1 > read_data(file="Rh_sample_11.dat.spektrum.00040", group=rh, no_sort) 2 > set ___n = npts(rh.1) 3 > set rh.energy = 1000*rh.1 4 > set rh.xmu = (rh.2) / (rh.3) 5 > pre_edge("rh.energy+0", rh.xmu) 6 > erase rh.4 7 > show e0 8 > pre_edge("rh.energy+0", rh.xmu, e0=23228.9989104549, pre1=-150, 9 > pre2=-30, norm_order=3, norm1=150, norm2=514.053) 10 > spline("rh.energy+0", rh.xmu, e0=23228.9989104549, rbkg=1.0, kmin=0.5, 11 > kmax=12.695, kweight=1, dk=0, kwindow=kaiser-bessel, pre1=-150, 12 > pre2=-30, norm_order=3, norm1=150, norm2=514.053, clamp2=24, 13 > nclamp=5, interp=quad) 14 > set rh.preline = pre_offset+pre_slope*(rh.energy + 0) 15 > set rh.postline = 16 > norm_c0+norm_c1*(rh.energy+0.000000)+norm_c2*(rh.energy+0.000000)**2 17 > step rh.energy e0 rh.theta 18 > set flat_c0 =norm_c0 - pre_offset 19 > set flat_c1 =norm_c1 - pre_slope 20 > set flat_c2 =norm_c2 21 > set rh.line = (flat_c0 + flat_c1*(rh.energy+0) + 22 > flat_c2*(rh.energy+0)**2) 23 > set rh.flat = (rh.pre + (edge_step - rh.line)*rh.theta) / edge_step 24 > set rh.fbkg = (rh.bkg-rh.preline+(edge_step-rh.line)*rh.theta)/edge_step 25 > newplot(rh.energy+0, "1*rh.fbkg+0", xlabel="E (eV)", ylabel="norm 26 > x\gm(E)", fg=black, bg=white, grid, gridcolor="grey82", 27 > xmin=23028.99891, xmax=24028.99891, style=lines, color="red", 28 > key=bkg, title="rh_sample_11")
At this point athena plots the normalized background function with all data points in the post edge region at arround 1. This is exactly what I want, but in the ifeffit shell I get an error message: ** plot error: no data in y array
Ifeffit> show rh.fbkg rh.fbkg = 399 pts [-0.2709E-01: 1.205 ]
So there is data in that array! Using the following plot command:
newplot(rh.energy+0, rh.fbkg, xlabel="E (eV)", ylabel="norm x\gm(E)", fg=black, bg=white, grid, gridcolor="grey82", xmin=23028.99891, xmax=24028.99891, style=lines, color="red", key=bkg, title="rh_sample_11")
plots the background function but not normalized in the sense, that the data points in post edge region are at arround 1.
Where is my mistake??? If you need some plot examples please feel free to ask for them.
I suspect that the problem is in line 17 of the ifeffit script. "step" is not a built-in Ifeffit command. Instead it is a macro that Athena defines when you start the program. Fire up Athena and look near the beginning of the ifeffit buffer -- you'll see where the macro is defined.
The purpose of the macro is to define a step function centered at a given energy and placed on a particular energy grid. If you don't define this macro the .theta array is undefined, leading to trouble with the .flat and .fbkg arrays.
Hope that helps, B
participants (1)
-
Bernd Griesebock