Dear XrayUtilities-Users
Lately there were some changes in XrayUtilities which are part of version
1.0.5 (released today: February 9th 2014) which might make small changes
to your scripts necessary.
In particular the changes affect you if you are using the *Gridder* classes
of xrayutilities
Let me briefly outline how the Gridder now works. The following basically
applies to 1D,2D, and 3D gridder in the same way. I will use the 2D gridder
as an example.
The most easiest use (what most user might need) is:
import xrayutilities as xu # import python package
g = xu.Gridder2D(100,101) # initialize the Gridder object
#====== load some data here =====
g(x,y,data) # call the gridder with the data
griddata = g.data # the data object of the Gridder contains the gridded
data.
Note: previously you could use the g.gdata data object which was always an
internal buffer and should not be used anymore!
A more complicated example showing also sequential gridding is shown below.
You need sequential gridding when you can not load all data at the same
time. in such cases you need to specify the data range before the first
call to the gridder.
import xrayutilities as xu # import python package
g = xu.Gridder2D(100,101) # initialize the Gridder object
g.KeepData(True)
g.dataRange((1,2),(3,4)) # (xgrd_min,xgrd_max),(ygrd_min,ygrd_max)
#====== load some data here =====
g(x,y,data) # call the gridder with the data
griddata = g.data # the data object of the Gridder contains the so far
gridded data.
#====== load some more data here =====
g(x,y,data) # call the gridder with the new data
griddata = g.data # the data object of the Gridder contains the combined
gridded data.
In the new version there are also be some more improvements and small bug
fixes and I recommend everyone to update to this version. In particular
interesting is that now you can now read basically all data files directly
from zipped files (gzip and bzip2).
kind regards
Dominik
|