Create a source spectrum expression = <srcexp> + PATTERN + FLAG selections evselect table=<table> expression=<expression> withspectrumset=yes spectrumset=<filestem>+"_src.ds" Create a background spectrum expression = <backexp> + PATTERN + FLAG selections evselect table=<table> expression=<expression>...... withspectrumset=yes spectrumset=<filestem>+"_bgd.ds" Create an ARF for the source spectrum and calculate the source box area arfgen spectrumset=<srcspec> arfset=<arfset> withrmfset=<withrmfset> rmfset=<rmfset> extendedsource=<extendedsource> withbadpixcorr=<withbadpixcorr> badpixlocation=<table> setbackscale=yes keeparfset=yes useodfatt=<useodfatt> Use arfgen to calculate the background box area arfgen spectrumset=<backspec> arfset=temparf.arf setbackscale=yes keeparfset=no withbadpixcorr=<withbadpixcorr> badpixlocation=<table> useodfatt=<useodfatt> Create an RMF if not supplied if (! <withrmfset>) { rmfgen spectrumset=<srcspec> rmfset=<rmfset> }