Documentation / Manuel utilisateur en Python :
The random fields allow to take into account the spatial characteristics of a random variable.
A TDataServer
is associated to a spatial random variable from , or in .
Currently only one Spectral method, with two types of
variograms (Gaussian and Sine Cardinal), is
available in Uranie.
For instance, Uranie code is:
# Define the DataServer
tds = DataServer.TDataServer("TDSField", "Weight as Field")
tds.addAttribute(DataServer.TAttribute("x", 1, 51))
tds.addAttribute(DataServer.TAttribute("y", 1, 51))
tds.addAttribute(DataServer.TAttribute("Weight"))
# Gaussian Sampler Field
tsf = Sampler.TSamplerField(tds)
tsf.SetScaleFactor(10.0)
tsf.SetRandomFunction(1000)
tsf.setVariogram("gauss")
tsf.SetVariance(1.0)
tsf.generateSample()
# Graphic
canvas = ROOT.TCanvas()
canvas.Divide(1,2)
canvas.cd(1)
tds.Draw("Weight:y:x")
canvas.Modified()
canvas.Update()
canvas.cd(2)
tsf.Draw2D("x", "y", "tri2Z")
Allocation of a pointer of a random variable sampler with variables described in the | |
The | |
This step, along with the other drawing method few line earlier, gives the results shown in Figure III.12. |
It is possible to vary the value of the parameters used to construct the field, leading to different shapes. Examples of this are shown for the two implemented types of variograms, Gaussian in Figure III.13 and for Sine Cardinal in Figure III.14.
Figure III.13. Gaussian variograms. Several configurations (in terms of scale factor and variance parameters) are shown as well.
Figure III.14. Sine cardinal variograms. Several configurations (in terms of scale factor and variance parameters) are shown as well.