Blame view

src/idl/dustem_cc_print.pro 3.75 KB
3e1ae712   Annie Hughes   First commit
1
2
3
4
5
6
7
8
9
10
PRO dustem_cc_print,filters,restart=restart,help=help

;+
; NAME:
;    dustem_cc_print
; 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
;    instrument teams.
f1bbfcb8   Annie Hughes   minor formatting ...
11
;    e.g. 1  MIPS HandBook, page 98
3e1ae712   Annie Hughes   First commit
12
;    http://irsa.ipac.caltech.edu/data/SPITZER/docs/mips/mipsinstrumenthandbook/MIPS_Instrument_Handbook.pdf
f1bbfcb8   Annie Hughes   minor formatting ...
13
14
15
;    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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
;    https://irsa.ipac.caltech.edu/IRASdocs/exp.sup/ch6/tabsupC6.html  
; CATEGORY:
;    DustEMWrap, Distributed, Low-Level
; CALLING SEQUENCE:
;    dustem_cc_print,filters[,restart=restart,help=help]
; INPUTS:
;    filter: names of filters for which color correction will be printed
; OPTIONAL INPUT PARAMETERS:
;    None
; OUTPUTS:
; OPTIONAL OUTPUT PARAMETERS:
; ACCEPTED KEY-WORDS:
;    help      = If set, print this help
;    restart   = If set, reinitialise DustEMWrap and use a new
;                wavelength vector for integration. 
; COMMON BLOCKS:
;    None
; SIDE EFFECTS:
;    None
; 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 
; PROCEDURES AND SUBROUTINES USED:
;    *** COMMENT AH --> is this really NONE? ****
; EXAMPLES
;    dustem_print_cc,['MIRI1','MIRI6'],/restart
;    dustem_print_cc,['IRAS1','IRAC2']
; MODIFICATION HISTORY:
;    Written by JPB Apr-2011
;    Evolution details on the DustEMWrap gitlab.
;    See http://dustemwrap.irap.omp.eu/ for FAQ and help.  

;== Initialize DustemWrap if restart not requested
  if keyword_set(restart) then begin
     dustem_init
     Nwav=60000 & wavmin=1. & wavmax=6000.
     wavs=findgen(Nwav)/(Nwav-1)*(wavmax-wavmin)+wavmin
  end else begin
     st=dustem_run()
     wavs=st.sed.wav
  end

;== Default filters to check
  if not keyword_set(filters) then begin
     message,'You must provide a list of filters',/info
     stop
  end

Nfilt=n_elements(filters)
wavref=dustem_filter2wav(filters)

;== Compute color corrections for power laws of frequency
pows=[-3.,-2.5,-2.,-1.5,-1.,-0.5,0.,0.5,1,1.5,2,2.5,3]
Nv=n_elements(pows)
K=fltarr(Nv,Nfilt)
frmt_tit1='(A10,A10,13F9.3)'
frmt1='(A10,15F9.3)'
FOR i=0L,Nv-1 DO BEGIN
  spec=wavs^(-1.*pows[i])
  sed=dustem_cc(wavs,spec,filters,cc=cc,fluxconv=fluxconv,help=help)
  K[i,*]=cc
ENDFOR

print,'====== Power laws, spectral index between -3 and 3 ======'
print,'Filters','lambda0',pows,format=frmt_tit1
print,'========================================================='
FOR i=0L,Nfilt-1 DO print,filters[i],wavref[i],K[*,i],format=frmt1
print,'========================================================='
print,'========================================================='
print,''

;== Compute color corrections for Black Bodies
Ts=[1.e4,5.e3,1.e3,500,300,200,150,100,70,50,30,25,20]
Nv=n_elements(Ts)
K=fltarr(Nv,Nfilt)
frmt_tit2='(A10,A10,16I9)'
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 ======'
print,'Filters','lambda0',Ts,format=frmt_tit2
print,'============================================================='
FOR i=0L,Nfilt-1 DO print,filters[i],wavref[i],K[*,i],format=frmt1
print,'============================================================='
print,'============================================================='


the_end:
END