define casa_images (ifile, itypes) { variable file_dir, files, obsidstrs, filename; variable xoffsets, yoffsets, es, xs, ys; variable sel, selsipeak; file_dir = "/nfs/spectra/d1/dd/Science/CasA"; files = ["Data/1046/acisf01046N002_E500toE2300evt2.fits", "marx_070301/casa_sim1046.fits"]; obsidstrs = ["Real1046", "Sim1046"]; % offsets for the obsids: xoffsets = [0.,0.]+4096.0; yoffsets = [0.,0.]+4096.0; filename = file_dir + "/" + files[ifile]; % Read in a fits events file: % Offset X,Y to nominal location % and convert Energy to keV message(" Reading file: "+filename); xs = fits_read_col (filename, "X") - xoffsets[ifile]; ys = fits_read_col (filename, "Y") - yoffsets[ifile]; es = fits_read_col (filename, "ENERGY") / 1000.0; % Define an image size and resolution % Don't make any v3d arrays with this resolution! v3d_setup(550.0,150); message(" Select events..."); % Select events in energy range and spatial range sel = where( (abs(xs) < v3d_cube_radius) and (abs(ys) < 0.6*v3d_cube_radius) and ( es > 0.50 ) and (es < 2.30) ); selsipeak = where( (abs(xs) < v3d_cube_radius) and (abs(ys) < 0.6*v3d_cube_radius) and ( es > 1.75 ) and ( es < 2.00 ) ); message(" Number 0.5-2.3 keV : "+string(length(sel)/1000.0)+" x10^3" ); message(" Number in Si-peak : "+string(length(selsipeak)/1000.0)+" x10^3" ); % View the events in simple color-coding by energy message(" Creating color image for obsid_"+obsidstrs[ifile]); % multiple viewing types: variable itype; _for itype (0,length(itypes)-1,1) { % Nominal image... v3d_evtimg(xs[sel], ys[sel], es[sel], [0.50,1.60], [1.75,2.00], [2.02,2.30], itypes[itype]); % Only show the Si peak range image (green): % _Si.png % v3d_evtimg(xs[sel], ys[sel], es[sel], , [1.75,2.00], , itypes[itype]); % Show the red and blue shifted sides of the He-like Si line: % _Silohi.png % v3d_evtimg(xs[sel], ys[sel], es[sel], [1.76,1.82], [1.85,1.89], , itypes[itype]); } }