; Be sure to run this program from inside the folder with the *.sav files ; we have provided. ; some initial setup due to a small bug in the code $setenv XRT_CALIBRATION $SSW_XRT/calibration/ $setenv XRT_RESPONS $XRT_CALIBRATION $setenv SSW_XRT_RESPONSE $SSW_XRT/idl/response/ $setenv SSW_XRT_CALIB $SSW_XRT/calibration/ ; restore the example files restore, 'OBS_INDEX.sav' restore, 'OBS_VAL.sav' restore, 'data.sav' restore, 'index.sav' ; show the first image in the data array we will be using loadct, 3 wdef, 0, 512 tvscl, alog10(data[*,*,0]) ;simplest run of DEM calculation, without montecarlo: xrt_dem_iterative,OBS_INDEX,OBS_VAL,logT_out,dem_out ; plot the results plot, logT_out, dem_out, psym=10, xtit='log T [log K]', ytit='DEM [cm^-5 K^-1]' ; run with monte-carlo errors included niter = 100 xrt_dem_iterative,OBS_INDEX,OBS_VAL,logT_out,dem_out, obs_err=obs_err, base_obs=base_obs, mod_obs=mod_obs,chisq=chisq, MC_iter=niter ; plot the results max = max(dem_out) < 2 * max(dem_out[*,0]) plot, logT_out, dem_out[*,0], psym=10, xtit='log T [log K]', ytit='DEM [cm^-5 K^-1]', yr=[0,max] for i = 1, 100 do begin & oplot, logT_out, dem_out[*,i], psym=10, line=1, color=150