How to extract ISGRI spectra ============================ last update of this page: 04.08.2005 Here I describe how I do the spectral extraction from ISGRI images. This is one way to extract spectra. I do not claim that it is the best or most correct way. Use it with caution. Thanks to the IBIS team at the ISDC for their input! For download of files mentioned in this text, go to http://lheawww.gsfc.nasa.gov/users/beckmann/spi/pages/ISGRI_spectra.html Run ibis_science_analysis up to the IMA level, disable PICsIT, and set the OBS1_PixSpread parameter to "0". Use a clever energy binning. Remember that you can use only 10 energy bins. For sources which are bright and you want to have more energy bins, you might as well use the spectral extraction available through the script. I propose the following binning: 20, 25, 30, 40, 50, 60, 80, 100, 150, 300, 600 keV Go to the results directory and create a region file: cat2ds9 catDOL="isgri_srcl_res.fits[1]" fileName="ibisregion.reg" Open the first intensity map: ds9 isgri_mosa_ima.fits\[2] and load the region file (you might edit the region file before, if there are too many 'NEW' sources displayed). Zoom in and write down the pixel coordinates (X,Y) of the source you are interested in. Now you have to extract the fluxes and errors at this position throughout the energy bins. In order to avoid a lot of opening and closing files manually you can use extract_flux.bat (available at href="http://lheawww.gsfc.nasa.gov/users/beckmann/spi/download/extract_flux.bat") and extract_variance.bat. Make them executable (chmod u+x *.bat) and run them: extract_flux.bat isgri_mosa_ima.fits X Y > flux.dat extract_variance.bat isgri_mosa_ima.fits X Y > variance.dat where X and Y are the pixel coordinates of your source. Used like this, the sripts produce two ASCII output files, flux.dat and variance.dat The first script will also give you the exposure time at the given position. The flux and error values have to be filled into a spectrum file. Use a working example of an ISGRI spectrum which you fill with your values. Note that the first and last row are not used, unless your spectrum starts at 13 keV and ends at 993 keV. Note also that the extract_variance.bat script extracts variance values, so you have to apply sqrt(variance) in order to get the error value (this can be done inside fv after filling in the variance values. Also applying systematic errors can be done here). Fill some keywords in the header of the ISGRI spectrum (use fv or the following ftools command): fparkey value=0 fitsfile=isgri_spectrum.fits\[1] keyword=TLMIN add=yes fparkey value={NUMBER OF BINS} fitsfile=isgri_spectrum.fits\[1] keyword=TLMAX add=yes fparkey value={NUMBER OF BINS + 1} fitsfile=isgri_spectrum.fits\[1] keyword=DETCHANS add=yes fparkey value={exposure time from the extract_flux.bat result} fitsfile=isgri_spectrum.fits\[1] keyword=EXPOSURE add=yes If you used the binning as indicated above, you can just use the ISGRI_RMF.fits file provided on the webpage. If you use a different binning: create a binning list like channel.lst: 0 13 14 14 24 11 25 35 11 36 56 21 57 77 21 78 98 21 99 139 41 140 181 42 182 286 105 287 599 313 600 1226 627 1227 2047 821 You find the channel/energy correlation in the ISGRI RMF group (e.g. $REP_BASE_PROD/ic/ibis/rsp/isgr_rmf_grp_0016.fits). Modify channel.lst according to your binning (it has to start with channel 0 and end with channel 2047). Then run rbnrmf on it: rbnrmf infile="isgr_rmf_grp_0016.fits" ebdfile="%" binfile="channel.lst" outfile="ISGRI_RMF.fits" Use the ARF available for ISGRI. Unfortunately there is only one ARF available at the moment (isgr_arf_rsp_0006.fits), so off-axis effects are not taken into account (as far as I understand it). Write the ARF and RMF into the header of your spectrum file: fparkey value=ISGRI_RMF.fits fitsfile=isgri_spectrum.fits\[1] keyword=RESPFILE add=yes fparkey value=isgr_arf_rsp_0006.fits fitsfile=isgri_spectrum.fits\[1] keyword=ANCRFILE add=yes Now the spectrum (isgri_spectrum.fits) is ready to be used inside XSPEC : xspec cpd /xs data isgri_spectrum.fits setpl energy mo po 2.0 8.0 fit 1000 flux 20,200 plot ldata In case of questions and comments contact me: beckmann@milkyway.gsfc.nasa.gov