source: sasview/DataLoader/docs/sphinx/_build/html/api/readers/cansas_reader.html @ 83f4445

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 83f4445 was 0997158f, checked in by Gervaise Alina <gervyh@…>, 14 years ago

working on documentation

  • Property mode set to 100644
File size: 10.6 KB
Line 
1
2
3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6<html xmlns="http://www.w3.org/1999/xhtml">
7  <head>
8    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9   
10    <title>cansas_reader &mdash; DataLoader v0.1.0 documentation</title>
11    <link rel="stylesheet" href="../../_static/default.css" type="text/css" />
12    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
13    <script type="text/javascript">
14      var DOCUMENTATION_OPTIONS = {
15        URL_ROOT:    '../../',
16        VERSION:     '0.1.0',
17        COLLAPSE_INDEX: false,
18        FILE_SUFFIX: '.html',
19        HAS_SOURCE:  true
20      };
21    </script>
22    <script type="text/javascript" src="../../_static/jquery.js"></script>
23    <script type="text/javascript" src="../../_static/underscore.js"></script>
24    <script type="text/javascript" src="../../_static/doctools.js"></script>
25    <link rel="top" title="DataLoader v0.1.0 documentation" href="../../index.html" />
26    <link rel="up" title="Readers" href="index.html" />
27    <link rel="next" title="hfir1d_reader" href="hfir1d_reader.html" />
28    <link rel="prev" title="associations" href="associations.html" /> 
29  </head>
30  <body>
31    <div class="related">
32      <h3>Navigation</h3>
33      <ul>
34        <li class="right" style="margin-right: 10px">
35          <a href="../../genindex.html" title="General Index"
36             accesskey="I">index</a></li>
37        <li class="right" >
38          <a href="../../py-modindex.html" title="Python Module Index"
39             >modules</a> |</li>
40        <li class="right" >
41          <a href="hfir1d_reader.html" title="hfir1d_reader"
42             accesskey="N">next</a> |</li>
43        <li class="right" >
44          <a href="associations.html" title="associations"
45             accesskey="P">previous</a> |</li>
46        <li><a href="../../index.html">DataLoader v0.1.0 documentation</a> &raquo;</li>
47          <li><a href="index.html" accesskey="U">Readers</a> &raquo;</li> 
48      </ul>
49    </div> 
50
51    <div class="document">
52      <div class="documentwrapper">
53        <div class="bodywrapper">
54          <div class="body">
55           
56  <div class="section" id="cansas-reader">
57<h1>cansas_reader<a class="headerlink" href="#cansas-reader" title="Permalink to this headline">¶</a></h1>
58<div class="section" id="module-DataLoader.readers.cansas_reader">
59<span id="dataloader-readers-cansas-reader"></span><h2><a class="reference internal" href="#module-DataLoader.readers.cansas_reader"><tt class="xref py py-mod docutils literal"><span class="pre">DataLoader.readers.cansas_reader</span></tt></a><a class="headerlink" href="#module-DataLoader.readers.cansas_reader" title="Permalink to this headline">¶</a></h2>
60<dl class="class">
61<dt id="DataLoader.readers.cansas_reader.Reader">
62<em class="property">class </em><tt class="descclassname">DataLoader.readers.cansas_reader.</tt><tt class="descname">Reader</tt><a class="headerlink" href="#DataLoader.readers.cansas_reader.Reader" title="Permalink to this definition">¶</a></dt>
63<dd><p>Class to load cansas 1D XML files</p>
64<table class="docutils field-list" frame="void" rules="none">
65<col class="field-name" />
66<col class="field-body" />
67<tbody valign="top">
68<tr class="field"><th class="field-name">Dependencies :</th><td class="field-body">The CanSas reader requires PyXML 0.8.4 or later.</td>
69</tr>
70</tbody>
71</table>
72<dl class="method">
73<dt id="DataLoader.readers.cansas_reader.Reader.read">
74<tt class="descname">read</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#DataLoader.readers.cansas_reader.Reader.read" title="Permalink to this definition">¶</a></dt>
75<dd><p>Load data file</p>
76<table class="docutils field-list" frame="void" rules="none">
77<col class="field-name" />
78<col class="field-body" />
79<tbody valign="top">
80<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
81<li><strong>path</strong> &#8211; file path</li>
82</ul>
83</td>
84</tr>
85<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Data1D object if a single SASentry was found,
86or a list of Data1D objects if multiple entries were found,
87or None of nothing was found</p>
88</td>
89</tr>
90<tr class="field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
91<li><strong>RuntimeError</strong> &#8211; when the file can&#8217;t be opened</li>
92<li><strong>ValueError</strong> &#8211; when the length of the data vectors are inconsistent</li>
93</ul>
94</td>
95</tr>
96</tbody>
97</table>
98</dd></dl>
99
100<dl class="method">
101<dt id="DataLoader.readers.cansas_reader.Reader.write">
102<tt class="descname">write</tt><big>(</big><em>filename</em>, <em>datainfo</em><big>)</big><a class="headerlink" href="#DataLoader.readers.cansas_reader.Reader.write" title="Permalink to this definition">¶</a></dt>
103<dd><p>Write the content of a Data1D as a CanSAS XML file</p>
104<table class="docutils field-list" frame="void" rules="none">
105<col class="field-name" />
106<col class="field-body" />
107<tbody valign="top">
108<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
109<li><strong>filename</strong> &#8211; name of the file to write</li>
110<li><strong>datainfo</strong> &#8211; Data1D object</li>
111</ul>
112</td>
113</tr>
114</tbody>
115</table>
116</dd></dl>
117
118</dd></dl>
119
120<dl class="function">
121<dt id="DataLoader.readers.cansas_reader.get_content">
122<tt class="descclassname">DataLoader.readers.cansas_reader.</tt><tt class="descname">get_content</tt><big>(</big><em>location</em>, <em>node</em><big>)</big><a class="headerlink" href="#DataLoader.readers.cansas_reader.get_content" title="Permalink to this definition">¶</a></dt>
123<dd><p>Get the first instance of the content of a xpath location.</p>
124<table class="docutils field-list" frame="void" rules="none">
125<col class="field-name" />
126<col class="field-body" />
127<tbody valign="top">
128<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
129<li><strong>location</strong> &#8211; xpath location</li>
130<li><strong>node</strong> &#8211; node to start at</li>
131</ul>
132</td>
133</tr>
134<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Element, or None</p>
135</td>
136</tr>
137</tbody>
138</table>
139</dd></dl>
140
141<dl class="function">
142<dt id="DataLoader.readers.cansas_reader.get_float">
143<tt class="descclassname">DataLoader.readers.cansas_reader.</tt><tt class="descname">get_float</tt><big>(</big><em>location</em>, <em>node</em><big>)</big><a class="headerlink" href="#DataLoader.readers.cansas_reader.get_float" title="Permalink to this definition">¶</a></dt>
144<dd><p>Get the content of a node as a float</p>
145<table class="docutils field-list" frame="void" rules="none">
146<col class="field-name" />
147<col class="field-body" />
148<tbody valign="top">
149<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
150<li><strong>location</strong> &#8211; xpath location</li>
151<li><strong>node</strong> &#8211; node to start at</li>
152</ul>
153</td>
154</tr>
155</tbody>
156</table>
157</dd></dl>
158
159<dl class="function">
160<dt id="DataLoader.readers.cansas_reader.write_node">
161<tt class="descclassname">DataLoader.readers.cansas_reader.</tt><tt class="descname">write_node</tt><big>(</big><em>doc</em>, <em>parent</em>, <em>name</em>, <em>value</em>, <em>attr={}</em><big>)</big><a class="headerlink" href="#DataLoader.readers.cansas_reader.write_node" title="Permalink to this definition">¶</a></dt>
162<dd><table class="docutils field-list" frame="void" rules="none">
163<col class="field-name" />
164<col class="field-body" />
165<tbody valign="top">
166<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
167<li><strong>doc</strong> &#8211; document DOM</li>
168<li><strong>parent</strong> &#8211; parent node</li>
169<li><strong>name</strong> &#8211; tag of the element</li>
170<li><strong>value</strong> &#8211; value of the child text node</li>
171<li><strong>attr</strong> &#8211; attribute dictionary</li>
172</ul>
173</td>
174</tr>
175<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">True if something was appended, otherwise False</p>
176</td>
177</tr>
178</tbody>
179</table>
180</dd></dl>
181
182</div>
183</div>
184
185
186          </div>
187        </div>
188      </div>
189      <div class="sphinxsidebar">
190        <div class="sphinxsidebarwrapper">
191  <h3><a href="../../index.html">Table Of Contents</a></h3>
192  <ul>
193<li><a class="reference internal" href="#">cansas_reader</a><ul>
194<li><a class="reference internal" href="#module-DataLoader.readers.cansas_reader"><tt class="docutils literal"><span class="pre">DataLoader.readers.cansas_reader</span></tt></a></li>
195</ul>
196</li>
197</ul>
198
199  <h4>Previous topic</h4>
200  <p class="topless"><a href="associations.html"
201                        title="previous chapter">associations</a></p>
202  <h4>Next topic</h4>
203  <p class="topless"><a href="hfir1d_reader.html"
204                        title="next chapter">hfir1d_reader</a></p>
205  <h3>This Page</h3>
206  <ul class="this-page-menu">
207    <li><a href="../../_sources/api/readers/cansas_reader.txt"
208           rel="nofollow">Show Source</a></li>
209  </ul>
210<div id="searchbox" style="display: none">
211  <h3>Quick search</h3>
212    <form class="search" action="../../search.html" method="get">
213      <input type="text" name="q" size="18" />
214      <input type="submit" value="Go" />
215      <input type="hidden" name="check_keywords" value="yes" />
216      <input type="hidden" name="area" value="default" />
217    </form>
218    <p class="searchtip" style="font-size: 90%">
219    Enter search terms or a module, class or function name.
220    </p>
221</div>
222<script type="text/javascript">$('#searchbox').show(0);</script>
223        </div>
224      </div>
225      <div class="clearer"></div>
226    </div>
227    <div class="related">
228      <h3>Navigation</h3>
229      <ul>
230        <li class="right" style="margin-right: 10px">
231          <a href="../../genindex.html" title="General Index"
232             >index</a></li>
233        <li class="right" >
234          <a href="../../py-modindex.html" title="Python Module Index"
235             >modules</a> |</li>
236        <li class="right" >
237          <a href="hfir1d_reader.html" title="hfir1d_reader"
238             >next</a> |</li>
239        <li class="right" >
240          <a href="associations.html" title="associations"
241             >previous</a> |</li>
242        <li><a href="../../index.html">DataLoader v0.1.0 documentation</a> &raquo;</li>
243          <li><a href="index.html" >Readers</a> &raquo;</li> 
244      </ul>
245    </div>
246    <div class="footer">
247        &copy; Copyright 2010, sans group.
248      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0b1.
249    </div>
250  </body>
251</html>
Note: See TracBrowser for help on using the repository browser.