Commit cdd2763e6a8ae46c523fb452928dc4188a5f65a9
1 parent
ce9a64c1
Exists in
master
brought up to date with new fomr of dustem_data system variable
Showing
4 changed files
with
36 additions
and
21 deletions
Show diff stats
src/idl/dustem_compute_gb_sed.pro
... | ... | @@ -57,11 +57,14 @@ ww=10.^ww |
57 | 57 | waves=ww |
58 | 58 | |
59 | 59 | ;MAKE A COPY OF THE (EMPTY) OBSERVED VALUES |
60 | -obs_sed = (*!dustem_data.sed).values | |
60 | +;stop | |
61 | +obs_sed = (*(*!dustem_data).sed).values | |
62 | + | |
63 | +;obs_sed = (*!dustem_data.sed).values | |
61 | 64 | |
62 | 65 | ;COMPUTE THE MODEL SED |
63 | 66 | dustem_sed = obs_sed*0.D0 |
64 | -ind_sed=where((*!dustem_data.sed).filt_names NE 'SPECTRUM',count_sed) | |
67 | +ind_sed=where((*(*!dustem_data).sed).filt_names NE 'SPECTRUM',count_sed) | |
65 | 68 | |
66 | 69 | IF !dustem_do_cc NE 0 AND !dustem_never_do_cc EQ 0 THEN BEGIN |
67 | 70 | message,'DOING color correction calculations',/info |
... | ... | @@ -76,13 +79,13 @@ IF !dustem_do_cc NE 0 AND !dustem_never_do_cc EQ 0 THEN BEGIN |
76 | 79 | spec=pp(0)*(ww)^(-1.*pp(2))*dustem_planck_function(pp(1),ww) |
77 | 80 | ; filter_names=((*!dustem_data).filt_names)(ind_sed) |
78 | 81 | ; FOR ii=0L,n_elements(filter_names)-1 DO BEGIN |
79 | - ssed=dustem_cc(ww,spec,((*!dustem_data.sed).filt_names)(ind_sed),cc=cc) | |
82 | + ssed=dustem_cc(ww,spec,((*(*!dustem_data).sed).filt_names)(ind_sed),cc=cc) | |
80 | 83 | ;print,cc |
81 | 84 | ; ENDFOR |
82 | 85 | dustem_sed[ind_sed]=ssed |
83 | 86 | ENDIF |
84 | 87 | ENDIF ELSE BEGIN |
85 | - www=dustem_filter2wav(((*!dustem_data.sed).filt_names)[ind_sed]) | |
88 | + www=dustem_filter2wav(((*(*!dustem_data).sed).filt_names)[ind_sed]) | |
86 | 89 | dustem_sed[ind_sed]=pp(0)*(www)^(-1.*pp(2))*dustem_planck_function(pp(1),www)*(*!dustem_previous_cc) |
87 | 90 | message,'SKIPPING color correction calculations',/info |
88 | 91 | ; dustem_sed(ind_sed)=interpol(spec,ww,1.D0*(((*!dustem_data).wav)(ind_sed)))*(*!dustem_previous_cc) |
... | ... | @@ -93,7 +96,7 @@ ENDELSE |
93 | 96 | ;For spectrum data points, interpolate in log-log |
94 | 97 | ;Linear interpolation leads to wrong values, in particular where few |
95 | 98 | ;wavelengths points exist in the model (long wavelengths). |
96 | -ind_spec=where((*!dustem_data.sed).filt_names EQ 'SPECTRUM',count_spec) | |
99 | +ind_spec=where((*(*!dustem_data).sed).filt_names EQ 'SPECTRUM',count_spec) | |
97 | 100 | IF count_spec NE 0 THEN BEGIN |
98 | 101 | dustem_sed[ind_spec]=interpol(spec,ww,(((*!dustem_data.sed).wav)[ind_spec])) |
99 | 102 | ; dustem_sed(ind_spec)=10^interpol(alog10(spec),alog10(st.sed.wav),alog10((((*!dustem_data.sed).wav)(ind_spec)))) | ... | ... |
src/idl/dustem_compute_gb_sed_fast.pro
... | ... | @@ -47,8 +47,10 @@ pp=double(p_dim) |
47 | 47 | w0=100. |
48 | 48 | |
49 | 49 | ;GET THE OBSERVATIONS AND ERRORS |
50 | -obs_sed = (*!dustem_data.sed).values | |
51 | -err_sed = (*!dustem_data.sed).sigma | |
50 | +;obs_sed = (*!dustem_data.sed).values | |
51 | +;err_sed = (*!dustem_data.sed).sigma | |
52 | +obs_sed = (*(*!dustem_data).sed).values | |
53 | +err_sed = (*(*!dustem_data).sed).sigma | |
52 | 54 | |
53 | 55 | ;COMPUTE THE MODEL SED |
54 | 56 | ;dustem_sed = obs_sed*0.D0 |
... | ... | @@ -68,8 +70,8 @@ IF !dustem_do_cc NE 0 AND !dustem_never_do_cc EQ 0 THEN BEGIN |
68 | 70 | ;waves=dindgen(NNw)/(1.*NNw-1)*(wwmax-wwmin)+wwmin |
69 | 71 | spec=pp(0)*(waves/w0)^(-1.*pp(2))*dustem_planck_function(pp(1),waves) |
70 | 72 | ; dustem_sed(ind_sed)=dustem_cc(waves,spec,((*!dustem_data).filt_names)(ind_sed),cc=cc) |
71 | - dustem_sed=dustem_cc(waves,spec,((*!dustem_data.sed).filt_names),cc=cc) | |
72 | - spec0=interpol(spec,waves,dustem_filter2wav((*!dustem_data.sed).filt_names)) | |
73 | + dustem_sed=dustem_cc(waves,spec,(*(*!dustem_data).sed).filt_names,cc=cc) | |
74 | + spec0=interpol(spec,waves,dustem_filter2wav((*(*!dustem_data).sed).filt_names)) | |
73 | 75 | ;dustem_sed=spec0*cc |
74 | 76 | print,dustem_sed,cc,pp,spec0 |
75 | 77 | ;stop |
... | ... | @@ -77,7 +79,7 @@ IF !dustem_do_cc NE 0 AND !dustem_never_do_cc EQ 0 THEN BEGIN |
77 | 79 | ENDIF ELSE BEGIN ;(!dustem_do_cc EQ 0 OR !dustem_never_do_cc EQ 1) |
78 | 80 | message,'NOT DOING color correction calculations',/info |
79 | 81 | ; waves=1.d0*dustem_filter2wav(((*!dustem_data).filt_names)(ind_sed)) |
80 | - waves=1.d0*dustem_filter2wav(((*!dustem_data.sed).filt_names)) | |
82 | + waves=1.d0*dustem_filter2wav((*(*!dustem_data).sed).filt_names) | |
81 | 83 | spec=pp(0)*(waves/w0)^(-1.*pp(2))*dustem_planck_function(pp(1),waves) |
82 | 84 | dustem_sed=spec*(*!dustem_previous_cc) |
83 | 85 | print,dustem_sed,*!dustem_previous_cc,pp,spec | ... | ... |
src/idl/dustem_gb_plot_fit_sed.pro
... | ... | @@ -59,16 +59,21 @@ use_model_line=3 ;linestyle used for the model |
59 | 59 | ;=== plot the data SED |
60 | 60 | dustem_plot_data_sed,_extra=extra |
61 | 61 | |
62 | +wav=(*(*!dustem_data).sed).wav | |
63 | +values=(*(*!dustem_data).sed).values | |
64 | +filt_names=(*(*!dustem_data).sed).filt_names | |
65 | +sigma=(*(*!dustem_data).sed).sigma | |
66 | + | |
62 | 67 | ;=== Over-Plot the computed SED |
63 | -ind_filt=where((*!dustem_data.sed).filt_names NE 'SPECTRUM',count_filt) | |
64 | -ind_spec=where((*!dustem_data.sed).filt_names EQ 'SPECTRUM',count_spec) | |
68 | +ind_filt=where(filt_names NE 'SPECTRUM',count_filt) | |
69 | +ind_spec=where(filt_names EQ 'SPECTRUM',count_spec) | |
65 | 70 | IF count_filt NE 0 THEN BEGIN |
66 | 71 | plotsym,8 |
67 | - cgoplot,((*!dustem_data.sed).wav)(ind_filt),sed(ind_filt),color=use_col_sed_filt,psym=8,syms=2 | |
72 | + cgoplot,wav[ind_filt],sed[ind_filt],color=use_col_sed_filt,psym=8,syms=2 | |
68 | 73 | ENDIF |
69 | 74 | IF count_spec NE 0 THEN BEGIN |
70 | 75 | plotsym,0 |
71 | - cgoplot,((*!dustem_data.sed).wav)(ind_spec),sed(ind_spec),color=use_col_sed_spec,psym=8,syms=0.5 | |
76 | + cgoplot,wav[ind_spec],sed[ind_spec],color=use_col_sed_spec,psym=8,syms=0.5 | |
72 | 77 | ENDIF |
73 | 78 | ;stop |
74 | 79 | ... | ... |
src/idl/dustem_plot_data_sed.pro
... | ... | @@ -43,21 +43,26 @@ ENDIF |
43 | 43 | use_col_data_spec=255 ;color for spectral data |
44 | 44 | use_col_data_filt=100 ;color for filter data |
45 | 45 | |
46 | -cgplot,(*!dustem_data.sed).wav,(*!dustem_data.sed).values,/nodata,_extra=extra,/xlog,/ylog | |
47 | -ind_filt=where((*!dustem_data.sed).filt_names NE 'SPECTRUM',count_filt) | |
48 | -ind_spec=where((*!dustem_data.sed).filt_names EQ 'SPECTRUM',count_spec) | |
46 | +wav=(*(*!dustem_data).sed).wav | |
47 | +values=(*(*!dustem_data).sed).values | |
48 | +filt_names=(*(*!dustem_data).sed).filt_names | |
49 | +sigma=(*(*!dustem_data).sed).sigma | |
50 | + | |
51 | +cgplot,wav,values,/nodata,_extra=extra,/xlog,/ylog | |
52 | +ind_filt=where(filt_names NE 'SPECTRUM',count_filt) | |
53 | +ind_spec=where(filt_names EQ 'SPECTRUM',count_spec) | |
49 | 54 | ;=== Plot the data |
50 | 55 | IF count_spec NE 0 THEN BEGIN |
51 | 56 | plotsym,0,/fill |
52 | - cgoplot,((*!dustem_data.sed).wav)(ind_spec),((*!dustem_data.sed).values)(ind_spec),psym=8,_extra=extra,color=use_col_data_spec,syms=0.5 | |
57 | + cgoplot,wav[ind_spec],values[ind_spec],psym=8,_extra=extra,color=use_col_data_spec,syms=0.5 | |
53 | 58 | IF not keyword_set(no_spec_error) THEN BEGIN |
54 | - err_bar,((*!dustem_data.sed).wav)(ind_spec),((*!dustem_data.sed).values)(ind_spec),yrms=3.*((*!dustem_data.sed).sigma)(ind_spec)/2.,color=use_col_data_spec | |
59 | + err_bar,wav[ind_spec],values[ind_spec],yrms=3.*sigma[ind_spec]/2.,color=use_col_data_spec | |
55 | 60 | ENDIF |
56 | 61 | ENDIF |
57 | 62 | IF count_filt NE 0 THEN BEGIN |
58 | 63 | plotsym,0,/fill |
59 | - cgoplot,((*!dustem_data.sed).wav)(ind_filt),((*!dustem_data.sed).values)(ind_filt),psym=8,_extra=extra,color=use_col_data_filt | |
60 | - err_bar,((*!dustem_data.sed).wav)(ind_filt),((*!dustem_data.sed).values)(ind_filt),yrms=3.*((*!dustem_data.sed).sigma)(ind_filt)/2.,color=use_col_data_filt | |
64 | + cgoplot,wav[ind_filt],values[ind_filt],psym=8,_extra=extra,color=use_col_data_filt | |
65 | + err_bar,wav[ind_filt],values[ind_filt],yrms=3.*sigma[ind_filt]/2.,color=use_col_data_filt | |
61 | 66 | ENDIF |
62 | 67 | |
63 | 68 | the_end: | ... | ... |