[AIT logo]

Institut für Astronomie und Astrophysik

Abteilung Astronomie

Waldhäuser Str. 64, D-72076 Tübingen, Germany
[Uni logo]


WHERE_TAG Source code in where_tag.pro

WHERE_TAG

Name
       WHERE_TAG
Purpose
       Like WHERE but works on structure tag names
Explanation
       Obtain subscripts of elements in structure array for which
       a particular Tag has values in a range or matching specified values.
       Like the WHERE function but for use with structures
Category
                       Structures
Calling Sequence
        w = where_tag( struct, [ Nfound,  TAG_NAME=, TAG_NUMBER = , RANGE =,
                               VALUES =, RANGE =, ISELECT =, /NOPRINT ]
Input Parameters
       Struct = structure array to search.
Keyword Parameters
       User *must* specify (1) TAG_NAME or TAG_NUMBER to search, and (2)
               the VALUES or RANGE to search on
       TAG_NAME = Scalar string specifying Tag Name
       TAG_NUMBER = otherwise give the Tag Number,
       RANGE = [min,max] range to search for in Struct,
       VALUES = one or array of numbers to match for in Struct,
       ISELECT= specifies indices to select only part of structure array,
               (use it to recycle subscripts from previous searches).
       /NOPRINT = suppress informational messages about nothing found.
Output Parameters
       Nfound = # of occurences found.
Returns
       Function returns subscripts (indices) to desired elements.
Example
       Suppose STR is a structure with tags CAT_NO:indgen(10), and
               NAME:strarr(10).   Find the indices where STR.CAT_NO is
               between 3 and 5.
       IDL> print, WHERE_TAG( str, TAG_NAME = 'CAT_NO', VALUE = [3,4,5] )  ;or
       IDL> print, WHERE_TAG( str, TAG_NUM = 0, RANGE = [3,5])
Procedure
       Get tag number and apply the WHERE function appropriately.
Revision History
       written 1990 Frank Varosi STX @ NASA/GSFC
       Stop printing "Tag  not found" with /NOPRINT, CD Pike 8-Jun-93

Last modified by pro2html on 2001 April 26 at 03:14 UTC

[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]

Jörn Wilms (wilms@astro.uni-tuebingen.de)
Updated automatically