Commit 2a4aa390a629feabcfac653a19490011d8ed1e03

Authored by Annie Hughes
1 parent dc84fd94
Exists in master

first commit

Showing 1 changed file with 60 additions and 0 deletions   Show diff stats
src/idl/dustem_filter2name.pro 0 → 100644
... ... @@ -0,0 +1,60 @@
  1 +FUNCTION dustem_filter2name,filter,help=help,restart=restart
  2 +
  3 +;+
  4 +; NAME:
  5 +; dustem_filter2name
  6 +; PURPOSE:
  7 +; Returns the instrument team's name for a given filter
  8 +; CATEGORY:
  9 +; Dustem
  10 +; CALLING SEQUENCE:
  11 +; filename=dustem_filter2name(filter[,/help][,/restart])
  12 +; INPUTS:
  13 +; filter = Filter name
  14 +; OPTIONAL INPUT PARAMETERS:
  15 +; None
  16 +; OUTPUTS:
  17 +; filename = file name
  18 +; OPTIONAL OUTPUT PARAMETERS:
  19 +; None
  20 +; ACCEPTED KEY-WORDS:
  21 +; help = If set, print this help
  22 +; restart = If set, (re-)initialise DustEMWrap
  23 +; COMMON BLOCKS:
  24 +; None
  25 +; RESTRICTIONS:
  26 +; The DustEMWrap IDL code must be installed
  27 +; PROCEDURE:
  28 +; None
  29 +; EXAMPLES
  30 +; print,dustem_filter2name(['MIRI1'])
  31 +; MODIFICATION HISTORY:
  32 +; Written by J.-Ph. Bernard
  33 +; see Evolution details on the DustEMWrap gitlab
  34 +; Contact J.-Ph. Bernard (Jean-Philippe.Bernard@cesr.fr) in case of problems.
  35 +
  36 +IF keyword_set(help) THEN BEGIN
  37 + doc_library,'dustem_filter2name'
  38 + fc='UNKNOWN'
  39 + goto,the_end
  40 +ENDIF
  41 +
  42 +if keyword_set(restart) then dustem_init
  43 +
  44 +Nfilt=n_elements(filter)
  45 +
  46 +ind1=lonarr(Nfilt)
  47 +FOR i=0L,Nfilt-1 DO BEGIN
  48 + ind=where(!dustem_instrument_description.filter EQ strtrim(filter(i),2),count)
  49 + IF count EQ 0 THEN BEGIN
  50 + message,'Filter: '+strtrim(filter(i),2)+' not found',/info
  51 + ENDIF
  52 + ind1(i)=ind(0)
  53 +ENDFOR
  54 +fc=!dustem_instrument_description(ind1).name
  55 +
  56 +the_end:
  57 +
  58 +RETURN,fc
  59 +
  60 +END
... ...