source: sasmodels/api/core.html @ 4a9a316

gh-pages
Last change on this file since 4a9a316 was 68532f3, checked in by ajj, 9 years ago

Adding docs

  • Property mode set to 100644
File size: 8.4 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
4
5<html xmlns="http://www.w3.org/1999/xhtml">
6  <head>
7    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8   
9    <title>3.3. Model access &mdash; Sasmodels</title>
10   
11    <link rel="stylesheet" href="../_static/haiku-site.css" type="text/css" />
12    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
13   
14    <script type="text/javascript">
15      var DOCUMENTATION_OPTIONS = {
16        URL_ROOT:    '../',
17        VERSION:     '0.9',
18        COLLAPSE_INDEX: false,
19        FILE_SUFFIX: '.html',
20        HAS_SOURCE:  true
21      };
22    </script>
23    <script type="text/javascript" src="../_static/jquery.js"></script>
24    <script type="text/javascript" src="../_static/underscore.js"></script>
25    <script type="text/javascript" src="../_static/doctools.js"></script>
26    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
27    <link rel="top" title="Sasmodels" href="../index.html" />
28    <link rel="up" title="3. Reference" href="index.html" />
29    <link rel="next" title="3.4. Simple interface" href="direct_model.html" />
30    <link rel="prev" title="3.2. Sasview to sasmodel converter" href="convert.html" /> 
31  </head>
32  <body>
33      <div class="header"><h1 class="heading"><a href="../index.html">
34          <span>Home</span></a></h1>
35        <h2 class="heading"><span>3.3. Model access</span></h2>
36      </div>
37      <div class="topnav">
38     
39        <p>
40        «&#160;&#160;<a href="convert.html">3.2. Sasview to sasmodel converter</a>
41        &#160;&#160;::&#160;&#160;
42        <a class="uplink" href="../index.html">Contents</a>
43        &#160;&#160;::&#160;&#160;
44        <a href="direct_model.html">3.4. Simple interface</a>&#160;&#160;»
45        </p>
46
47      </div>
48      <div class="content">
49       
50       
51  <div class="section" id="model-access">
52<h1>3.3. Model access<a class="headerlink" href="#model-access" title="Permalink to this headline">¶</a></h1>
53<div class="section" id="module-sasmodels.core">
54<span id="sasmodels-core"></span><h2>3.3.1. <a class="reference internal" href="#module-sasmodels.core" title="sasmodels.core"><tt class="xref py py-mod docutils literal"><span class="pre">sasmodels.core</span></tt></a><a class="headerlink" href="#module-sasmodels.core" title="Permalink to this headline">¶</a></h2>
55<p>Core model handling routines.</p>
56<dl class="function">
57<dt id="sasmodels.core.list_models">
58<tt class="descclassname">sasmodels.core.</tt><tt class="descname">list_models</tt><big>(</big><big>)</big><a class="headerlink" href="#sasmodels.core.list_models" title="Permalink to this definition">¶</a></dt>
59<dd><p>Return the list of available models on the model path.</p>
60</dd></dl>
61
62<dl class="function">
63<dt id="sasmodels.core.load_model_definition">
64<tt class="descclassname">sasmodels.core.</tt><tt class="descname">load_model_definition</tt><big>(</big><em>model_name</em><big>)</big><a class="headerlink" href="#sasmodels.core.load_model_definition" title="Permalink to this definition">¶</a></dt>
65<dd><p>Load a model definition given the model name.</p>
66</dd></dl>
67
68<dl class="function">
69<dt id="sasmodels.core.precompile_dll">
70<tt class="descclassname">sasmodels.core.</tt><tt class="descname">precompile_dll</tt><big>(</big><em>model_name</em>, <em>dtype='double'</em><big>)</big><a class="headerlink" href="#sasmodels.core.precompile_dll" title="Permalink to this definition">¶</a></dt>
71<dd><p>Precompile the dll for a model.</p>
72<p>Returns the path to the compiled model.</p>
73<p>This can be used when build the windows distribution of sasmodels
74(which may be missing the OpenCL driver and the dll compiler), or
75otherwise sharing models with windows users who do not have a compiler.</p>
76<p>See <a class="reference internal" href="kerneldll.html#sasmodels.kerneldll.make_dll" title="sasmodels.kerneldll.make_dll"><tt class="xref py py-func docutils literal"><span class="pre">sasmodels.kerneldll.make_dll()</span></tt></a> for details on controlling the
77dll path and the allowed floating point precision.</p>
78</dd></dl>
79
80<dl class="function">
81<dt id="sasmodels.core.load_model">
82<tt class="descclassname">sasmodels.core.</tt><tt class="descname">load_model</tt><big>(</big><em>model_definition</em>, <em>dtype='single'</em>, <em>platform='ocl'</em><big>)</big><a class="headerlink" href="#sasmodels.core.load_model" title="Permalink to this definition">¶</a></dt>
83<dd><p>Prepare the model for the default execution platform.</p>
84<p>This will return an OpenCL model, a DLL model or a python model depending
85on the model and the computing platform.</p>
86<p><em>model_definition</em> is the python module which defines the model.  If the
87model name is given instead, then <a class="reference internal" href="#sasmodels.core.load_model_definition" title="sasmodels.core.load_model_definition"><tt class="xref py py-func docutils literal"><span class="pre">load_model_definition()</span></tt></a> will be
88called with the model name.</p>
89<p><em>dtype</em> indicates whether the model should use single or double precision
90for the calculation. Any valid numpy single or double precision identifier
91is valid, such as &#8216;single&#8217;, &#8216;f&#8217;, &#8216;f32&#8217;, or np.float32 for single, or
92&#8216;double&#8217;, &#8216;d&#8217;, &#8216;f64&#8217;  and np.float64 for double.</p>
93<p><em>platform</em> should be &#8220;dll&#8221; to force the dll to be used for C models,
94otherwise it uses the default &#8220;ocl&#8221;.</p>
95</dd></dl>
96
97<dl class="function">
98<dt id="sasmodels.core.make_kernel">
99<tt class="descclassname">sasmodels.core.</tt><tt class="descname">make_kernel</tt><big>(</big><em>model</em>, <em>q_vectors</em><big>)</big><a class="headerlink" href="#sasmodels.core.make_kernel" title="Permalink to this definition">¶</a></dt>
100<dd><p>Return a computation kernel from the model definition and the q input.</p>
101</dd></dl>
102
103<dl class="function">
104<dt id="sasmodels.core.call_kernel">
105<tt class="descclassname">sasmodels.core.</tt><tt class="descname">call_kernel</tt><big>(</big><em>kernel</em>, <em>pars</em>, <em>cutoff=0</em><big>)</big><a class="headerlink" href="#sasmodels.core.call_kernel" title="Permalink to this definition">¶</a></dt>
106<dd><p>Call <em>kernel</em> returned from <a class="reference internal" href="#sasmodels.core.make_kernel" title="sasmodels.core.make_kernel"><tt class="xref py py-func docutils literal"><span class="pre">make_kernel()</span></tt></a> with parameters <em>pars</em>.</p>
107<p><em>cutoff</em> is the limiting value for the product of dispersion weights used
108to perform the multidimensional dispersion calculation more quickly at a
109slight cost to accuracy. The default value of <em>cutoff=0</em> integrates over
110the entire dispersion cube.  Using <em>cutoff=1e-5</em> can be 50% faster, but
111with an error of about 1%, which is usually less than the measurement
112uncertainty.</p>
113</dd></dl>
114
115<dl class="function">
116<dt id="sasmodels.core.call_ER">
117<tt class="descclassname">sasmodels.core.</tt><tt class="descname">call_ER</tt><big>(</big><em>info</em>, <em>pars</em><big>)</big><a class="headerlink" href="#sasmodels.core.call_ER" title="Permalink to this definition">¶</a></dt>
118<dd><p>Call the model ER function using <em>pars</em>.</p>
119<p><em>info</em> is either <em>model.info</em> if you have a loaded model, or <em>kernel.info</em>
120if you have a model kernel prepared for evaluation.</p>
121</dd></dl>
122
123<dl class="function">
124<dt id="sasmodels.core.call_VR">
125<tt class="descclassname">sasmodels.core.</tt><tt class="descname">call_VR</tt><big>(</big><em>info</em>, <em>pars</em><big>)</big><a class="headerlink" href="#sasmodels.core.call_VR" title="Permalink to this definition">¶</a></dt>
126<dd><p>Call the model VR function using <em>pars</em>.</p>
127<p><em>info</em> is either <em>model.info</em> if you have a loaded model, or <em>kernel.info</em>
128if you have a model kernel prepared for evaluation.</p>
129</dd></dl>
130
131</div>
132</div>
133
134
135      </div>
136      <div class="bottomnav">
137     
138        <p>
139        «&#160;&#160;<a href="convert.html">3.2. Sasview to sasmodel converter</a>
140        &#160;&#160;::&#160;&#160;
141        <a class="uplink" href="../index.html">Contents</a>
142        &#160;&#160;::&#160;&#160;
143        <a href="direct_model.html">3.4. Simple interface</a>&#160;&#160;»
144        </p>
145
146      </div>
147
148    <div class="footer">
149        &copy; Copyright 2014, sasview team.
150      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
151    </div>
152  </body>
153</html>
Note: See TracBrowser for help on using the repository browser.