Changeset 495 for trunk/SRC/ToBeReviewed/STRUCTURE/where_tag.pro
- Timestamp:
- 04/17/14 10:49:43 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/STRUCTURE/where_tag.pro
r375 r495 8 8 ; 9 9 ; Like the <proidl>WHERE</proidl> function but for use with structures 10 ; 10 ; 11 11 ; @categories 12 12 ; Structure … … 17 17 ; @keyword TAG_NAME 18 18 ; Scalar string specifying Tag Name 19 ; 19 ; 20 20 ; @keyword TAG_NUMBER 21 21 ; Otherwise give the Tag Number 22 ; 22 ; 23 23 ; @keyword RANGE 24 24 ; [min,max] range to search for in STRUCT 25 ; 25 ; 26 26 ; @keyword VALUES 27 27 ; One or array of numbers to match for in STRUCT 28 ; 28 ; 29 29 ; @keyword ISELECT 30 30 ; Specifies indices to select only part of structure array, 31 31 ; (use it to recycle subscripts from previous searches). 32 ; 32 ; 33 33 ; @keyword NOPRINT 34 34 ; Suppress informational messages about nothing found. … … 37 37 ; Nfound {out} 38 38 ; # of occurrences found. 39 ; 39 ; 40 40 ; @restrictions 41 41 ; User *must* specify (1) TAG_NAME or TAG_NUMBER to search, and (2) … … 44 44 ; @examples 45 45 ; 46 ; Suppose STR is a structure with tags CAT_NO:indgen(10), and 46 ; Suppose STR is a structure with tags CAT_NO:indgen(10), and 47 47 ; NAME:strarr(10). Find the indices where STR.CAT_NO is between 3 and 5. 48 48 ; 49 ; IDL> print, WHERE_TAG( str, TAG_NAME = 'CAT_NO', VALUE = [3,4,5] ) 49 ; IDL> print, WHERE_TAG( str, TAG_NAME = 'CAT_NO', VALUE = [3,4,5] ) 50 50 ; or 51 ; IDL> print, WHERE_TAG( str, TAG_NUM = 0, RANGE = [3,5]) 51 ; IDL> print, WHERE_TAG( str, TAG_NUM = 0, RANGE = [3,5]) 52 52 ; 53 53 ; @history … … 57 57 ; @version 58 58 ; $Id$ 59 ; 59 ; 60 60 ;- 61 61 FUNCTION where_tag, Struct, Nfound, TAG_NAME=tag_name, $ … … 99 99 endif 100 100 101 if N_elements( ipart ) GT 0 then begin ;check if any searching 101 if N_elements( ipart ) GT 0 then begin ;check if any searching 102 102 ;on a subset of input. 103 103 w = where( ipart GE 0, nf )
Note: See TracChangeset
for help on using the changeset viewer.