dustem_old2new_ext_format.pro
1.59 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
PRO dustem_old2new_ext_format, dir=dir,file=file
;+
; NAME:
; dustem_old2new_ext_format
;
; PURPOSE:
; Converts an extinction curve in pre-4.3 DustEMWrap format into
; the new format.
;
; CATEGORY:
; DustEMWrap, Low-Level, Distributed, User-convenience
;
; CALLING SEQUENCE:
;
;
; INPUTS:
; filter = Filter name
;
; OPTIONAL INPUT PARAMETERS:
; None
;
; OUTPUTS:
; wave = reference wavelength (microns)
;
; OPTIONAL OUTPUT PARAMETERS:
; None
;
; ACCEPTED KEY-WORDS:
; help = If set, print this help
;
; COMMON BLOCKS:
; None
;
; SIDE EFFECTS:
; Reads instrument_description.xcat at each call. Not optimal.
;
; RESTRICTIONS:
; The DustEMWrap IDL code must be installed
;
; PROCEDURE:
; None
;
; EXAMPLES
; print,dustem_filter2wav(['IRAS1','MIPS3'])
;
; MODIFICATION HISTORY:
; Written by J.-Ph. Bernard
; Evolution details on the DustEMWrap gitlab.
; See http://dustemwrap.irap.omp.eu/ for FAQ and help.
;-
;NB: file should be the string of the old xcat file
dustem_init
use_dir=!dustem_wrap_soft_dir+'/Data/EXAMPLE_OBSDATA/'
if keyword_set(dir) then use_dir=dir
file=dir+file
str='cp '+file+' '+file+'.old'
spawn,str
old_ext=read_xcat(file,/silent,comments=old_comments)
Next=n_elements(old_ext)
new_ext=dustem_initialize_ext(Next,comments=new_comments,help=help)
comments=['Written by dustem_old2new_ext_format.pro on '+systime(0),old_comments,new_comments]
new_ext.instru=old_ext.instru
new_ext.filter=old_ext.filter
new_ext.wave=old_ext.wave
new_ext.EXT_I=old_ext.spec
new_ext.sigextII=(old_ext.error)^2
write_xcat,new_ext,file,comments=comments
END