Skip to content

Commit

Permalink
some updates to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Dec 1, 2023
1 parent 47c0788 commit 212a73f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
7 changes: 4 additions & 3 deletions examples/feffit/Chi2Map.lar
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

cu = read_ascii('../xafsdata/cu.chi')

fitparams = group(amp = param(1, vary=True),
Expand All @@ -18,5 +17,7 @@ dset = feffit_dataset(data=cu, pathlist=[path1], transform=trans)
out = feffit(fitparams, dset)
print( feffit_report(out))

ox, oy, map = chi2_map(out, 'de0', 'delr')
imshow(map, y=ox, x=oy)
ox, oy, map = chi2_map(out, 'de0', 'delr', sigma=2, nx=25, ny=25)
imshow(map, x=ox, y=oy, xlabel='de0', ylabel='delr', show_axis=True,
style='contour')
#, levels=[2, 4, 6, 8, 10])
4 changes: 2 additions & 2 deletions examples/feffit/Noise_Estimate2.lar
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# single precision, and consistent with the digitation in
# the Feff.dat file and linear interpolation
#
p1 = feffpath('feff0001.dat')
p1 = feffpath('feff0001.dat')
p1.e0 = 0
p1.sigma2 = 0.01 # 13
path2chi(p1)
Expand All @@ -14,7 +14,7 @@ fdat = group(k=p1.k, chi=sum)
trans = feffit_transform(kmin=4, kmax=16, kweight=3, dk=8,
window='hanning', rmin=2., rmax=3.8)
d1 = feffit_dataset(data=fdat, pathlist=[p1], transform=trans)
d1.prepare_fit()
d1.estimate_noise()
trans._xafsft(fdat.chi, group=fdat, rmax_out=32)
print( 'noise estimate k = ', d1.epsilon_k)
print( 'noise estimate r = ', d1.epsilon_r, log(d1.epsilon_r))
Expand Down
2 changes: 1 addition & 1 deletion examples/feffit/TestFit.lar
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ path1.sigma2 = 'ss2'
path1.deltar = 'delr'
path1.third = 'third'

trans = feffit_transform(kmin=3, kmax=14, kw=2, dk=4, window='bessel',
trans = feffit_transform(kmin=3, kmax=14, kw=2, dk=4, window='kaiser',
rmin=1.4, rmax=3.0)
dset = feffit_dataset(data=fdat, pathlist=[path1], transform=trans)

Expand Down
11 changes: 5 additions & 6 deletions examples/feffit/use_ff2chi.lar
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
p1 = feffpath('feff0001.dat', e0=0, sigma2=0.010)

for i in range(5):
e0 = -6 + 3*i
p1._calc_chi(e0=e0)
plot(p1.k, p1.chi*p1.k**2, label='e0= % .1f' % e0, new=i==0)
plot(p1.k, p1.chi*p1.k**2, label='e0= % .1f' % e0, new=(i==0), show_legend=True)
#endfor

e0 = 0.0
p1._calc_chi(e0=e0)
p2 = feffpath('feff0002.dat', e0=e0, sigma2=0.015)

total = ff2chi([p1, p2])


plot(total.k, total.chi*total.k**2, label='sum of paths', win=2)
plot(total.k, total.chi*total.k**2, label='sum of paths',
win=2, new=True, show_legend=True)

0 comments on commit 212a73f

Please sign in to comment.