source: sasmodels/example/cylinder_eval.py @ 7b0abf8

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 7b0abf8 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
RevLine 
[2e66ef5]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.