;+ ; NAME: ; Instrument ; PURPOSE: ; Provides a means for consistently dealing with all the different instrument for which ; in situ observations are available ; CATEGORY: ; Auxilliary ; CALLING SEQUENCE: FUNCTION Instrument, which, $ imp8 = imp8 , $ celias = celias , $ windsw = windsw , $ windb = windb , $ acesw = acesw , $ swace = swace , $ aceb = aceb , $ somni = somni , $ eomni = eomni , $ helios1 = helios1 , $ helios2 = helios2 , $ stereoa = stereoa , $ stereob = stereob , $ swoops = swoops , $ vhm = vhm , $ mgs = mgs , $ name = name , $ label = label , $ nearearth = nearearth,$ L1 = L1 , $ list = list ; Result = Instrument( which [, /name, /label, /nearearth ) ; Result = Instrument( /imp8 [, /name, /label, /nearearth ) ; INPUTS: ; which scalar; string or integer ; integer ID of primary name of instrument ; OPTIONAL INPUT PARAMETERS: ; The following instrument keywords are available ; (instead of these keywords the argument 'which' can be set to 'imp8','celias', etc.) ; /imp8 ; /celias ; /windsw ; /windb ; /acesw ; /aceb ; /somni ; /helios1 ; /helios2 ; /stereoa Stereo Ahead ; /stereob Stereo Behind ; /swoops Ulysses plasma data ; /vhm Ulysses magnetic field data ; /mgs Mars global surveyor ; ; /name retrieves primary name ; /label retrieves alternative name (usually same as primary name) ; /nearearth identifies instrument as near-earth or deep-space ; /L1 identifies instrument as at L1. ; OUTPUTS: ; Result scalar; integer, byte or string ; /name set: string containing the primary name ; /label set: string containing the alternative name ; /nearearth set: 1B if instrument is a nearearth instrument; ; 0B if it is a deep-space instrument ; no keyword set: integer identifier for the instrument ; INCLUDE: @compile_opt.pro ; On error, return to caller ; PROCEDURE: ; Each of the in situ instruments is associated with an integer identifier. ; Currently listed by name are ; ['imp8','celias','windsw','somni','helios1','helios2','stereoa','stereob','swoops','acesw','aceb'] ; MODIFICATION HISTORY: ; FEB-2000, Paul Hick (UCSD/CASS) ; FEB-2000, Paul Hick (UCSD/CASS) ; Changed /omni to /somni; added /eomni ; FEB-2000, Paul Hick (UCSD/CASS) ; Added Mars Global Surveyor ; AUG-2007, John Clover (UCSD/CASS; jclover@ucsd.edu) ; Added STEREO A/B ; AUG-2007, Paul Hick (UCSD/CASS) ; Added keyword list to pull out list of all instruments. ; SEP-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Added instrument 'vhm' ;- names = ['imp8','celias','windsw','windb','somni','helios1','helios2','swoops','acesw','aceb','eomni','mgs' ,'stereoa','stereob' ,'vhm', 'swace'] IF keyword_set(list) THEN RETURN, names title = ['IMP8','SOHO/CELIAS','WIND/SWE','WIND/MAG','SOMNI','HELIOS1','HELIOS2','Ulysses/SWOOPS','ACE','ACE','EOMNI','Mars','Stereo A','Stereo B','Ulysses/VHM-FGM','ACE/SWEPAM'] near = [ 1B, 1B, 1B, 1B, 1B, 0B, 0B, 0B, 1B, 1B, 1B, 0B, 0B, 0B, 0B, 1B] nearL1 = [ 0B, 0B, 0B, 0B, 0B, 0B, 0B, 0B, 1B, 1B, 0B, 0B, 0B, 0B, 0B, 1B] sz = size(which) CASE sz[sz[0]+1] OF ; type of 'which' 0: BEGIN ; undefined instr = where(names EQ 'somni' ) IF keyword_set(imp8 ) THEN instr = where(names EQ 'imp8' ) $ ELSE IF keyword_set(celias ) THEN instr = where(names EQ 'celias' ) $ ELSE IF keyword_set(windsw ) THEN instr = where(names EQ 'windsw' ) $ ELSE IF keyword_set(windb ) THEN instr = where(names EQ 'windb' ) $ ELSE IF keyword_set(somni ) THEN instr = where(names EQ 'somni' ) $ ELSE IF keyword_set(eomni ) THEN instr = where(names EQ 'eomni' ) $ ELSE IF keyword_set(acesw ) THEN instr = where(names EQ 'acesw' ) $ ELSE IF keyword_set(aceb ) THEN instr = where(names EQ 'aceb' ) $ ELSE IF keyword_set(helios1) THEN instr = where(names EQ 'helios1') $ ELSE IF keyword_set(helios2) THEN instr = where(names EQ 'helios2') $ ELSE IF keyword_set(stereoa) THEN instr = where(names EQ 'stereoa') $ ELSE IF keyword_set(stereob) THEN instr = where(names EQ 'stereob') $ ELSE IF keyword_set(swoops ) THEN instr = where(names EQ 'swoops' ) $ ELSE IF keyword_set(mgs ) THEN instr = where(names EQ 'mgs' ) $ ELSE IF keyword_set(vhm ) THEN instr = where(names EQ 'vhm' ) $ ELSE IF keyword_set(swace ) THEN instr = where(names EQ 'swace' ) END 7: BEGIN ; string instr = where(names EQ strlowcase(which)) IF instr[0] EQ -1 THEN instr = where(names EQ 'somni') END ELSE: instr = which ; integer ENDCASE instr = instr[0] IF keyword_set(label ) THEN instr = title [instr] IF keyword_set(name ) THEN instr = names [instr] IF keyword_set(nearearth) THEN instr = near [instr] IF keyword_set(L1 ) THEN instr = nearL1[instr] RETURN, instr & END