Blame view

src/idl/dustem_cc_print.pro 3.97 KB
e475799b   Annie Hughes   switched logic of...
1
PRO dustem_cc_print,filters,norestart=norestart,help=help
3e1ae712   Annie Hughes   First commit
2
3
4
5

;+
; NAME:
;    dustem_cc_print
1e005c88   Annie Hughes   inlie help
6
;
3e1ae712   Annie Hughes   First commit
7
8
9
10
; PURPOSE:
;    Print out numerical values of color correction for a given spectrum in a given filter
;    This is a sanity checking routine.
;    Output should be compared to the color-correction tables published by different
470d05c4   Annie Hughes   better comments
11
;    instrument teams. See also dustem_cc_verify.pro
f1bbfcb8   Annie Hughes   minor formatting ...
12
;    e.g. 1  MIPS HandBook, page 98
3e1ae712   Annie Hughes   First commit
13
;    http://irsa.ipac.caltech.edu/data/SPITZER/docs/mips/mipsinstrumenthandbook/MIPS_Instrument_Handbook.pdf
f1bbfcb8   Annie Hughes   minor formatting ...
14
15
16
;    http://irsa.ipac.caltech.edu/data/SPITZER/docs/mips/mipsinstrumenthandbook/51/
;    AND
;    e.g. 2  IRAS Explanatory Supplement, Table VI.C.6
3e1ae712   Annie Hughes   First commit
17
;    https://irsa.ipac.caltech.edu/IRASdocs/exp.sup/ch6/tabsupC6.html  
1e005c88   Annie Hughes   inlie help
18
;
3e1ae712   Annie Hughes   First commit
19
; CATEGORY:
470d05c4   Annie Hughes   better comments
20
;    DustEMWrap, Distributed, Low-Level, User convenience, Development
1e005c88   Annie Hughes   inlie help
21
;
3e1ae712   Annie Hughes   First commit
22
23
; CALLING SEQUENCE:
;    dustem_cc_print,filters[,restart=restart,help=help]
1e005c88   Annie Hughes   inlie help
24
;
3e1ae712   Annie Hughes   First commit
25
26
; INPUTS:
;    filter: names of filters for which color correction will be printed
1e005c88   Annie Hughes   inlie help
27
;
3e1ae712   Annie Hughes   First commit
28
29
; OPTIONAL INPUT PARAMETERS:
;    None
1e005c88   Annie Hughes   inlie help
30
;
3e1ae712   Annie Hughes   First commit
31
; OUTPUTS:
1e005c88   Annie Hughes   inlie help
32
;
3e1ae712   Annie Hughes   First commit
33
; OPTIONAL OUTPUT PARAMETERS:
1e005c88   Annie Hughes   inlie help
34
;
3e1ae712   Annie Hughes   First commit
35
36
; ACCEPTED KEY-WORDS:
;    help      = If set, print this help
e475799b   Annie Hughes   switched logic of...
37
;    norestart   = If set, do not reinitialise DustEMWrap
470d05c4   Annie Hughes   better comments
38
;
3e1ae712   Annie Hughes   First commit
39
40
; COMMON BLOCKS:
;    None
1e005c88   Annie Hughes   inlie help
41
;
3e1ae712   Annie Hughes   First commit
42
43
; SIDE EFFECTS:
;    None
1e005c88   Annie Hughes   inlie help
44
;
3e1ae712   Annie Hughes   First commit
45
46
47
48
49
50
; RESTRICTIONS:
;    The DustEM fortran code must be installed
;    The DustEMWrap IDL code must be installed
;    If restart is not set, this routine should be called after the
;    successful completion of a DustEMWrap run (i.e. without quitting the
;    IDL session) since it will use existing system variables 
1e005c88   Annie Hughes   inlie help
51
;
3e1ae712   Annie Hughes   First commit
52
; PROCEDURES AND SUBROUTINES USED:
1e005c88   Annie Hughes   inlie help
53
;    
3e1ae712   Annie Hughes   First commit
54
; EXAMPLES
e475799b   Annie Hughes   switched logic of...
55
56
;    dustem_cc_print,['MIRI1','MIRI6']
;    dustem_cc_print,['IRAS1','IRAC2'],/norestart
1e005c88   Annie Hughes   inlie help
57
;
3e1ae712   Annie Hughes   First commit
58
59
60
61
62
; MODIFICATION HISTORY:
;    Written by JPB Apr-2011
;    Evolution details on the DustEMWrap gitlab.
;    See http://dustemwrap.irap.omp.eu/ for FAQ and help.  

