Skyback simulates the discrete and diffuse high-energy astrophysical background over a large energy range. Skyback currently includes the following three basic background components, any or all of which may be included.

(1) Galactic Halo and Local Hot Bubble (LHB) components are derived (following the QUICKSIM approach) from ROSAT all-sky survey (RASS) surface brightness maps (Snowden et al., ApJ, 485, 125) to create a model background spectrum appropriate for the part of the sky being observed. The model consists of an absorbed thermal plasma at T(halo)~1.0e6.6 K representing the excess over the extragalactic component seen in the RASS hard bands, plus an unabsorbed thermal plasma at T(LHB)~1.0e6 K representing the additional excess in the soft band. To generate this component, the skyback parameter flaggal must be set to "yes" (its default setting).

(2) Solar Wind Charge Exchange (SWCX) emission may be modeled as either a pure emission-line spectrum, or a continuous spectrum based on DXL sounding rocket measurements of the local galaxy diffuse X-ray emission (Galeazzi et al. 2014, Nature, 5121,171). The parameters that control the SWCX background component are: (a) flagswcx which must be set to yes, (b) swcxOVII and/or (c) swcxcont parameters. The swcxOVII parameter represents the total flux (in LU; 1 LU == 1 photon/s/cm^2/str) in the brightest (0.57 keV OVII) feature, and is used as follows. The flux is distributed among the forbidden, resonance, and intercombination OVII lines with the following scaling. F(OVII forbidden 0.5609 keV) = 2/3*F(0.57 keV OVII), F(OVII resonance 0.5740 keV) = 1/6*F(0.57 keV OVII), F(OVII intercombination 0.5685 keV) = 1/6*F(0.57 keV OVII). In addition the OVIII lines are added by scaling this input flux with the following factors: F(OVIII Lalpha 0.6536 keV) = 0.25*F(0.57 keV OVII), F(OVIII Kbeta 0.6657 keV) = 0.083*F(OVIII Lalpha 0.6536 keV). The swcxcont parameter represents the total flux in the 0.2-2 keV band of the continuous SWCX emission, modeled as 0.102 keV thermal (currently, Raymond-Smith) emission, in erg/cm^2/s/arcmin^2. The norm based on DXL observations corresponds to the default value ~3.17e-16 erg/cm^2/s/arcmin^2. If flagswcx is set to no, swcxOVII and swcxcont parameters are ignored.

(3) The third background component is modeled (based on the XIMAGE simulator) as a two-subcomponent logN-logS distribution of point sources, and is calculated if the parameter flaglogns is to yes (its default setting). The first logN-logS is a broken power-law designed to allow the inclusion of an extragalactic point-source component. The bright-end slope is determined by the parameter slopebright1, the faint-end slope by slopefaint1, the flux where the slope changes from slopebright1 to slopefaint1 is set by the parameter fluxbreak, and the normalization is set by the parameter norm1 in units of sources per square degree. The fluxes distributed according to the logN-logS distribution are defined over the energy range given by the parameters bandpasslo and bandpasshi (in keV). The parameters fluxmin and fluxmax are the minimum and maximum fluxes, in this bandpass, of the logN-logS distributions. The parameter fluxsens is the flux threshold defined such that sources fainter than fluxsen are treated as "undetected" and their emission subsumed into the diffuse background based on their individual spectra (see below). However, if fluxsen=0, the threshold is defined by the optional parameters ctstoflux (flux per unit count rate), sigtonoise (signal-to-noise ratio), and exposure (in seconds) according to ctstoflux*sigtonoise*sigtonoise/exposure (e.g., a value of cts_flux of 1.0e-11 corresponds to a threshold of 2.5e-15 erg/cm^2/s for logns_snr=5 and exposure=100 ks). The second logN-logS is a single power-law that may be used to create, for example, a Galactic or an additional extragalactic point source background. The optional parameters slope2 and norm2 determine its logN-logS slope, and normalization in sources per square degree. The optional parameters slope2 and norm2 determine its logN-logS slope, and normalization in sources per square degree. By default, norm2=0. The two logN-logS have several parameters in common -- namely bandpasslo, bandpasshi, fluxmin, fluxmax, fluxsen, ctstoflux, sigtonoise, and exposure.

