source: sasmodels/example/cylinder_eval.py @ 7624dd3

Last change on this file since 7624dd3 was 2e66ef5, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

add a short scripting guide; start in on developer docs

  • Property mode set to 100644
File size: 469 bytes
Line 
1"""
2Minimal example of calling a kernel for a specific set of q values.
3"""
4
5from numpy import logspace
6from matplotlib import pyplot as plt
7from sasmodels.core import load_model
8from sasmodels.direct_model import call_kernel
9
10model = load_model('cylinder')
11q = logspace(-3, -1, 200)
12kernel = model.make_kernel([q])
13Iq = call_kernel(kernel, dict(radius=200.))
14plt.loglog(q, Iq)
15plt.xlabel('q (1/A)')
16plt.ylabel('I(q)')
17plt.title('Cylinder with radius 200.')
18plt.show()
Note: See TracBrowser for help on using the repository browser.