source: trunk/SRC/Documentation/idldoc_html_output/Matrix/make_selection.html

Last change on this file was 402, checked in by smasson, 15 years ago

update documentation

File size: 7.4 KB
Line 
1
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5<!-- Generated by IDLdoc 2.0 -->
6
7<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8  <head>
9    <title>make_selection.pro (SAXO Documentation)</title>
10
11   
12    <link rel="stylesheet" type="text/css" media="all" href="./../main_files.css" />
13    <link rel="stylesheet" type="text/css" media="print" href="./../main_files_print.css" />
14   
15
16    <script type="text/javascript">
17      function setTitle() {
18        parent.document.title="make_selection.pro (SAXO Documentation)";
19      }
20    </script>
21  </head>
22
23  <body onload="setTitle();">
24
25    <div id="navbar_title">
26  <h1>SAXO Documentation</h1>
27</div>
28
29
30<div id="main_navbar">
31
32  <table cellspacing="0">
33    <tr>
34     
35      <td><a href="./../overview.html" title="Overview of library">Overview</a></td>
36     
37
38     
39      <td >Directory</td>
40     
41
42     
43      <td><a href="./../idldoc-categories.html" title="Browse library by category">Categories</a></td>
44     
45
46     
47      <td><a href="./../idldoc-index.html" title="Index of files, routines, and parameters">Index</a></td>
48     
49
50     
51      <td><a href="./../search-page.html" title="Search library">Search</a></td>
52     
53
54      <td id="selected">File</td>
55
56     
57      <td><a href="../../../Matrix//make_selection.pro" title="Source code of a file">Source</a></td>
58     
59
60     
61      <td><a href="./../idldoc-help.html" title="Help on IDLdoc">Help</a></td>
62     
63
64      <td >Etc</td>
65
66      <td id="flexible">Developer&nbsp;documentation</td>
67    </tr>
68  </table>
69
70</div>
71
72<div id="secondary_navbar">
73
74<a href="inter.html">&lt;&lt;prev file</a> | <a href="union.html">next file &gt;&gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="make_selection.html" target="_TOP">view single page</a> | <a href="./../index.html" target="_TOP">view frames</a>&nbsp;&nbsp;&nbsp;&nbsp;summary: fields | routine&nbsp;&nbsp;&nbsp;&nbsp;details: <a href="#routine_details">routine</a>
75
76</div>
77
78
79    <div id="container">
80
81      <h1 class="directory"><a href="directory-overview.html">Matrix/</a></h1>
82      <h2 class="pro_file">make_selection.pro</h2>
83
84      <div id="file_attr">
85        <dl>
86        </dl>
87      </div>
88
89      <div id="file_comments">
90 Convert an array of selected values to an index
91 array that identifies the selected values in a list or data array.
92</div>
93
94     
95
96     
97
98     
99
100     
101
102      <div id="routine_details">
103       
104
105        <div class="routine_details" id="_make_selection">
106
107          <h2><a class="top" href="#container">top</a>make_selection <span class="categories">
108 tools
109</span></h2>
110       
111          <p class="header">
112            <span class="result">result = </span>make_selection(<span class="result"><a href="#_make_selection_param_names">names</a>, <a href="#_make_selection_param_selnames">selnames</a></span>, <a href="#_make_selection_keyword_ONLY_VALID">ONLY_VALID</a>=<span class="result">ONLY_VALID</span>, <a href="#_make_selection_keyword_REQUIRED">REQUIRED</a>=<span class="result">REQUIRED</span>, <a href="#_make_selection_keyword_QUIET">QUIET</a>=<span class="result">QUIET</span>)</p>
113       
114          <div class="comments">
115</div>
116
117          <h3>Return value</h3><div class="preformat">
118 A (long) array with indexes to reference the selected values
119 in the NAMES array.
120</div>
121
122         
123            <h3>Parameters</h3>
124       
125           
126            <h4 id="_make_selection_param_names">names&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
127              <span class="attr">in</span>
128             
129             
130              <span class="attr">required</span>
131             
132             
133             
134             
135            </h4>
136       
137          <div class="comments">
138 A list or array of values to choose from
139</div>
140           
141            <h4 id="_make_selection_param_selnames">selnames&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
142              <span class="attr">in</span>
143             
144             
145              <span class="attr">required</span>
146             
147             
148             
149             
150            </h4>
151       
152          <div class="comments">
153 A list of selected values
154</div>
155           
156
157         
158
159         
160
161            <h3>Keywords</h3>
162           
163            <h4 id="_make_selection_keyword_ONLY_VALID">ONLY_VALID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
164             
165             
166             
167             
168             
169             
170             
171             
172            </h4>
173       
174            <div class="comments">
175 Return only indexes of found values. Values not
176 found are skipped. Default is to return 1 index value for
177 each SELNAME, which is -1 if SELNAME is not contained in
178 NAMES. If ONLY_VALID is set, the -1 values will be deleted,
179 and a value of -1 indicates that no SELNAME has been found
180 at all.
181</div>
182           
183            <h4 id="_make_selection_keyword_REQUIRED">REQUIRED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
184             
185             
186             
187             
188             
189             
190             
191             
192            </h4>
193       
194            <div class="comments">
195 Normally, MAKE_SELECTION will return indexes for
196 all values that are found, simply ignoring the selected
197 values that are not in the NAMES array (although an error
198 message is displayed). Set this keyword to return with
199 -1 as soon as a selected value is not found.
200</div>
201           
202            <h4 id="_make_selection_keyword_QUIET">QUIET&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
203             
204             
205             
206             
207             
208             
209             
210             
211            </h4>
212       
213            <div class="comments">
214 Suppress printing of the error message if a
215 selected value is not found (the error condition will
216 still be set).
217</div>
218           
219         
220
221          <h3>Examples</h3><div class="preformat">
222
223   IDL> names = [ 'Alfred','Anton','Peter','John','Mary']
224   IDL> index = MAKE_SELECTION(names,['Peter','Mary'])
225   IDL> print,index
226   2  4
227
228   IDL> vals = indgen(20)
229   IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9])
230   IDL> print,index
231   9  -1  8  7  7  8  9
232
233   IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/ONLY_VALID)
234   IDL> print,index
235   9  8  7  7  8  9
236
237   IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/REQUIRED)
238   IDL> print,index
239   -1
240
241   IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/REQUIRED,/QUIET)
242   % MAKE_SELECTION: Selected name not found in names array (-5)!
243   IDL> print,index
244   -1
245</div>
246          <h3>Version history</h3>
247         
248          <h4>Version</h4><div class="preformat">
249 $Id: make_selection.pro 372 2008-08-08 12:31:53Z pinsard $
250</div>
251          <h4>History</h4><div class="preformat">
252 mgs, 28 Aug 1998: VERSION 1.00
253 mgs, 29 Aug 1998: - changed behavior and added ONLY_VALID keyword
254 Copyright (C) 1998, Martin Schultz, Harvard University
255 This software is provided as is without any warranty
256 whatsoever. It may be freely used, copied or distributed
257 for non-commercial purposes. This copyright notice must be
258 kept with any copy of this software. If this software shall
259 be used commercially or sold as part of a larger package,
260 please contact the author to arrange payment.
261 Bugs and comments should be directed to mgs@io.harvard.edu
262 with subject "IDL routine make_selection"
263</div>
264         
265         
266          <h3>Known issues</h3>
267         
268         
269         
270          <h4>Restrictions</h4><div class="preformat">
271 If the NAMES array contains multiple entries of the same value,
272 only the index to the first entry will be returned.
273
274 A selection can contain multiple instances of the same value.
275 The index array will contain one entry per selected item
276 (See example below)
277</div>
278       
279         
280         
281         
282         
283         
284         
285         
286       
287          <h3>Statistics</h3>
288          <table class="statistics">
289            <tr><td>McCabe cyclic</td><td>           8</td></tr>
290            <tr><td>McCabe essential</td><td>           1</td></tr>
291            <tr><td>McCabe modular design</td><td>           1</td></tr>
292          </table>
293         
294       
295        </div>
296       
297      </div>
298
299     
300
301      <div id="tagline">Produced by IDLdoc 2.0.</div>
302
303    </div>
304
305  </body>
306</html>
Note: See TracBrowser for help on using the repository browser.