470d05c4   Annie Hughes   better comments
63
64
65
66
67
IF keyword_set(help) THEN BEGIN
  doc_library,'dustem_cc_print'
  goto,the_end
ENDIF

e475799b   Annie Hughes   switched logic of...
68
69
70
71
72
73
;== Check if user gave us filters
  if not keyword_set(filters) then begin
     message,'You must provide a list of filters',/info
     stop
  end

1e005c88   Annie Hughes   inlie help
74
;== Initialize DustemWrap if restart requested
e475799b   Annie Hughes   switched logic of...
75
  if not keyword_set(norestart) then begin
3e1ae712   Annie Hughes   First commit
76
     dustem_init
4caf5d4a   Annie Hughes   changes for JWST ...
77
     Nwav=50000 & wavmin=0.1 & wavmax=500.
3e1ae712   Annie Hughes   First commit
78
     wavs=findgen(Nwav)/(Nwav-1)*(wavmax-wavmin)+wavmin
4caf5d4a   Annie Hughes   changes for JWST ...
79
80
     wavs=10^(alog10(wavmin)+alog10(wavmax)*(dindgen(Nwav+1)/Nwav))
     restart=0
3e1ae712   Annie Hughes   First commit
81
82
83
84
85
  end else begin
     st=dustem_run()
     wavs=st.sed.wav
  end

3e1ae712   Annie Hughes   First commit
86
87
88
89
Nfilt=n_elements(filters)
wavref=dustem_filter2wav(filters)

;== Compute color corrections for power laws of frequency
1e005c88   Annie Hughes   inlie help
90
pows=[3,2.5,2,2.5,1,0.5,0,-0.5,-1,-1.5,-2.,-2.5]
3e1ae712   Annie Hughes   First commit
91
92
Nv=n_elements(pows)
K=fltarr(Nv,Nfilt)
4caf5d4a   Annie Hughes   changes for JWST ...
93
94
frmt_tit1='(A10,A10,A10,13F9.3)'
frmt1='(A10,A10,15F9.3)'
3e1ae712   Annie Hughes   First commit
95
FOR i=0L,Nv-1 DO BEGIN
4caf5d4a   Annie Hughes   changes for JWST ...
96
97
98
   spec=wavs^(-1.*pows[i])
   sed=dustem_cc(wavs,spec,filters,cc=cc,fluxconv=fluxconv,help=help)
   K[i,*]=cc
3e1ae712   Annie Hughes   First commit
99
100
101
ENDFOR

print,'====== Power laws, spectral index between -3 and 3 ======'
4caf5d4a   Annie Hughes   changes for JWST ...
102
print,'Filters','AltName','lambda0',pows,format=frmt_tit1
3e1ae712   Annie Hughes   First commit
103
print,'========================================================='
4caf5d4a   Annie Hughes   changes for JWST ...
104
FOR i=0L,Nfilt-1 DO print,filters[i],dustem_filter2name(filters[i]),wavref[i],K[*,i],format=frmt1
3e1ae712   Annie Hughes   First commit
105
106
107
108
109
print,'========================================================='
print,'========================================================='
print,''

;== Compute color corrections for Black Bodies
1e005c88   Annie Hughes   inlie help
110
Ts=1.e3*[3.,4,6,8,10.]
3e1ae712   Annie Hughes   First commit
111
112
Nv=n_elements(Ts)
K=fltarr(Nv,Nfilt)
4caf5d4a   Annie Hughes   changes for JWST ...
113
frmt_tit2='(A10,A10,A10,16I9)'
3e1ae712   Annie Hughes   First commit
114
115
116
117
118
119
120
121
FOR i=0L,Nv-1 DO BEGIN
  spec=dustem_planck_function(Ts[i],wavs)
  sed=dustem_cc(wavs,spec,filters,cc=cc,fluxconv=fluxconv,help=help)
  K[i,*]=cc
ENDFOR

;== print results
print,'====== Blackbodies, temperatures between 20 and 10000K ======'
4caf5d4a   Annie Hughes   changes for JWST ...
122
print,'Filters','AltName','lambda0',Ts,format=frmt_tit2
3e1ae712   Annie Hughes   First commit
123
print,'============================================================='
4caf5d4a   Annie Hughes   changes for JWST ...
124
FOR i=0L,Nfilt-1 DO print,filters[i],dustem_filter2name(filters[i]),wavref[i],K[*,i],format=frmt1
3e1ae712   Annie Hughes   First commit
125
126
127
print,'============================================================='
print,'============================================================='

4caf5d4a   Annie Hughes   changes for JWST ...
128
;stop
3e1ae712   Annie Hughes   First commit
129
130
131

the_end:
END