source: sasview/sansdataloader/docs/sphinx/html/api/readers/cansas_reader.html @ 96cbb53

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 96cbb53 was fc5d49e3, checked in by Jessica Tumarkin <jtumarki@…>, 13 years ago
  • 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="danse_reader" href="danse_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="danse_reader.html" title="danse_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" title="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"><p class="first"><strong>path</strong> &#8211; file path</p>
81</td>
82</tr>
83<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Data1D object if a single SASentry was found,
84or a list of Data1D objects if multiple entries were found,
85or None of nothing was found</p>
86</td>
87</tr>
88<tr class="field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
89<li><strong>RuntimeError</strong> &#8211; when the file can&#8217;t be opened</li>
90<li><strong>ValueError</strong> &#8211; when the length of the data vectors are inconsistent</li>
91</ul>
92</td>
93</tr>
94</tbody>
95</table>
96</dd></dl>
97
98<dl class="method">
99<dt id="DataLoader.readers.cansas_reader.Reader.write">
100<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>
101<dd><p>Write the content of a Data1D as a CanSAS XML file</p>
102<table class="docutils field-list" frame="void" rules="none">
103<col class="field-name" />
104<col class="field-body" />
105<tbody valign="top">
106<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
107<li><strong>filename</strong> &#8211; name of the file to write</li>
108<li><strong>datainfo</strong> &#8211; Data1D object</li>
109</ul>
110</td>
111</tr>
112</tbody>
113</table>
114</dd></dl>
115
116</dd></dl>
117
118<dl class="function">
119<dt id="DataLoader.readers.cansas_reader.get_content">
120<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>
121<dd><p>Get the first instance of the content of a xpath location.</p>
122<table class="docutils field-list" frame="void" rules="none">
123<col class="field-name" />
124<col class="field-body" />
125<tbody valign="top">
126<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
127<li><strong>location</strong> &#8211; xpath location</li>
128<li><strong>node</strong> &#8211; node to start at</li>
129</ul>
130</td>
131</tr>
132<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Element, or None</p>
133</td>
134</tr>
135</tbody>
136</table>
137</dd></dl>
138
139<dl class="function">
140<dt id="DataLoader.readers.cansas_reader.get_float">
141<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>
142<dd><p>Get the content of a node as a float</p>
143<table class="docutils field-list" frame="void" rules="none">
144<col class="field-name" />
145<col class="field-body" />
146<tbody valign="top">
147<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
148<li><strong>location</strong> &#8211; xpath location</li>
149<li><strong>node</strong> &#8211; node to start at</li>
150</ul>
151</td>
152</tr>
153</tbody>
154</table>
155</dd></dl>
156
157<dl class="function">
158<dt id="DataLoader.readers.cansas_reader.write_node">
159<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>
160<dd><table class="docutils field-list" frame="void" rules="none">
161<col class="field-name" />
162<col class="field-body" />
163<tbody valign="top">
164<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
165<li><strong>doc</strong> &#8211; document DOM</li>
166<li><strong>parent</strong> &#8211; parent node</li>
167<li><strong>name</strong> &#8211; tag of the element</li>
168<li><strong>value</strong> &#8211; value of the child text node</li>
169<li><strong>attr</strong> &#8211; attribute dictionary</li>
170</ul>
171</td>
172</tr>
173<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>
174</td>
175</tr>
176</tbody>
177</table>
178</dd></dl>
179
180</div>
181</div>
182
183
184          </div>
185        </div>
186      </div>
187      <div class="sphinxsidebar">
188        <div class="sphinxsidebarwrapper">
189  <h3><a href="../../index.html">Table Of Contents</a></h3>
190  <ul>
191<li><a class="reference internal" href="#">cansas_reader</a><ul>
192<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>
193</ul>
194</li>
195</ul>
196
197  <h4>Previous topic</h4>
198  <p class="topless"><a href="associations.html"
199                        title="previous chapter">associations</a></p>
200  <h4>Next topic</h4>
201  <p class="topless"><a href="danse_reader.html"
202                        title="next chapter">danse_reader</a></p>
203  <h3>This Page</h3>
204  <ul class="this-page-menu">
205    <li><a href="../../_sources/api/readers/cansas_reader.txt"
206           rel="nofollow">Show Source</a></li>
207  </ul>
208<div id="searchbox" style="display: none">
209  <h3>Quick search</h3>
210    <form class="search" action="../../search.html" method="get">
211      <input type="text" name="q" size="18" />
212      <input type="submit" value="Go" />
213      <input type="hidden" name="check_keywords" value="yes" />
214      <input type="hidden" name="area" value="default" />
215    </form>
216    <p class="searchtip" style="font-size: 90%">
217    Enter search terms or a module, class or function name.
218    </p>
219</div>
220<script type="text/javascript">$('#searchbox').show(0);</script>
221        </div>
222      </div>
223      <div class="clearer"></div>
224    </div>
225    <div class="related">
226      <h3>Navigation</h3>
227      <ul>
228        <li class="right" style="margin-right: 10px">
229          <a href="../../genindex.html" title="General Index"
230             >index</a></li>
231        <li class="right" >
232          <a href="../../py-modindex.html" title="Python Module Index"
233             >modules</a> |</li>
234        <li class="right" >
235          <a href="danse_reader.html" title="danse_reader"
236             >next</a> |</li>
237        <li class="right" >
238          <a href="associations.html" title="associations"
239             >previous</a> |</li>
240        <li><a href="../../index.html">DataLoader v0.1.0 documentation</a> &raquo;</li>
241          <li><a href="index.html" >Readers</a> &raquo;</li> 
242      </ul>
243    </div>
244    <div class="footer">
245        &copy; Copyright 2010, sans group.
246      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
247    </div>
248  </body>
249</html>
Note: See TracBrowser for help on using the repository browser.