Spectra for the point sources drawn from the broken power-law logN-logS background are assigned based on the parameter spectype1. If spectype1=0, the sources are assigned heasim-supported spectral models. In this case the model is specified by the skyback parameter specmod1: plaw (power-law), bbod (blackbod), brem (thermal bremsstrahlung), rs (Raymond-Smith thermal plasma), or mono (mono-energetic); and by the value of the parameter specpar1 (index for power-law, temperature in keV for blackbody/bremsstrahlung/Raymond-Smith, or line energy in keV for mono-energetic). The foreground column density is given by the parameter nhmod1. If spectype1=2, the background is given by the "torus" model based on the approach of Ueda et al. 2014 (ApJ, 786, 104). Each source spectrum is determined by one of the torus models from Brightman & Nandra 2011 (MNRAS, 413,1206; BN) with a distinct intrinsic column density and opening angle, and with a randomly selected inclination angle. The opening angle distribution is determined by fractions in five bins (<30, 30-45, 45-60, 60-75, >75) specified by the parameters fpar0, fpar1, fpar2, fpar3, and fpar4. The intrinsic column density distribution is determined by fractions in six logarithmic NH bins (<21, 21-22, 22-23, 23-24, 24-25, >25) specified by the parameters fabs0, fabs1, fabs2, fabs3, fabs4, and fabs5. Redshifts are drawn from a distribution assumed to be a simple linear ramp up to z=1, followed by an exponential decline. If spectype1=1, the background is given by the "multi" model based on the approach of Gilli, Comastri, & Hasinger, G. 2007 (A&A, 463, 792) where each point source is an absorbed power-law with index and NH drawn from two distributions. The power-law index distribution is determined by fractions in five index bins (1.5-1.7, 1.7-1.9, 1.9-2.1, 2.1-2.3, 2.3-2.5) specified by fpar0, fpar1, fpar2, fpar3, and fpar4. Again, the intrinsic column density distribution is determined by fractions in six logarithmic NH bins (<21, 21-22, 22-23, 23-24, 24-25, >25) specified by fabs0, fabs1, fabs2, fabs3, fabs4, and fabs5; and redshifts assigned as described above. For "multi" models, in the highest NH-bin the power-law is replaced by a reflection model approximated by a BN torus model with the largest available opening angle, inclination of 0 degrees, the assigned power-law, and the assigned (>1.0e25 1/cm^2) NH - with the power-law subtracted off. In the next-to-highest NH-bin the absorbed power-law is supplemented with this same reflection model, scaled down by 0.37 (Gilli et al. 2007).

Spectra for the point sources drawn from the single power-law logN-logS background are assigned in an identical way to those of the broken power-law logN-logS background if samespec=YES (i.e., the lists are merged before the spectra are assigned). If samespec=NO, the sources are assigned heasim-supported spectral models. In this case the model is specified by parameter specmod2: plaw (power-law), bbod (blackbod), brem (thermal bremsstrahlung), rs (Raymond-Smith thermal plasma), or mono (mono-energetic). The value of the spectral parameter for this model is specified by specpar2, and the foreground column density by the parameter nhmod2, as described above for specmod1 and nhmod1.

If flaglogns = yes, slopebright, slopefaint1, fluxbreak, norm1, bandpasslo, bandpasshi, fluxmin, fluxmax, fluxsens, and spectype1 are required and must be set. If flaglogns = no these are ignored, as are all of the other, optional, parameters associated with the logN-logS component such as those associated with the single power-law logN-logs or with the details of the spectral model.

