You are here: Science»
IXO Simulation Tools»
How to run simx
How to run simx
First, install simx following the directions on the Downloading and Installing simx page.
What is simx?
Simx is an event simulator for an (almost) arbitrary X-ray satellite
that outputs HEASARC OGIP standard event files. The simulation is
based on a mission/instrument description provided by the satellite
team combined with user-supplied source information (such as flux,
image, spectrum, etc). Simx is NOT a full ray-trace code, but rather
uses a predefined set of PSFs, vignetting information, and
instrumental responses and outputs to make the simulation. It is
designed to be a 'approximation' tool to estimate issues such as
source confusion, background effects, pileup, and other similar issues.
Setting up to run simx
The mission and, or instrument description is provided by data in the file
xselect.mdb, in the simx/inputs/ directory. simx must be able to find
this file, which it does via the SIMX system variable. This is set by
the simx-setup.{csh|sh} script, found in simx/bin. Thus, before
running simx, you must first run the setup script via:
unix% source /path/to/simx/bin/simx-setup.csh (CSH version)
or
unix% ./path/to/simx/bin/simx-setup.sh (SH/BASH version)
Top
Running simx
Simx uses the ever-popular IRAF interface that should be familiar to
FTOOLS and CIAO users. It expects to find its parameter file in a
directory pointed to by the PFILES system variable. If you are an
FTOOLS user, you probably have a directory 'pfiles' in your home
directory, e.g. /home/user/pfiles. Running simx-setup will set up the
PFILES environment properly so that this is done automatically.
However, it can be done directly as well using:
unix% cp /path/to/simx/pfiles/simx.par /home/user/pfiles/simx.par
unix% ftools-init
Alternatively, you can simply set the PFILES environment variable
to point to the pfiles directory in simx:
unix% setenv PFILES /path/to/simx/pfiles
Note that the syspfiles/ directory contains a 'pristine' version of the same file in case the one in pfiles is corrupted somehow.
To run simx, simply set the simulation parameters in simx.par to the desired values by editing the file directly in an editor (this method is somewhat risky) or installing FTOOLS and using pset, e.g.:
unix% pset simx OutputFileName = MySimRun
unix% pset simx Exposure=10000
Refer to Complete list of user parameter options for a list of parameter options, and then run simx:
unix% /path/to/simx/bin/simx
The code will generate an output event file in the current
directory which can be viewed with ds9 or used with the CIAO tools
dmextract or the FTOOLS xselect. A modified version of xselect.mdb
is needed to use these files with xselect; it can be found in
the test directory of simx. To use this file with xselect instead of the default xselect.mdb that
comes with FTOOLS, set the following environment variable:
unix% setenv XSELECT_MDB /path/to/simx/test/xselect.mdb
Top
Complete list of user parameter options
- OutputFileName
- The output event file stem; final file will be this step with "_evt.fits" appended
- PointingRA
- Right Ascension (in decimal degrees) of the pointing direction of the satellite
- PointingDec
- Declination (in decimal degrees) of the pointing direction of the satellite
- Exposure
- Exposure time (in seconds)
- SourceFlux
- Total source flux (in erg/cm2/s); for IXO, a source with 10-13 erg/cm2/s is reasonably bright
- SourceImageType
- Either Image or Point; if Image, a FITS image file must be provided as the SourceImageFile parameter. If Point, the point source position must be provided in SourcePointRA and SourcePointDec
- SourcePointRA
- Right Ascension (in decimal degrees) of the point source; only used if SourceImageType = Point. If this value and the SourcePointDec match the PointingRA and PointingDec, the source will be centered on the detector
- SourcePointDec
- Declination (in decimal degrees) of the point source
- SourceImageFile
- FITS-format file containing the image to simulate
- SourceSpectrumType
- One of XSPEC_File, Sherpa_File, or Mono. If set to Mono, the source is assumed monoenergetic with the energy set in the MonoEnergy parameter. If XSPEC_File, it is assumed the spectrum is output from XSPEC using the commands
XSPEC> ...define model spectrum...
XSPEC> plot model
XSPEC> iplot
PLT> wdata model.dat
PLT> quit
- In this case, the file will have at least 3 columns, Energy (in keV), delta-Energy, and flux (in ph/cm2/s/keV); the first three rows are ignored as they normally contain text. If Sherpa_File is the parameter, it is assumed the spectrum file comes from a Sherpa model created (in CIAO 3) via:
sherpa> ...define model spectrum...
sherpa> write source source.dat
- In this case, the file will have 2 columns, Energy (in keV), and Flux (in ph/cm2/s/keV). If you generate the spectrum file some other way than XSPEC or Sherpa, simply output the spectrum in this format (two columns, energy and flux) and simx should be able to read it.
- SourceSpectrumFile
- The name of source spectrum file, if SourceSpectrumType=XSPEC_File or Sherpa_File
- MonoEnergy
- The energy (in keV) of the mono-energetic spectrum if SourceSpectrumType = Mono
- RandomSeed
- The initial random seed. If you set this to -1, the code will use the current time to seed the random number generator, while any other value will always generate the same sequence of random numbers
- MissionName
- Currently, can be set to IXO, Astro-H, or Gen-X
- InstrumentName
- Allowable settings for this depend upon the Mission setting and
the values available in the xselect.mdb. Currently, for IXO this can
be set to XMScore (for the core 40×40 calorimeter array), XMSouter (for the
full 5 arcmin 52×52) calorimeter array, which has a larger deadtime
and lower resolution), or WFI (the Wide Field Imager). For Astro-H,
this can be SXS or HXI, and for Gen-X it must be XMS
- FilterName
- For IXO, can be set to either None (no filter), or to BSDO (Bright Source
Defocusing Optic) which diffuses bright sources to a much larger
field. Otherwise, should be left at 'None'
- File_bkgnd
- Path, including the filename, to the desired background pha file
if a non-standard background is desired. Otherwise, setting this to
$XSELECT_MDB will ensure it picks up the value from the xselect.mdb file
- File_arf
- Path, including the filename, to an effective area file if a
non-standard effective area is desired. Otherwise, setting this to
$XSELECT_MDB will ensure it picks up the value from the xselect.mdb file
- File_rmf
- Path, including the filename, to a response file if a non-standard
one is desired. Otherwise, setting this to $XSELECT_MDB will ensure
it picks up the value from the xselect.mdb file
Top
Using simx output files
Simx outputs FITS files in the OGIP 'Event File' format. This format
can be read directly by saoimage / ds9, and by the FTOOL xselect.
Xselect uses the same xselect.mdb as simx, and so the one step that
must be done before running xselect is to set the XSELECT_MDB
environment variable to point to the correct xselect.mdb file. By
default it reads a standard xselect.mdb file in the FTOOLS
distribution, but this can be changed using the command:
unix% setenv XSELECT_MDB $SIMX/inputs/xselect.mdb (CSH version)
or
unix% set XSELECT_MDB $SIMX/inputs/xselect.mdb
unix% export XSELECT_MDB (BASH version)
After that, xselect will automatically pick up the correct mission
when the simx output files are read and will use the proper binning
and column names for the extraction.