dustem_collect_wav.pro 864 Bytes
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