The skyback output may include the following files. (1) A catalog of resolved point sources that includes source positions with spectra specifications. The format follows the heasim source definition file for point sources. The name of the output is constructed by appending the value of the parameter outfileroot to "pscat". (2) A file that supplements the point source catalog contains values of the redshift and intrinsic absorption. The name of the output is constructed by appending the value of the parameter outfileroot to "pszcat". (3) A "catalog" with a single line representing the diffuse emission. The format follows the heasim source definition file format for an extended source with a flat distribution. The flat distribution is centered at the position given by the parameters ra and dec, and covers a circular region extending out to parameter radius in arcmin. The name of the output is constructed by appending the value of the parameter outfileroot to "difcat". (4) The total diffuse background spectrum corresponding to (3) in the form of a heasim user input spectrum ASCII file (flux in photons/cm^2/s/channel versus energy in keV). The diffuse spectrum is calculated on a user-specified energy grid in keV ranging from the parameter emin to the parameter emax with a constant grid spacing given by the parameter de. For example, one might select emin=0.1, emax=16.0, and de=0.0005 for the Hitomi SXS and emin=0.1, emax=120.0, and de=0.025 for the Hitomi HXI. The name of the output ASCII file is constructed by appending the value of the parameter outfileroot to "difspec." (5) An XSPEC table model (FITS) file is also output, with a name constructed by appending the value of the parameter outfileroot to "difspec." This may be directly examined, e.g., via the command "model atable{outfileroot_difspec.fits}" within XSPEC.- outfileroot [string]
- The root name used to construct the filenames of the skyback outputs. The outputs are: pscat_outfileroot.txt, pszcat_outfileroot.txt, difcat_outfileroot.txt, difspec_outfileroot.dat, difspec_outfileroot.fits. Required.
- ra [double]
- The right ascension of the region center to be populated with background (discrete and diffuse) sources. This parameter is given in decimal degrees, J2000 epoch. Required.
- dec [double]
- The declination of the region center to be populated with background (discrete and diffuse) sources. This parameter is given in decimal degrees, J2000 epoch. Required.
- radius [double]
- Radius, in arcminutes, of the circular region to be populated with background (discrete and diffuse) sources. Required.
- emin[double]
- Energy, in keV, of the lower limit of the energy grid for the computed background spectrum. Required.
- emax [double]
- Energy, in keV, of the upper limit of the energy grid for the computed background spectrum. Required.
- de [double]
- Constant energy spacing, in keV, of the energy range for the background spectrum. Required.
- (flaglogns = yes) [boolean]
- If yes (the default), the background component originating from point sources drawn from a logN-logS distribution is computed. Optional [yes]/no).
- fluxsens [double]
- Flux for the point source sensitivity limit used for both logN-logS distributions. Sources with flux above this threshold are treated as discrete point sources, sources below are treated as unresolved and subsumed into the diffuse background. Required if flaglogns=yes, but may be set to 0, in which case the threshold is determined by the exposure, sigtonoise, and ctstoflux parameters. Ignored if flaglogns=no.
- fluxmin [double]
- Flux lower limit, in erg/cm^2/s, used for both logN-logS distributions. Required if flaglogns=yes, otherwise ignored.
- fluxmax [double]
- Flux upper limit, in erg/cm^2/s/arcmin^2, used for both logN-logS distributions. Required if flaglogns=yes, otherwise ignored.
- bandpasslo [double]
- Bandpass lower limit, in keV, over which both logN-logS distributions are defined. Fluxes output in the "pscat_fileroot" file refer to the energy range defined by bandpasslo and bandpasshi. Required if flaglogns=yes, otherwise ignored.
- bandpasshi [double]
- Bandpass upper limit, in keV, over which both logN-logS distributions are defined. Fluxes output in the "pscat_fileroot" file refer to the energy range defined by bandpasslo and bandpasshi. Required if flaglogns=yes, otherwise ignored.
- slopebright1 [double]
- Bright-end slope of the first (broken power-law) logN-logS distribution. Required if flaglogns=yes, otherwise ignored.
- slopefaint1 [double]
- Faint-end slope of the first (broken power-law) logN-logS distribution. Required if flaglogns=yes, otherwise ignored.
- fluxbreak [double]
- Flux level, in erg/cm^2/s/arcmin^2, where the first (broken power-law) logN-logS distribution changes slope, i.e. slope=slopebright1 (slopefaint1) above (below) fluxbreak. Required if flaglogns=yes, otherwise ignored.
- norm1 [double]
- Normalization, in sources/square-degree, of the first (broken power-law) logN-logS distribution. Required if flaglogns=yes, otherwise ignored.
- spectype1 [integer]
- Type of spectral model assigned to the point sources drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. The values for spectype1 are 0, 1, and 2 with the following meanings. If spectype1=0, all sources have identical spectral models as specified in the parameters specmod1, specpar1, and nhmod1. If spectype1=1 ("multi"), spectra are absorbed power-laws with column densities and slopes drawn from the distributions specified in the parameters fabs0-5 and fpar0-4, respectively, with a special treatment in the mildly and fully Compton thick regimes. If spectype1=2 ("torus"), spectra are Brightman & Nandra torus models with column densities and opening angles drawn from the distributions specified by fabs0-5 and fpar0-4, respectively, and with randomly selected inclination angles. Required if flaglogns=yes, otherwise ignored.
- (specmod1 = pow) [string]
- Available spectral models that are assigned to the point sources drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. These are: plaw (power-law), bbod (blackbody), brem (thermal bremsstrahlung), rs (Raymond-Smith thermal plasma), or mono (mono-energetic). Optional, ignored if flaglogns=no.
- (specpar1 = 1.9) [double]
- Parameter value of the spectral model specified in specmod1. The possible parameters are: index (for power-law model), temperature in keV (for blackbody, bremsstrahlung, Raymond-Smith models), or line energy in keV (for mono-energetic model). Optional, ignored if flaglogns=no.
- (nhmod1 = 0.0) [double]
- Value for the column density in 1/cm^2 used with the spectral model specified in specmod1. Optional, ignored if flaglogns=no.
- (fabs0 = 0.24) [double]
- Fraction of sources which have assigned NH<1.0e21 1/cm^2 and are drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. This is applicable if spectype1 is either 1 or 2. The value for the fraction ranges between 0-1. Optional, ignored if flaglogns=no.
- (fabs1 = 0.24) [double]
- Fraction of sources which have assigned NH between 1.0e21 and 1.0e22 1/cm^2 and are drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. This is applicable if spectype1 is either 1 or 2. The fraction values range between 0-1. Optional, ignored if flaglogns=no.
- (fabs2 = 0.24) [double]
- Fraction of sources which have assigned NH between 1.0e22 and 1.0e23 1/cm^2 and are drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. This is applicable if spectype1 is either 1 or 2. The fraction values range between 0-1. Optional, ignored if flaglogns=no.
- (fabs3 = 0.24) [double]
- Fraction of sources which have assigned NH between 1.0e23 and 1.0e24 1/cm^2 and are drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. This is applicable if spectype1 is either 1 or 2. The fraction values range between 0-1. Optional, ignored if flaglogns=no.
- (fabs4 = 0.03) [double]
- Fraction of sources which have assigned NH between 1.0e24 and 1.0e25 1/cm^2 ("mildly Compton thick" regime) and are drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. This is applicable if spectype1 is either 1 or 2. The fraction values range between 0-1. Optional, ignored if flaglogns=no.
- (fabs5 = 0.01) [double]
- Fraction of sources which have assigned NH > 1.0e25 1/cm^2 ("Compton thick" regime) and are drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. This is applicable if spectype1 is either 1 or 2. The fraction values ranges between 0-1. Optional, ignored if flaglogns=no.
- (fpar0 = 0.2) [double]
- Fraction of sources which have assigned a power law index between 1.5 and 1.7 if spectype1=1 or torus opening angles < 30 degrees if spectype1=2. Applied to point sources drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. The fraction values ranges between 0-1. Optional, ignored if flaglogns=no.
- (fpar1 = 0.2) [double]
- Fraction of sources which have assigned a power law index between 1.7 and 1.9 if spectype1=1 or torus opening angles between 30 and 45 degrees if spectype1=2. Applied to point sources drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. The fraction values ranges between 0-1. Optional, ignored if flaglogns=no.
- (fpar2 = 0.2) [double]
- Fraction of sources which have assigned a power law index between 1.9 and 2.1 if spectype1=1 or torus opening angles between 45 and 60 degrees if spectype1=2. Applied to point sources drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. The fraction values ranges between 0-1. Optional, ignored if flaglogns=no.
- (fpar3 = 0.2) [double]
- Fraction of sources which have assigned a power law index between 2.1 and 2.3 if spectype1=1 or torus opening angles between 60 and 75 degrees if spectype1=2. Applied to point sources drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. The fraction values ranges between 0-1. Optional, ignored if flaglogns=no.
- (fpar4 = 0.2) [double]
- Fraction of sources which have assigned a power law index between 2.3 and 2.5 if spectype1=1 or torus opening angles between 75 and 90 degrees if spectype1=2. Applied to point sources drawn from the first logN-logS distribution (broken power-law) - as well as the second if samespec=YES. The fraction values ranges between 0-1. Optional, ignored if flaglogns=no.
- (slope2 = 1.1) [double]
- Slope of the second (single power-law) logN-logS distribution. Optional, ignored if flaglogns=no.
- (norm2 = 0.0e0) [double]
- Normalization, in sources/square-degree, of the second (single power-law) logN-logS distribution. Optional, ignored if flaglogns=no.
- (samespec = yes) [boolean]
- If samespec=YES, the spectral model for the point sources from the second logN-logS distribution (single power-law) is assigned in the same way as for the point sources from the first logN-logS distribution (broken power-law), i.e. identical spectra if spectype1=0 or spectra drawn from identical spectral parameter distributions if spectype=1 or 2. Optional, ignored if flaglogns=no ([yes]/no).
- (specmod2 = pow) [string]
- Available spectral models that are assigned to the point sources drawn from the second logN-logS distribution (broken power-law) if samespec=NO. These are: plaw(power-law), bbod (blackbody), brem (thermal bremsstrahlung), rs (Raymond-Smith thermal plasma), or mono (mono-energetic). Optional, ignored if flaglogns=no.
- (specpar2 = 1.9) [double]
- Parameter value of the spectral model specified in spec_mod2. The possible parameters are: index (for power-law model), temperature in keV (for blackbody, bremsstrahlung, Raymond-Smith models), or line energy in keV (for mono-energetic model). Optional, ignored if flaglogns=no.
- (nhmod2 = 0.0) [double]
- Value for the column density in 1/cm^2 used with the spectral model specified in spec_mod2. Optional, ignored if flaglogns=no.
- (flaggal = yes) [boolean]
- If yes, the diffuse background component originating from Galactic halo and Local Hot Bubble hot gas is computed. Optional ([yes]/no).
- (flagswcx = no) [boolean]
- If yes, the background component originating from Solar Wind Charge Exchange is computed. Optional (yes/[no]).
- (swcxOVII = 0.0) [double]
- Total flux, in units of LU (1 LU = erg/cm^2/s/arcmin^2), of the OVII line complex for the discrete SWCX component. Optional, ignored if flagswcx=no.
- (swcxcont = 3.17e-16) [double]
- Total flux, in erg/cm^2/s/arcmin^2, of the continuous SWCX component. Optional, ignored if flagswcx=no.
- (flagdgrb = no) [boolean]
- NOT IMPLEMENTED. If yes, the diffuse gamma-ray background component is computed. Optional(yes/[no]) .
- (flaggrxe = no) [boolean]
- NOT IMPLEMENTED. If yes, the Galactic Ridge background component is computed. Optional (yes/[no]).
- (exposure = 10000.) [double]
- Exposure time in seconds used to calculate the point source logN-logS flux threshold (in combination with sigtonoise and ctstoflux, i.e. as ctstoflux*sigtonoise*sigtonoise/exposure if an explicit value (fluxsens) is not input. The threshold determines which sources are treated as discrete background sources and which as contributing to the diffuse background emission. Optional.
- (sigtonoise = 5.0) [double]
- Minimum signal-to-noise ratio used (in combination with exposure and ctstoflux) to determine the flux threshold if fluxsen=0. Optional.
- (ctstoflux = 1.0e-11) [double]
- Count-rate to flux conversion used (in combination with sigtonoise and ctstoflux) to determine the flux threshold if fluxsen=0. Optional.
- (seed = 1) [integer]
- Value with which to seed the simulator's random number generator (RNG). If set to zero, the seed is ignored and the RNG is seeded from the system time. Otherwise it is used as given and consecutive applications with identical seed parameter yield identical output. Optional.
- (clobber = yes) [boolean]
- Overwrites the existing output file if set to yes ([yes]/no).
- (debug = no) [boolean]
- Diagnostic output is printed out on the screen if set to yes (yes/[no]).
- (mode = ql) [string]
- Mode to query the parameter file. Acceptable values include: "ql (query and learn/remember), "hl" (hidden and learn/remember), "q" (query but don't remember), "h" (hidden).

1. Create skyback point source, diffuse source, and auxiliary point source catalog output files pscat_heasim.txt, difcat_heasim.txt, and pzcat_heasim.txt for a background field centered at (ra,dec) = (150.0,50.0) and radial extent of 10 arcmin. Create a diffuse spectrum text file difspec_heasim.dat, and xspec table model file difspec_heasim.fits. The background components include the "galactic" and "logN-logS" components, where the latter consists of point sources drawn from a single broken-power law logN-logS distribution with default parameters and identical index 1.9 power-law spectra. The output spectra are created on an energy grid spanning 0.1-12 keV with 1 eV grid spacing.

skyback outfileroot=heasim ra=150.0 dec=50.0 radius=10.0 emin=0.1 emax=12.0 de=0.001 flaglogns=yes fluxsens=1.0e-14 fluxmin=1.0e-16 fluxmax=5.0e-13 bandpasslo=0.5 \ bandpasshi=2.0 slopebright1=1.7 slopefaint1=0.9 fluxbreak=2.5e-14 norm1=8.0e3 spectype1=0

2. Create skyback point source, diffuse source, and auxiliary point source catalog output files pscat_cxb_hxi.txt, difcat_cxb_hxi.txt, and pszcat_cxb_hxi.txt for a background field centered at (ra,dec) = (151.8606,16.1085) and radial extent of 20 arcmin. Create a diffuse spectrum text file difspec_cxb_hxi.dat, and xspec table model file difspec_cxb_hxi.fits. The background components include the "galactic" and "logN-logS" components, where the latter consists of point sources drawn from a single broken-power law logN-logS distribution defined in the 2-10 keV bandpass with a bright-end slope of 1.7, faint-end slope of 0.9, flux where the slope breaks of 3.5e-14 erg/cm^2/s, and 19000 source/deg2 between 1.0e-16 and 7.0e-13 erg/cm^2/s. The spectra are "torus" models drawn from a distribution with probabilities of 0.2, 0.2, 0.2, 0.2, 0.1, and 0.1 for the 6 defined column density bins and equal probabilities in the 5 defined torus opening angle bins. The output spectra are created on an energy grid spanning 0.1-120 keV with 25 eV grid spacing.

skyback outfileroot=cxb_hxi ra=151.8606 dec=16.1085 radius=20.0 emin=0.1 emax=120.0 de=0.025 fluxsens=1.0e-14 fluxmin=1.0e-16 fluxmax=7.0e-13 \ bandpasslo=2.0 bandpasshi=10.0 slopebright1=1.7 slopefaint1=0.9 fluxbreak=3.5e-14 norm1=1.9e4 spectype1=2 fabs0 = 0.2 fabs1 = 0.2 fabs2 = 0.2 \ fabs3 = 0.2 fabs4 = 0.1 fabs5 = 0.1