== Description of performance tests and simulations relevant to the APETOOL and SHAPELIB libraries. == Simulations are underway to test the following aspects relevant to apetool and shapelib: 1. How well/accurate can the shapelet-PSF model determine the flux of point-sources: simulate fields (both survey-mode and pointed) with a grid of point sources of fixed flux and spectral. Run ermldetect to detect the sources and measure their flux and compare with the input one. 2. How well can APETOOL reconstruct the selection function of eROSITA observations: simulate fields (both survey-mode and pointed) with a point-sources with fluxes drawn from a logN-logS distribution and fixed spectral shape. Run {{{ERLDETECT}}} and ptoduce a source list, {{{APETOOL}}} to threshold at a given false detection probability and estimate field sensitivities. Reconstruct input logN-logS and compare. The relevant simulations are based on modified versions of Nicolas Clerc's python scripts described [[https://wiki.mpe.mpg.de/eRosita/SyntheticSimulations|here]]. The main modifications are: (i) functions to generate attitude files for both survey and pointed observations (ii) place sources in a grid of fixed spacing within the survey field, (iii) use of simple power-law X-ray spectra with a choice of Gammas for the point sources, (iv) functionality to produce sources of fixed flux. A tarball with the relevant python scripts can be found [[attachment:scripts.tar|here]]. === Progress so far === Simulations of sources with flux f,,X,,(0.5-2)=10^-12^cgs in grid. Pointed and survey mode observations have been simulated. The latter use the [[https://wiki.mpe.mpg.de/eRosita/ScienceRelatedStuff/ExpoMaps?action=AttachFile&do=view&target=oneyearsurvey_att.fits|attitude file: oneyearsurvey_att.fits]]. The {{{SIXTE}}} and {{{Simput}}} versions 2.2.0 have been used. The {{{EROSIM}}} task with the [[attachment:erositaXML.tar|XML files]] and the [[attachment:erosita_psf_v2.1.fits|Panter PSF (256M!)]] was run followed by the {{{ERO_CALEVENTS}}} task. The input spectrum are assigned a power-law spectrum with index Gamma=1.4. The input flux is f,,X,,(0.5-2)=10^-12^cgs. The table below lists links to the input simput file, the event files for each telescope separately and the merged one (via call to evtool): || Pointed Observations || File Description || Survey-mode Observations || || [[attachment:simput_test.fits|simput_test.fits]] || simput file ||[[attachment:simput_test.fits|simput_test.fits]]|| || [[attachment:ccd1_new_events.fits|ccd1_new_events.fits]] || Event file for CCD1 || [[attachment:ccd1_new_events_AGNsurvey.fits|ccd1_new_events_AGNsurvey.fits]] || || [[attachment:ccd2_new_events.fits|ccd2_new_events.fits]] || Event file for CCD2 || [[attachment:ccd2_new_events_AGNsurvey.fits|ccd2_new_events_AGNsurvey.fits]] || || [[attachment:ccd3_new_events.fits|ccd3_new_events.fits]] || Event file for CCD3 ||[[attachment:ccd3_new_events_AGNsurvey.fits|ccd3_new_events_AGNsurvey.fits]] || || [[attachment:ccd4_new_events.fits|ccd4_new_events.fits]] || Event file for CCD4 ||[[attachment:ccd4_new_events_AGNsurvey.fits|ccd4_new_events_AGNsurvey.fits]] || || [[attachment:ccd5_new_events.fits|ccd5_new_events.fits]] || Event file for CCD5 ||[[attachment:ccd5_new_events_AGNsurvey.fits|ccd5_new_events_AGNsurvey.fits]] || || [[attachment:ccd6_new_events.fits|ccd6_new_events.fits]] || Event file for CCD6 ||[[attachment:ccd6_new_events_AGNsurvey.fits|ccd6_new_events_AGNsurvey.fits]] || || [[attachment:ccd7_new_events.fits|ccd7_new_events.fits]] || Event file for CCD7 ||[[attachment:ccd7_new_events_AGNsurvey.fits|ccd7_new_events_AGNsurvey.fits]] || || [[attachment:sm04_183156_020_EventList_001_t001.fits|sm04_183156_020_EventList_001_t001.fits]] || Merged Event file||[[attachment:sm05_183156_020_EventList_001_t001.fits|sm05_183156_020_EventList_001_t001.fits]] || '''Issues with simulations (to be addressed in the future):''' * the event files produced by ERO_CALEVENTS have columns RA and DEC of type 'J' (integer) in the 'EVENTS' extension. Should be 'E' or 'D' * the event files produced by EROSIM include events with negative energies. '''Results:''' The [[attachment:demoscript.py|demoscript.py]] was used to analyse the data. The {{{ERMLDET}}} task was called with the "shapelet_flag=yes". The table below lists the Source Map in the 0.5-2keV band produced by the {{{ERMLDET}}} task, the corresponding {{{SIXTE}}}-simulated image and the source list produced by the the {{{ERMLDET}}} task: |||||| Pointed Observations|| || [[attachment:sm04_183156_022_SourceMap_001_t001.fits|sm04_183156_022_SourceMap_001_t001.fits]] || Source Map || || [[attachment:comp.png|comp.png]] || Comparison of Source Map with SIXTE simulated image in the 0.5-2keV || || [[attachment:sm04_183156_020_MaxLikSourceList_001_t001.fits|sm04_183156_020_MaxLikSourceList_001_t001.fits]] || Source list produce by ERMLDET || |||||| Survey-mode Observations|| || [[attachment:sm05_183156_022_SourceMap_001_t001.fits|sm05_183156_022_SourceMap_001_t001.fits]] || Source Map || || [[attachment:compAGNsurvey.png|compAGNsurvey.png]] || Comparison of Source Map with SIXTE simulated image in the 0.5-2keV || || [[attachment:sm05_183156_020_MaxLikSourceList_001_t001.fits|sm05_183156_020_MaxLikSourceList_001_t001.fits]] || Source list produce by ERMLDET || For the conversion of count rates to fluxes conversion factors are supplied to ERMLDET. These are estimated for a power-law X-ray spectrum with Gamma=1.4, i.e. the same as that of the input sources. The adopted [[attachment:erosita_iv_1telonaxis_ff.arf|ARF]] and [[attachment:erosita_iv_1telonaxis_ff.rmf|RMF]] files are the same as those provided to SIXTE via the input [[attachment:erositaXML.tar|XML files]]. {{{XSPEC}}} is used to fake a power-law spectrum with Gamma=1.4 and estimate the corresponding count rate and flux in the spectral bands of interest. For the 0.5-2keV band the conversion from counts to flux is 1.76051*10^11^. '''Issues:''' * __the fluxes estimated by {{{ERMLDET}}} in the 0.5-2keV band (bandid=2) are 6 times higher than the input ones. Similar results are obtained in the case of survey-mode simulations.__