Commit 1e005c8874bfc85c1a77c333669b21b732aa0d65
1 parent
575e1e3f
Exists in
master
inlie help
Showing
3 changed files
with
85 additions
and
15 deletions
Show diff stats
src/idl/dustem_cc.pro
... | ... | @@ -3,36 +3,50 @@ FUNCTION dustem_cc,wavein,spec,filter_names,cc=cc,fluxconv=fluxconv,help=help |
3 | 3 | ;+ |
4 | 4 | ; NAME: |
5 | 5 | ; dustem_cc |
6 | +; | |
6 | 7 | ; PURPOSE: |
7 | -; Computes observed sed and color correction for a given spectrum in a given filter | |
8 | +; Computes observed SED and color correction for a given spectrum in a given filter | |
9 | +; | |
8 | 10 | ; CATEGORY: |
9 | -; DustEMWrap, Mid-Level, Distributed | |
11 | +; DustEMWrap, Mid-Level, Distributed, Color corrections | |
12 | +; | |
10 | 13 | ; CALLING SEQUENCE: |
11 | 14 | ; sed=dustem_cc(wave,spec,filter_names,cc=cc,fluxconv=fluxconv,help=help) |
15 | +; | |
12 | 16 | ; INPUTS: |
13 | 17 | ; wave: array of wavelengths for spec |
14 | 18 | ; spec: spectrum (must be in brightness units) |
15 | -; filter_names: names of filters for which color correction is needed | |
19 | +; filter_names: names of filters for which color correction is | |
20 | +; needed | |
21 | +; | |
16 | 22 | ; OPTIONAL INPUT PARAMETERS: |
17 | 23 | ; None |
24 | +; | |
18 | 25 | ; OUTPUTS: |
19 | 26 | ; sed: SED as observed in filters provided in filter_names |
27 | +; | |
20 | 28 | ; OPTIONAL OUTPUT PARAMETERS: |
21 | 29 | ; cc = color correction coefficients (spec*cc=sed) |
30 | +; | |
22 | 31 | ; ACCEPTED KEY-WORDS: |
23 | 32 | ; fluxconv = if set, these are taken for flux conventions |
24 | 33 | ; possible values: 'nuInu=cste', 'IRAC', 'MIPS', 'CMB', |
25 | 34 | ; 'FLAMBDA=cste', 'HFI', 'LABOCA' |
26 | 35 | ; help = If set, print this help |
36 | +; | |
27 | 37 | ; COMMON BLOCKS: |
28 | 38 | ; None |
39 | +; | |
29 | 40 | ; SIDE EFFECTS: |
30 | 41 | ; None |
42 | +; | |
31 | 43 | ; RESTRICTIONS: |
32 | 44 | ; The DustEM fortran code must be installed |
33 | 45 | ; The DustEMWrap IDL code must be installed |
46 | +; | |
34 | 47 | ; PROCEDURE: |
35 | 48 | ; None |
49 | +; | |
36 | 50 | ; EXAMPLES |
37 | 51 | ; |
38 | 52 | ; MODIFICATION HISTORY: | ... | ... |
src/idl/dustem_cc_print.pro
... | ... | @@ -3,6 +3,7 @@ PRO dustem_cc_print,filters,restart=restart,help=help |
3 | 3 | ;+ |
4 | 4 | ; NAME: |
5 | 5 | ; dustem_cc_print |
6 | +; | |
6 | 7 | ; PURPOSE: |
7 | 8 | ; Print out numerical values of color correction for a given spectrum in a given filter |
8 | 9 | ; This is a sanity checking routine. |
... | ... | @@ -14,41 +15,52 @@ PRO dustem_cc_print,filters,restart=restart,help=help |
14 | 15 | ; AND |
15 | 16 | ; e.g. 2 IRAS Explanatory Supplement, Table VI.C.6 |
16 | 17 | ; https://irsa.ipac.caltech.edu/IRASdocs/exp.sup/ch6/tabsupC6.html |
18 | +; | |
17 | 19 | ; CATEGORY: |
18 | 20 | ; DustEMWrap, Distributed, Low-Level, User convenience |
21 | +; | |
19 | 22 | ; CALLING SEQUENCE: |
20 | 23 | ; dustem_cc_print,filters[,restart=restart,help=help] |
24 | +; | |
21 | 25 | ; INPUTS: |
22 | 26 | ; filter: names of filters for which color correction will be printed |
27 | +; | |
23 | 28 | ; OPTIONAL INPUT PARAMETERS: |
24 | 29 | ; None |
30 | +; | |
25 | 31 | ; OUTPUTS: |
32 | +; | |
26 | 33 | ; OPTIONAL OUTPUT PARAMETERS: |
34 | +; | |
27 | 35 | ; ACCEPTED KEY-WORDS: |
28 | 36 | ; help = If set, print this help |
29 | 37 | ; restart = If set, reinitialise DustEMWrap and use a new |
30 | 38 | ; wavelength vector for integration. |
31 | 39 | ; COMMON BLOCKS: |
32 | 40 | ; None |
41 | +; | |
33 | 42 | ; SIDE EFFECTS: |
34 | 43 | ; None |
44 | +; | |
35 | 45 | ; RESTRICTIONS: |
36 | 46 | ; The DustEM fortran code must be installed |
37 | 47 | ; The DustEMWrap IDL code must be installed |
38 | 48 | ; If restart is not set, this routine should be called after the |
39 | 49 | ; successful completion of a DustEMWrap run (i.e. without quitting the |
40 | 50 | ; IDL session) since it will use existing system variables |
51 | +; | |
41 | 52 | ; PROCEDURES AND SUBROUTINES USED: |
42 | -; *** COMMENT AH --> is this really NONE? **** | |
53 | +; | |
43 | 54 | ; EXAMPLES |
44 | 55 | ; dustem_print_cc,['MIRI1','MIRI6'],/restart |
45 | 56 | ; dustem_print_cc,['IRAS1','IRAC2'] |
57 | +; | |
46 | 58 | ; MODIFICATION HISTORY: |
47 | 59 | ; Written by JPB Apr-2011 |
48 | 60 | ; Evolution details on the DustEMWrap gitlab. |
49 | 61 | ; See http://dustemwrap.irap.omp.eu/ for FAQ and help. |
50 | 62 | |
51 | -;== Initialize DustemWrap if restart not requested | |
63 | +;== Initialize DustemWrap if restart requested | |
52 | 64 | if keyword_set(restart) then begin |
53 | 65 | dustem_init |
54 | 66 | Nwav=50000 & wavmin=0.1 & wavmax=500. |
... | ... | @@ -60,7 +72,7 @@ PRO dustem_cc_print,filters,restart=restart,help=help |
60 | 72 | wavs=st.sed.wav |
61 | 73 | end |
62 | 74 | |
63 | -;== Default filters to check | |
75 | +;== Check if user gave us filters | |
64 | 76 | if not keyword_set(filters) then begin |
65 | 77 | message,'You must provide a list of filters',/info |
66 | 78 | stop |
... | ... | @@ -70,7 +82,7 @@ Nfilt=n_elements(filters) |
70 | 82 | wavref=dustem_filter2wav(filters) |
71 | 83 | |
72 | 84 | ;== Compute color corrections for power laws of frequency |
73 | -pows=[2,1,0,-1,-2.] | |
85 | +pows=[3,2.5,2,2.5,1,0.5,0,-0.5,-1,-1.5,-2.,-2.5] | |
74 | 86 | Nv=n_elements(pows) |
75 | 87 | K=fltarr(Nv,Nfilt) |
76 | 88 | frmt_tit1='(A10,A10,A10,13F9.3)' |
... | ... | @@ -90,7 +102,7 @@ print,'=========================================================' |
90 | 102 | print,'' |
91 | 103 | |
92 | 104 | ;== Compute color corrections for Black Bodies |
93 | -Ts=[1.e4,5.e3,1.e3,500,200] | |
105 | +Ts=1.e3*[3.,4,6,8,10.] | |
94 | 106 | Nv=n_elements(Ts) |
95 | 107 | K=fltarr(Nv,Nfilt) |
96 | 108 | frmt_tit2='(A10,A10,A10,16I9)' | ... | ... |
src/idl/dustem_read_filters.pro
1 | -FUNCTION dustem_read_filters,bidon,plot_it=plot_it | |
1 | +;FUNCTION dustem_read_filters,bidon,plot_it=plot_it,help=help | |
2 | +FUNCTION dustem_read_filters,plot_it=plot_it,help=help | |
2 | 3 | |
4 | +;+ | |
5 | +; NAME: | |
6 | +; dustem_read_filters | |
7 | +; | |
8 | +; PURPOSE: | |
3 | 9 | ;Read filter information into the filter structure |
4 | 10 | ;cc_method is the name of the IDL functions used to compute SED for |
5 | 11 | ;those filters, including color correction appropriate for each |
... | ... | @@ -50,9 +56,43 @@ FUNCTION dustem_read_filters,bidon,plot_it=plot_it |
50 | 56 | ;; NIRCAMA:nircama_struct, $ |
51 | 57 | ;; NIRCAMB:nircamb_struct, $ |
52 | 58 | ;; NIRISS:niriss_struct $ |
53 | - | |
54 | - | |
55 | -;Authors: J.P. Bernard, N. Flagey, D. Paradis, A. Hughes | |
59 | +; | |
60 | +; CATEGORY: | |
61 | +; DustEMWrap, Distributed, Low-Level, Instrument Filters | |
62 | +; | |
63 | +; CALLING SEQUENCE: | |
64 | +; dustem_read_filters | |
65 | +; | |
66 | +; INPUTS: | |
67 | +; | |
68 | +; OPTIONAL INPUT PARAMETERS: | |
69 | +; None | |
70 | +; | |
71 | +; OUTPUTS: | |
72 | +; | |
73 | +; OPTIONAL OUTPUT PARAMETERS: | |
74 | +; | |
75 | +; ACCEPTED KEY-WORDS: | |
76 | +; plot_it = If set, make a plot of the filter transmission | |
77 | +; help = If set, print this help | |
78 | +; | |
79 | +; COMMON BLOCKS: | |
80 | +; None | |
81 | +; | |
82 | +; SIDE EFFECTS: | |
83 | +; None | |
84 | +; | |
85 | +; RESTRICTIONS: | |
86 | +; The DustEMWrap IDL code must be installed | |
87 | +; | |
88 | +; PROCEDURES AND SUBROUTINES USED: | |
89 | +; | |
90 | +; EXAMPLES | |
91 | +; | |
92 | +; MODIFICATION HISTORY: | |
93 | +; Authors: J.P. Bernard, N. Flagey, D. Paradis, A. Hughes | |
94 | +; Evolution details on the DustEMWrap gitlab. | |
95 | +; See http://dustemwrap.irap.omp.eu/ for FAQ and help. | |
56 | 96 | |
57 | 97 | quiet_old=!quiet |
58 | 98 | !quiet=1 |
... | ... | @@ -952,6 +992,7 @@ miri_struct={Name:'MIRI',Nbands:Nband,filter_names:filt_names,central_wavelength |
952 | 992 | ;====================================================== |
953 | 993 | ;==== JWST-NIRCAM module averaged |
954 | 994 | ;====================================================== |
995 | + | |
955 | 996 | IF print_messages THEN message,'Reading module-averaged (AB) NIRCAM filter transmissions',/continue |
956 | 997 | |
957 | 998 | Nband=29 |
... | ... | @@ -965,7 +1006,8 @@ FOR i=0L,Nband-1 DO BEGIN |
965 | 1006 | readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,transmissions_E,comment='#' |
966 | 1007 | freq=cmic/waves_mic |
967 | 1008 | Trans=transmissions_E/freq |
968 | - T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic) | |
1009 | + | |
1010 | + T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic) | |
969 | 1011 | ENDFOR |
970 | 1012 | |
971 | 1013 | nircam_struct={Name:'NIRCAM',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_spass,central_frequencies:cmic/wfilt_spass, $ |
... | ... | @@ -988,7 +1030,7 @@ FOR i=0L,Nband-1 DO BEGIN |
988 | 1030 | readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,transmissions_E,comment='#' |
989 | 1031 | freq=cmic/waves_mic |
990 | 1032 | Trans=transmissions_E/freq |
991 | - T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic) | |
1033 | + T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic) | |
992 | 1034 | ENDFOR |
993 | 1035 | |
994 | 1036 | nircama_struct={Name:'NIRCAMA',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_spass,central_frequencies:cmic/wfilt_spass, $ |
... | ... | @@ -999,6 +1041,7 @@ nircama_struct={Name:'NIRCAMA',Nbands:Nband,filter_names:filt_names,central_wave |
999 | 1041 | ;====================================================== |
1000 | 1042 | ;==== JWST-NIRCAM |
1001 | 1043 | ;====================================================== |
1044 | + | |
1002 | 1045 | IF print_messages THEN message,'Reading NIRCAM module B filter transmissions',/continue |
1003 | 1046 | |
1004 | 1047 | Nband=29 |
... | ... | @@ -1012,7 +1055,8 @@ FOR i=0L,Nband-1 DO BEGIN |
1012 | 1055 | readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,transmissions_E,comment='#' |
1013 | 1056 | freq=cmic/waves_mic |
1014 | 1057 | Trans=transmissions_E/freq |
1015 | - T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic) | |
1058 | +; readcol,dir_nircam+dustem_filter2filter_filename(filt_names[i]),waves_mic,Trans,comment="#" | |
1059 | + T_ptr[i]=ptr_new(Trans/max(Trans)) & nu_ptr[i]=ptr_new(freq) & wav_ptr[i]=ptr_new(waves_mic) | |
1016 | 1060 | ENDFOR |
1017 | 1061 | |
1018 | 1062 | nircamb_struct={Name:'NIRCAMB',Nbands:Nband,filter_names:filt_names,central_wavelengths:wfilt_spass,central_frequencies:cmic/wfilt_spass, $ | ... | ... |