source: trunk/SRC/Documentation/idldoc_assistant_output/Matrix/make_selection.html @ 402

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

update documentation

File size: 6.0 KB
Line 
1
2
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4  <head>
5    <title>make_selection.pro (SAXO Documentation Assistant)</title>
6  </head>
7
8  <body text="#000000" bgcolor="#FFFFFF">
9
10   
11<!-- Navbar template takes a structure with the following fields:
12       overview_href :
13       overview_selected :
14       dir_overview_href :
15       dir_overview_selected :
16       categories_href :
17       categories_selected :
18       index_href :
19       index_selected :
20       search_href :
21       search_selected :
22       file_selected :
23       source_href :
24       source_selected :
25       help_href :
26       help_selected :
27       etc_selected :
28
29       prev_file_href :
30       next_file_href :
31
32       view_single_page_href :
33       view_frames_href :
34
35       summary_fields_href :
36       summary_routine_href :
37       details_routine_href :
38
39       title :
40       subtitle :
41       user :
42-->
43
44
45<table border="0" cellpadding="0" cellspacing="0" width="98%" bgcolor="#F0F0FF" valign="bottom">
46  <tr>
47    <td width="10%">
48<a href="inter.html"><img src="./../prev.gif" border="0" alt="Previous"></a></td>
49    <td width="80%" align="center" valign="center">
50<font size=-1><i>SAXO Documentation Assistant</i>: <a href="./../home.html">Overview</a></font></td>
51    <td width="10%" align="right">
52<a href="union.html"><img src="./../next.gif" border="0" alt="Next"></a></td>
53  </tr>
54</table>
55
56
57    <h1><font size="-2">Matrix/</font></h1>
58    <h2>make_selection.pro</h2>
59
60    <dl>
61    </dl>
62
63   
64 Convert an array of selected values to an index
65 array that identifies the selected values in a list or data array.
66
67
68   
69
70     
71      <a name="#_make_selection"></a>
72
73      <h2>make_selection  <font size="-1" color="#006633">
74 tools
75</font></h2>
76
77      <p><font face="Courier"><i>result = </i>make_selection(<i><a href="#_make_selection_keyword_names">names</a>, <a href="#_make_selection_keyword_selnames">selnames</a></i>, <a href="#_make_selection_keyword_ONLY_VALID">ONLY_VALID</a>=<i>ONLY_VALID</i>, <a href="#_make_selection_keyword_REQUIRED">REQUIRED</a>=<i>REQUIRED</i>, <a href="#_make_selection_keyword_QUIET">QUIET</a>=<i>QUIET</i>)</font></p>
78
79   
80
81
82    <h3>Return value</h3>
83 A (long) array with indexes to reference the selected values
84 in the NAMES array.
85
86
87   
88    <h3>Parameters</h3>
89   
90
91    <a name="#_make_selection_keyword_names"></a>
92    <h4>names&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
93      <font size="-1" color="#006633">in</font>
94     
95     
96      <font size="-1" color="#006633">required</font>
97     
98     
99     
100     
101    </h4>
102
103   
104 A list or array of values to choose from
105
106   
107
108    <a name="#_make_selection_keyword_selnames"></a>
109    <h4>selnames&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
110      <font size="-1" color="#006633">in</font>
111     
112     
113      <font size="-1" color="#006633">required</font>
114     
115     
116     
117     
118    </h4>
119
120   
121 A list of selected values
122
123   
124   
125
126   
127    <h3>Keywords</h3>
128
129   
130    <a name="#_make_selection_keyword_ONLY_VALID"></a>
131    <h4>ONLY_VALID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
132     
133     
134     
135     
136     
137     
138     
139     
140    </h4>
141
142   
143 Return only indexes of found values. Values not
144 found are skipped. Default is to return 1 index value for
145 each SELNAME, which is -1 if SELNAME is not contained in
146 NAMES. If ONLY_VALID is set, the -1 values will be deleted,
147 and a value of -1 indicates that no SELNAME has been found
148 at all.
149
150   
151    <a name="#_make_selection_keyword_REQUIRED"></a>
152    <h4>REQUIRED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
153     
154     
155     
156     
157     
158     
159     
160     
161    </h4>
162
163   
164 Normally, MAKE_SELECTION will return indexes for
165 all values that are found, simply ignoring the selected
166 values that are not in the NAMES array (although an error
167 message is displayed). Set this keyword to return with
168 -1 as soon as a selected value is not found.
169
170   
171    <a name="#_make_selection_keyword_QUIET"></a>
172    <h4>QUIET&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
173     
174     
175     
176     
177     
178     
179     
180     
181    </h4>
182
183   
184 Suppress printing of the error message if a
185 selected value is not found (the error condition will
186 still be set).
187
188   
189   
190
191    <h3>Examples</h3><pre>
192
193   IDL> names = [ 'Alfred','Anton','Peter','John','Mary']
194   IDL> index = MAKE_SELECTION(names,['Peter','Mary'])
195   IDL> print,index
196   2  4
197
198   IDL> vals = indgen(20)
199   IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9])
200   IDL> print,index
201   9  -1  8  7  7  8  9
202
203   IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/ONLY_VALID)
204   IDL> print,index
205   9  8  7  7  8  9
206
207   IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/REQUIRED)
208   IDL> print,index
209   -1
210
211   IDL> index = MAKE_SELECTION(vals,[9,-5,8,7,7,8,9],/REQUIRED,/QUIET)
212   % MAKE_SELECTION: Selected name not found in names array (-5)!
213   IDL> print,index
214   -1
215
216    </pre><h3>Version history</h3>
217   
218    <h4>Version</h4>
219 $Id: make_selection.pro 372 2008-08-08 12:31:53Z pinsard $
220
221    <h4>History</h4>
222 mgs, 28 Aug 1998: VERSION 1.00
223 mgs, 29 Aug 1998: - changed behavior and added ONLY_VALID keyword
224 Copyright (C) 1998, Martin Schultz, Harvard University
225 This software is provided as is without any warranty
226 whatsoever. It may be freely used, copied or distributed
227 for non-commercial purposes. This copyright notice must be
228 kept with any copy of this software. If this software shall
229 be used commercially or sold as part of a larger package,
230 please contact the author to arrange payment.
231 Bugs and comments should be directed to mgs@io.harvard.edu
232 with subject "IDL routine make_selection"
233
234   
235
236    <h3>Known issues</h3>
237   
238   
239   
240    <h4>Restrictions</h4>
241 If the NAMES array contains multiple entries of the same value,
242 only the index to the first entry will be returned.
243
244 A selection can contain multiple instances of the same value.
245 The index array will contain one entry per selected item
246 (See example below)
247
248
249   
250   
251   
252   
253   
254   
255   
256
257    <font size="-3"><p>&nbsp;</p></font>
258    <hr size="1" color="#CCCCCC"/>
259     
260
261   
262
263    <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0.</font></p>
264
265  </body>
266</html>
Note: See TracBrowser for help on using the repository browser.