Blame view

src/idl_misc/dustem_collect_wav.pro 864 Bytes
427f1205   Jean-Michel Glorian   version 4.2 merged
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FUNCTION dustem_collect_wav,filt_names

;Collects all wavelengths of filter transmission for the
;requested filters.
;sort them in increasing order and removes duplicates.

Nfilt=n_elements(filt_names)
all_wavs=[0.D0]

Ninst=n_tags((*!dustem_filters))
ifilt=lonarr(Nfilt)   ;index of the instrument in !dustem_filters
jfilt=lonarr(Nfilt)   ;index of the filter in !dustem_filters

FOR i=0L,Ninst-1 DO BEGIN
  match,filt_names,(*!dustem_filters).(i).filter_names,ind1,ind2,count=count
  IF count NE 0 THEN BEGIN
    ifilt(ind1)=i
    jfilt(ind1)=ind2
  ENDIF
ENDFOR

FOR i=0L,Nfilt-1 DO BEGIN
  all_wavs=[all_wavs,*((*!dustem_filters).(ifilt(i)).FILTER_WAVELENGTHS)(jfilt(i))]
ENDFOR
all_wavs=all_wavs(1:*)

;==sort wavelengths
order=sort(all_wavs)
all_wavs=all_wavs(order)

;remove multiple occurences
un=uniq(all_wavs)
all_wavs=all_wavs(un)

RETURN,all_wavs

END