especget filestem=myagn withrmfset=yes rmfset=epn_ef20_sdY9.rmf
srcexp="FLAG==0&&PATTERN==0&&((DETX,DETY) IN circle(572,-635,1340))"
backexp="FLAG==0&&PATTERN==0&&((DETX,DETY) IN annulus(572,-635,1600,3000))"
table=P0129360201M1S004MIEVLI0000.FIT:EVENTS
This will create source and background spectra from events with a pattern of zero and having FLAG=0. Restricting the pattern range to 0 can be useful when the source is piled up.