scieee Science in your language
[en] (orig)

SPEX X-ray spectral fitting package

Author: Kaastra, J. S.; Raassen, A. J. J.; de Plaa, J.; Gu, Liyi
Publisher: Zenodo
DOI: 10.5281/zenodo.17313851
Source: https://zenodo.org/records/17313851/files/spex-3.08.02-manual.pdf
SPEX Help Cen e Documen a ion
Release 3.08.02
J. de Plaa, J. Kaas a, L. Gu, he SPEX De elopmen Team
Oc 10, 2025
CONTENTS
1 Ge ing s a ed 1
1.1 How o ins all SPEX ......................................... 1
1.2 How o un SPEX .......................................... 4
1.3 How o con e spec a o SPEX o ma ............................... 10
1.4 Ins all he SPEX Py hon in e ace .................................. 13
1.5 Dependencies ............................................. 15
1.6 Compile SPEX om sou ce ..................................... 15
1.7 Use SPEX h ough Docke ...................................... 18
1.8 How o ins all SPEX using Anaconda ................................ 20
1.9 Op imize o speed .......................................... 22
2 Analysis h eads 25
2.1 Fi ing a CCD spec um ....................................... 25
2.2 Modeling pa icle backg ound .................................... 36
2.3 Fi ing in e s ella dus abso p ion .................................. 42
2.4 Impo UV/Op ical da a ....................................... 47
2.5 PION se up o AGN wa m abso be ................................. 48
2.6 PION se up o emission and abso p ion ea u es in AGN ...................... 56
2.7 Fi ing wo di e en spec a simul aneously ............................. 68
2.8 How o use he SPEX use model .................................. 82
2.9 SPEX solu ion o he ela i is ic disk e lec ion ........................... 85
2.10 SPEX e alua ion o APEC model .................................. 86
3 Command o e iew 89
3.1 Command syn ax ........................................... 89
3.2 Plo ing e e ence ...........................................156
4 Spec al models 171
4.1 O e iew o spec al componen s ..................................171
4.2 Op imizing model pe o mance ...................................240
5 Addi ional ools 245
5.1 T a o .................................................245
5.2 S epcon ou ..............................................250
5.3 Xabsinpu ...............................................251
5.4 Hyd o d i e .............................................252
5.5 Rgs p o ...............................................253
5.6 RGS_ luxcombine ..........................................254
5.7 RGS_ ma ..............................................256
5.8 U ospex ...............................................257
5.9 Calling SPEX om Fo an .....................................257
5.10 Linid .................................................259
6 Py hon In e ace 261
6.1 Basic commands ...........................................261
i
6.2 Analysis h eads & o he icks ....................................299
6.3 Ad anced class desc ip ions .....................................304
7 Help & oubleshoo ing 331
7.1 Commandline help ..........................................331
7.2 Sol ing SPEX p oblems .......................................332
7.3 Find known issues ..........................................334
7.4 Repo issues .............................................334
8 SPEX Theo y 335
8.1 SPEX A omic Code & Tables ....................................335
8.2 SPEX 2 no a ion o a omic ansi ions ................................349
8.3 Modelling and i ing .........................................356
8.4 Op imal de ini ion o espons ma ices ...............................361
8.5 De ini ion o he mic o- u bulen eloci y in SPEX .........................366
9 Exe cises 369
9.1 Powe law ...............................................369
9.2 Powe law wi h a Gaussian line ....................................370
9.3 S a is ics, binning and mo e .....................................370
9.4 S ella Spec a ............................................371
9.5 Supe no a emnan s .........................................372
9.6 Rela i is ic lines ...........................................372
9.7 AGN winds ..............................................373
10 Changelog 375
10.1 Ve sion 3.01.00 ............................................376
10.2 Ve sion 3.02.00 ............................................376
10.3 Ve sion 3.03.00 ............................................376
10.4 Ve sion 3.04.00 ............................................377
10.5 Ve sion 3.05.00 ............................................377
10.6 Ve sion 3.06.00 ............................................378
10.7 Ve sion 3.06.01 ............................................379
10.8 Ve sion 3.07.00 ............................................379
10.9 Ve sion 3.07.01 ............................................380
10.10 Ve sion 3.07.02 ............................................380
10.11 Ve sion 3.07.03 ............................................381
10.12 Ve sion 3.08.00 ............................................381
10.13 Ve sion 3.08.01 ............................................382
10.14 Ve sion 3.08.02 ............................................382
11 C edi s 383
11.1 So wa e ...............................................383
11.2 Plasma model .............................................383
11.3 SPEX models .............................................384
11.4 Documen a ion ............................................384
Py hon Module Index 385
ii
CHAPTER
ONE
GETTING STARTED
1.1 How o ins all SPEX
1.1.1 Download
The cu en SPEX e sion 3.08.02 was eleased on 2025-10-10. SPEX ins all iles can be downloaded om ou
Zenodo page.
1.1.2 Linux
Unpack he a ile in he des ina ion di ec o y ( o example /us /local/):
a x z spex-3.08.02-Linux-In el. a .gz
The a ile will c ea e a di ec o y called SPEX-3.08.02-Linux in which he p og am will be ins alled.
Se he en i onmen a iable SPEX90 o he ins alla ion di ec o y ( o example /us /local/SPEX-3.08.02-Linux):
expo SPEX90=/us /local/SPEX-3.08.02-Linux (bash shell)
se en SPEX90 /us /local/SPEX-3.08.02-Linux (C- ype shell)
Sou ce he sc ip p o ided by he dis ibu ion:
sou ce $SPEX90/spexdis .sh (bash shell)
sou ce $SPEX90/spexdis .csh (C- ype shell)
Remo e he a ile: m SPEX-3.08.02-Linux-In el. a .gz
No e: In some cases he csh sc ip ails because ei he PATH, LD_LIBRARY_PATH o PYTHON-
PATH a e no de ined. This can be empo a ily ixed by de ining an emp y a iable using se en , o
example: se en PATH "" and un he sc ip again. This will be ixed in he nex SPEX elease.
1

SPEX Help Cen e Documen a ion, Release 3.08.02
1.1.3 Mac OS
We p o ide a SPEX bina y e sion o Mac OS ha has been buil on In el p ocesso s as an ins all package.
Al hough his In el build wo ks mos ly on Apple Silicon p ocesso s, we ecommend o ollow he How o ins all
SPEX using Anaconda (page 20) ins ead on Apple Silicon machines as his is a na i e build on ha pla o m.
No e: This e sion o SPEX has been compiled using XQua z 2.8.0, so please upg ade XQua z o
a e sion >=2.8.0.
Adminis a o ins all (In el)
I you ha e adminis a o igh s on you Mac, his op ion is he easies one. Download he PKG ile om Zenodo
(SPEX-3.08.02-Apple-In el.pkg o SPEX-3.08.02-Apple-Silicon.pkg o M1/M2/M3 p ocesso s), open i in Mac
OS and ollow he ins uc ions on he sc een.
MacOS may complain abou no being able o e i y he de elope o he so wa e. Please close his dialog and
go o he MacOS Sys em P e e ences >> Secu i y & P i acy. In ha dialog, you a e o e ed o open he SPEX
package anyway. Accep he o e and make su e he SPEX package is unblocked. Now, you can open he SPEX
PKG ins alle again and p oceed wi h he ins alla ion.
Non-adminis a o ins all (In el)
Unpack he a ile in he des ina ion di ec o y ( o example /us /local/):
a x z spex-3.08.02-Apple-In el. a .gz
The a ile will c ea e a di ec o y called SPEX-3.08.02-Da win in which he p og am will be ins alled.
Se he en i onmen a iable SPEX90 o he ins alla ion di ec o y ( o example /us /local/SPEX-3.08.02-Da win):
expo SPEX90=/us /local/SPEX-3.08.02-Da win (bash shell)
se en SPEX90 /us /local/SPEX-3.08.02-Da win (C- ype shell)
Sou ce he sc ip p o ided by he dis ibu ion:
sou ce $SPEX90/spexdis .sh (bash shell)
sou ce $SPEX90/spexdis .csh (C- ype shell)
Remo e he a ile: m SPEX-3.08.02-Apple-In el. a .gz
No e: In some cases he csh sc ip ails because ei he PATH, DYLD_LIBRARY_PATH o
PYTHONPATH a e no de ined. This can be empo a ily ixed by de ining an emp y a iable us-
ing se en , o example: se en PATH "" and un he sc ip again. This will be ixed in he nex
SPEX elease.
2 Chap e 1. Ge ing s a ed
SPEX Help Cen e Documen a ion, Release 3.08.02
1.1.4 Windows 10/11
SPEX can be ins alled in Windows 11 using he linux subsys em in Windows (WSL2). SPEX can un in an Ubun u
Linux en i onmen ha can be ins alled h ough he Mic oso S o e.
How o ins all Ubun u in Windows 11
Since No embe 2022, WSL2 should suppo g aphics ou pu om Ubun u, so a sepa a e X-se e should no longe
be necessa y. Sec ion 5 o he u o ial abo e shows some examples o unning g aphical p og ams. I should no
be necessa y o un all o hose, bu hey can be help ul o es you ins alla ion. A e ins alling he X11 apps using
he command sudo ap ins all x11-apps, you should be able o con inue wi h he SPEX ins alla ion below.
Ins all SPEX in he Ubun u en i onmen
The s eps below desc ibe how o ins all a SPEX e sion ailo ed o Ubun u 22.04. I you a e planning o use Ana-
conda in his Ubun u WSL2 en i onmen , hen we would ecommend o ins all SPEX h ough Anaconda di ec ly.
See How o ins all SPEX using Anaconda (page 20) o de ails.
1. On he Ubun u e minal, i s ins all he OpenBlas lib a y: ap -ge ins all libopenblas-base
2. Download spex-3.08.02-Ubun u-WSL. a .gz om Zenodo. Unpack he a ile in he des ina ion di ec o y
( o example /us /local/):
a x z spex-3.08.02-Ubun u-WSL. a .gz
The a ile will c ea e a di ec o y called SPEX-3.08.02-Linux in which he p og am will be ins alled.
3. Se he en i onmen a iable SPEX90 o he ins alla ion di ec o y ( o example /us /local/SPEX-3.08.02-
Linux):
expo SPEX90=/us /local/SPEX-3.08.02-Linux (bash shell)
se en SPEX90 /us /local/SPEX-3.08.02-Linux (C- ype shell)
4. Sou ce he sc ip p o ided by he dis ibu ion:
sou ce $SPEX90/spexdis .sh (bash shell)
sou ce $SPEX90/spexdis .csh (C- ype shell)
5. Remo e he a ile: m spex-3.08.02-Ubun u-WSL. a .gz
6. Se he DISPLAY a iable in ~/.bash c:
echo "expo DISPLAY=localhos :0.0" >> ~/.bash c
. ~/.bash c
7. Run SPEX:
spex
I you ge an e o abou a missing lib a y when unning SPEX, please un he ollowing command:
sudo ap -ge ins all libopenblas-base lib eadline8 libncu ses5 x11-common libx11-6␣
˓→g o an
The command abo e makes su e ha all he packages ha SPEX needs a e ins alled.
The la es Ubun u build also con ains he py hon in e ace. To use i , make su e o ins all:
sudo ap -ge ins all py hon3-numpy py hon3-ma plo lib py hon3- u u e py hon3-as opy
1.1. How o ins all SPEX 3
SPEX Help Cen e Documen a ion, Release 3.08.02
1.2 How o un SPEX
SPEX is a spec al i ing p og am used o i high- esolu ion X- ay spec a. The code con ains se e al simple and
de ailed models ha a e able o deal wi h he adia i e p ocesses obse ed in he X- ay band. Because SPEX has a
command-line in e ace, a i s - ime use should ge amilia wi h he syn ax o he commands o be able o wo k
wi h i . This chap e p o ides some basic commands and h eads o i X- ay spec a.
1.2.1 The SPEX da a o ma
The da a iles con aining he spec um o he sou ce and he esponse need o be in he co ec o ma . In he SPEX
ins alla ion, we p o ide a p og am called T a o (page 245) o con e OGIP s anda d i s iles in o SPEX o ma
(see How o con e spec a o SPEX o ma (page 10) o an explana ion o how o use a o). In his chap e , we
assume ha you al eady ha e spec a in SPEX o ma . I no , you can ind example iles in he SPEX Exe cises
(page 369) sec ion. Each exe cise con ains a .spo and . es ile ha can be downloaded.
SPEX needs wo iles pe spec um:
•< ilename>.spo – This ile con ains he coun a e pe ene gy bin o he sou ce (𝐷𝑖), as well as he back-
g ound coun a e and he e o s (𝜎𝑖).
•< ilename>. es – This ile con ains he ins umen al esponse: he ene gy edis ibu ion and e ec i e a ea
(𝑅𝑖𝑗 𝐴𝑗).
In o de o calcula e he obse ed model spec um, SPEX uses his in eg al equa ion o accoun o he impe ec ions
caused by he ins umen :
𝐷(𝑐) = ∫︁𝑅(𝑐, 𝐸)𝐴(𝐸)𝑆(𝐸)𝑑𝐸 (1.1)
𝐷𝑖=
𝑛
∑︁
𝑗=1
𝑅𝑖𝑗𝐴𝑗𝑆𝑗
The . es and .spo iles a e so-called FITS iles. This is a da a o ma widely used in As onomy. FITS iles can
con ain images as well as da a ables. The so wa e package FTOOLS p o ided by NASA con ains a la ge numbe
o ools o manipula e FITS iles. I you a e in e es ed, hen you can launch launch o see which ools a e
a ailable. Fo mo e in o ma ion abou he SPEX spec um and esponse o ma see Op imal de ini ion o espons
ma ices (page 361).
1.2.2 Loading spec a in o SPEX
The SPEX p og am is s a ed by en e ing spex in a linux e minal window. In he ollowing sec ions we desc ibe
one un o he p og am. To s a SPEX do his:
use @linux:~> spex
Welcome use o SPEX e sion 3.00.00
SPEX>
Fi s , we ha e o load he da a iles. This is done using he da a command (Da a: ead esponse ile and spec um
(page 113)). I is a gene al hing in SPEX ha ilename ex ensions a e no yped explici ly when issuing a command.
I you ha e a ile called ilename.spo and ilename. es hen you ype:
SPEX> da a ilename ilename
The esponse ile (. es) is en e ed i s and hen he ile con aining he spec um (.spo). You can a oid con usion
by gi ing he same ilename o bo h . es and .spo iles. Remembe ha he o de o he wo ds in he commands is
e y impo an !
To sa e you om yping a lo , many commands can be abb e ia ed by yping jus he i s ew cha ac e s. Fo
example, da is equi alen o da and da a.
4 Chap e 1. Ge ing s a ed
SPEX Help Cen e Documen a ion, Release 3.08.02
1.2.3 Plo ing he da a
I he da a command was success ul, we can now ha e a look a he spec a. SPEX o e s a lo o di e en plo
commands (see Plo : Plo ing da a and models (page 137)). Using de aul se ings, he easies way o plo ing a
spec um is as ollows:
SPEX> plo de xs
SPEX> plo ype da a
SPEX> plo
The sequence abo e opens a PGPLOT window (plo de xs) and ells SPEX ha we wan o plo he spec al
da a (plo ype da a). This will c ea e a linea -linea plo in keV uni s.
The plo can be ailo ed o you wishes. Below is an example o change he plo o a linea -linea plo in Å and add
a i le o he plo :
SPEX> plo x lin
SPEX> plo y lin
SPEX> plo ux a
SPEX> plo uy a
SPEX> plo x 8.:35.
SPEX> plo y 0.:0.05
SPEX> plo se 1
SPEX> plo cap u ex "This is my plo "
SPEX> plo cap l disp alse
SPEX> plo cap id disp alse
SPEX> plo
To make su e he axes a e linea , we gi e he commands (plo x lin and plo y lin) and change he axes
o uni Å (plo ux a and plo uy a). The commands plo x 8.:35. and plo y 0.:0.05 change he
anges on he x and y axes, espec i ely. Then he colo o he da a, backg ound spec um and model a e se . The
las commands beginning wi h plo cap emo e some s anda d i les and o he ex a ound he plo . A e you
de ine he plo like in he example abo e, you can plo i wi h a single plo command.
The y-axis in his plo is in coun s s−1−1. Ångs om is no he only uni used in high-ene gy as ophysics. Usually,
he ene gy o he pho ons is exp essed in keV. In SPEX you can use keV by w i ing kins ead o ain all commands.
Fo example, plo ux k o use keV o he x-axis. An o e iew o possible uni s is p o ided in Plo axis uni s
and scales (page 162).
1.2.4 Igno ing and ebinning
High- esolu ion X- ay spec a om Chand a and XMM-New on a e usually o e sampled (e.g. he ene gy bins a e
much smalle han he spec al esolu ion) and con ain a lo mo e channels hen is use ul. The e o e, i is necessa y
o emo e wa eleng h in e als which con ain bad da a and ebin you spec um. The SPEX command o igno e
pa s o he spec um is called igno e (Igno e: igno ing pa o he spec um (page 125)) and he command o
ebin is called bin (Bin: ebin he spec um (page 110)). In he nex example we bin he spec um o e he 8–35
Å ange wi h a ac o o 5 and igno e he es o he spec um:
ign 0:8 uni a
ign 35:100 uni a
bin 8:35 5 uni a
The wo ds uni a ells SPEX ha he anges ( o example 8.0:35.0) a e gi en in Å. I you wo k wi h mo e han
one spec um ( om mo e han one ins umen ), you can add an ex a ins umen s a emen :
ign ins 1:2 0:8 uni a
ign ins 1:2 35:100 uni a
bin ins 1:2 8:35 5 uni a
1.2. How o un SPEX 5
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
Backscal: 1.00000000E+00
No BACKFILE keywo d ound
Co scal: 1.00000000E+00
No CORRFILE keywo d ound
No RESPFILE keywo d ound
No ANCRFILE keywo d ound
1.3.5 Bad channels and g ouping
Depending on he ins umen used, he e is a chance ha he spec um con ains bad channels. This is especially
ue o g a ing spec a. Some imes he backg ound spec um can ha e a di e en numbe o bad channels han he
sou ce spec um. I is he e o e impo an ha a pa icula bad channel in ei he o he wo spec a is igno ed. In
his example, he e a e no bad channels, so ei he yes o no will do.
Checking da a quali y and g ouping ...
Ogip iles ha e quali y lags. Quali y 0 means okay
You spec um ile has 0 bins wi h bad quali y
You backg ound ile has 0 bins wi h bad quali y
You combined ile has 0 bins wi h bad quali y
Shall we igno e bad channels? (y/n) [no]:y
I g ppha has been used on he spec um, a o will also ask whe he he spec a should be binned acco ding o he
g oups de ined in he PHA ile.
Impo an no e: We do no ecommend he use o g ppha o binning spec a. Fo spec a wi h Poisson s a is ics
(mos X- ay spec a), i is much be e o use C-s a is ics and use an op imal binning algo i hm in SPEX based on
he spec al esolu ion o he ins umen .
1.3.6 Read esponse and e ec i e a ea iles
In he nex s ep, he esponse ma ix is ead. Some imes, he esponse ma ices s a a channel 0, which can be
somewha con using. Especially when some a ays s a a channel 0 and o he s a channel 1. I bo h da a se s s a
a ze o, i is bes o shi he channel numbe s wi h 1 uni . Fo mos ins umen s his is ine, howe e , he e a e
si ua ions when his does no apply. In ha case, please check you ene gy g id by loading a del a line componen
in SPEX and check he ene gy o he line manually. Then, compa e he ou pu wi h a del a line de ined in XSPEC.
De e mining backg ound sub ac ed spec a ...
No esponse ma ix ile speci ied in pha- ile.
En e ilename esponse ma ix o be ead: PN. m
Reading esponse ma ix ...
Wa ning, ebounds da a s a ed a channel 0
Wa ning, esponse da a s a ed a channel 0
Possible esponse con lic ; check xspec/spex wi h del a line!
En e shi o esponse a ay (1 ecommended, bu some cases may be 0):1
No e ec i e a ea ile speci ied in pha- ile.
Some imes, also an e ec i e a ea ile needs o be p o ided sepa a ely:
Read ne e heless an e ec i e a ea ile? (y/n) [no]: y
En e ilename a - ile o be ead: PN.a
Reading e ec i e a ea ...
De e mining ze o esponse da a ...
To al numbe o channels wi h ze o esponse: 373
O iginal numbe o da a channels : 4096
Channels a e passing mask and omi ing ze o esponse channels: 3723
(con inues on nex page)
12 Chap e 1. Ge ing s a ed

SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
Rebinning da a whe e necessa y ...
Rebinning esponse whe e necessa y ...
old numbe o esponse elemen s: 435950
new numbe o esponse elemen s: 435950
old numbe o esponse g oups : 1481
new numbe o esponse g oups : 1481
Co ec ing o e ec i e a ea ...
De e mine numbe o componen s ...
Found 1 componen s
En e any shi in bins (0 ecommended): 0
o de will no be swapped ...
I he e a e bins wi h ze o esponse, hen hey a e excluded om he esul ing ile. Also he e a shi in bins can be
se , bu he ecommended alue is 0.
1.3.7 W i ing es and spo iles
The inal s ep is w i ing he spec a in SPEX o ma . The ile names should be p o ided wi hou an ex ension. The
.spo and . es ex ension will be added au oma ically.
En e ilename spec um o be sa ed (wi hou .spo): PN
En e ilename esponse o be sa ed (wi hou . es): PN
Final numbe o esponse elemen s: 435950
The PN.spo and PN. es ile ha e been sa ed in he cu en di ec o y.
1.4 Ins all he SPEX Py hon in e ace
The SPEX py hon in e ace depends on a qui e speci ic py hon en i onmen . Using conda, you can c ea e his
en i onmen p e y quickly. Please make su e you ha e (mini)conda ins alled and ini ialized on you machine
be o e you con inue.
1.4.1 Bina y ins alla ion
The easies op ion o ins all he Py hon in e ace o SPEX is by downloading he SPEX bina y e sion o you
pla o m. See and ollow he ins uc ion in How o ins all SPEX (page 1).
Once he s anda d SPEX en i onmen is se up using he spexdis .sh o spexdis .csh iles, i is ime o build
he conda en i onmen . This can be done using he spex.yml ile p o ided in he SPEX di ec o y. Please en e
he ollowing command:
(base) unix:~/SPEX> conda en c ea e - $SPEX90/py hon/spex.yml
This c ea es he spex-3.08 conda en i onmen o you. This s ep should only be done once.
No e: I you ins alled SPEX h ough he Mac package ins alle , hen spex.yml is no loca ed in a w i eable
di ec o y. Please copy spex.yml i s o you home di ec o y (cp /op /spex/py hon/spex.yml ~/) and hen
c ea e he conda en i onmen like: conda en c ea e - ~/spex.yml.
I success ul, you can om now on ac i a e he en i onmen wi h he command:
(base) unix:~/SPEX> conda ac i a e spex-3.08
1.4. Ins all he SPEX Py hon in e ace 13
SPEX Help Cen e Documen a ion, Release 3.08.02
And om now on, you can use he py hon in e ace in SPEX:
(spex-3.08) unix:~/SPEX> py hon
Py hon 3.11.6 |Anaconda, Inc.
Type "help", "copy igh ", "c edi s" o "license" o mo e in o ma ion.
>>> om pyspex.spex impo Session
>>> s=Session()
Welcome use o SPEX e sion 3.08.02
NEW in his e sion o SPEX:
07-10-2025 Added plo componen unc ionali y
07-10-2025 Added a bl model o load Xspec able models
07-10-2025 Added magne ism module o pion
07-10-2025 Added ebi model o labo a o y as ophysics
07-10-2025 Imp o emen o pa ial co e ing ac o
07-10-2025 Upda e o quick calcula ion mode
Se ing he numbe o h eads o 4 o op imal pe o mance.
Cu en ly using SPEXACT e sion 2.07.00. Type `help a calc` o de ails.
>>>
I you need o he py hon packages o you p ojec , you can ins all hem h ough conda in you new spex-3.08
en i onmen .
1.4.2 Compile Py hon in e ace o SPEX
I you do no wan o use conda, you can also compile he Py hon in e aces o SPEX. This can be done ei he
h ough a compile sc ip called compile.py o manually wi h CMake by adding he op ion -DPYTHON=3.
1.4.3 In eg a ion in o iPy hon and Jupy e No ebook
Nex o he dependencies ins alled in he conda en i onmen spex-3.08, he Py hon in e ace also depends on he
SPEX en i onmen a iables se wi h he spexdis .(c)sh iles. So be o e unning iPy hon o Jupy e no ebook, i is
necessa y o sou ce he SPEX en i onmen (also make su e he conda spex-3.08 en i onmen is ac i a ed):
(spex-3.08) unix:~> sou ce /op /spex/spexdis .sh
( eplace /op /spex in his pa h wi h he loca ion o SPEX on you machine, o $SPEX90 i his a iable is al eady
se ).
I may be ha iPy hon and Jupy e a e no ye ins alled in you conda en i onmen . I no , please ins all hem using
he command:
(spex-3.08) unix:~> conda ins all jupy e _clien ipyke nel
Wi h iPy hon and Jupy e no ebook, i can be help ul o ins all he spex conda en i onmen explici ly o you
p ojec :
(spex-3.08) unix:~> ipy hon ke nel ins all --use --name=spex-3.08
In you Jupy e no ebook, you can now selec spex-3.08 om he d op-down menu i you a e c ea ing a new
p ojec . The spex-3.08 conda en i onmen should now be linked o you Jupy e p ojec .
14 Chap e 1. Ge ing s a ed
SPEX Help Cen e Documen a ion, Release 3.08.02
1.5 Dependencies
PYSPEX depends on he numpy,as opy, and ma plo lib py hon modules. The cu en numpy e sions should
include he 2py p og am ha is necessa y o c ea e he Fo an o py hon in e ace.
Since Py hon 2 is no longe main ained, we do no ac i ely suppo he Py hon 2 applica ion o PYSPEX anymo e.
1.6 Compile SPEX om sou ce
Table o Con en s:
•Ge ing s a ed
•Lib a y dependencies
•MacOS ins uc ions
•Gene al compila ion ins uc ions
•Op ional ea u es
•C ea e ins all packages
1.6.1 Ge ing s a ed
The SPEX sou ce code can be compiled using he mul i-pla o m Cmake build sys em. See h p://www.cmake.o g/
o mo e in o ma ion and downloads, o check he package manage o you Linux dis ibu ion. The SPEX ins all
needs CMake e sion 3.0 o highe .
Since SPEX is p og ammed mos ly in Fo an 90, i is ecommended o use a ecen Fo an compile . SPEX has
been es ed wi h GFo an ( e sion 4 and abo e) and he In el Fo an Compile .
This Zenodo con ains a a .bz2 ile con aining he sou ce code o SPEX: spex-3.08.02-Sou ce. a .bz2. Unpack i
in a con enien di ec o y:
unix:~/So wa e> a x j spex-3.08.02-Sou ce. a .bz2
In he op-le el di ec o y, a sc ip called compile.py is a ailable o guide he use h ough he compila ion p ocess.
Please ead he sec ion abou lib a y dependencies i s and ins all wha is needed. O he wise, he sc ip will ell
you wha is missing. To un he sc ip call:
unix:~/So wa e/spex> py hon compile.py
Please no e ha he compile sc ip equi es Py hon 3 o be ins alled.
1.6.2 Lib a y dependencies
SPEX depends on a ew ex e nal lib a ies o unc ion. Fo some o hose, he lib a y sou ce code has been included
in he SPEX sou ce code package. By de aul , CMake will look o sys em lib a ies o link o. I hey a e no he e,
hen he e sion in he sou ce package will be used.
The ollowing lib a ies and packages a e equi ed o compile SPEX:
•CMake
•X11
•Readline
•CFITSIO (*)
1.5. Dependencies 15
SPEX Help Cen e Documen a ion, Release 3.08.02
•BLAS (*)
•LAPACK (*)
•PGPLOT (*)
(*) The SPEX sou ce ee also con ains he lib a y i necessa y.
All hese lib a ies a e commonly a ailable in Linux dis ibu ions, so please ead he documen a ion o you dis-
ibu ion o ind ou how o ins all hese lib a ies. Please no e ha some dis ibu ions equi e you o also ins all
he ‘de elopmen ’ package o a lib a y o be able o use hem du ing compila ion. In he Debian eposi o y, o
example, he de elopmen package o eadline is called ‘lib eadline-de ’.
Below, we lis some lib a y-speci ic commen s ha can be help ul in case o p oblems.
Readline
No e o Mac OSX use s: The OSX eadline lib a y is NOT compa ible wi h he GNU eadline lib a y. You need
o compile you own eadline lib a y om sou ce o ind a GNU eadline lib a y elsewhe e on you sys em o link
o. Compila ion may wo k in, o example, a MacPo s en i onmen , al hough his has no been es ed. The o icial
Mac e sion o SPEX s a ically links o a compiled e sion o eadline downloaded om:
h ps:// iswww.case.edu/php/che / eadline/ l op.h ml
CFITSIO
The cmake p og am will be able o ind sys em e sions o CFITSIO au oma ically. I CFITSIO is no ins alled,
please ins all i using a package manage o compile i you sel . In case cmake canno ind he CFITSIO lib a y, hen
add he lag -DCFITSIO_ROOT_DIR=/us /local o he cmake command (in his example, CFITSIO was compiled
using --p e ix=/us /local and he lib a y is ound in /us /local/lib/libc i sio.so. Make su e o p o ide he pa h
whe e you libc i sio lib a y is ins alled).
BLAS and LAPACK
Some o he SPEX models depend hea ily on he BLAS and LAPACK linea algeb a packages. The de aul ou ines
a e a ailable in he SPEX sou ce ee, bu compiling hose will no p o ide he bes pe o mance. The pe o mance
imp o es subs an ially i an op imized BLAS o LAPACK lib a y is used. The e a e wo es ed op ions:
•In el Ma h Ke nel Lib a y (MKL)
•OpenBLAS
When compiling wi h he In el Fo an compile , using MKL is qui e ob ious. To link he MKL lib a y, add he
ollowing op ion o he cmake command:
cmake . -DMKL=YES
I MKL is no se , cmake will look o o he op ions, like OpenBLAS, i hey a e ins alled on you machine. I
no hing is ound, he non-op imized code in he SPEX sou ce ee is used. On Mac, CMake could ind he MacOS
Accele a o amewo k.
16 Chap e 1. Ge ing s a ed
SPEX Help Cen e Documen a ion, Release 3.08.02
1.6.3 MacOS ins uc ions
The compila ion o SPEX on MacOS is sligh ly mo e demanding. SPEX can un na i ely on MacOS (wi hou
po s), bu hen i needs a ew p e-ins alled p og ams:
•Xcode (Th ough he App s o e)
•CMake
•XQua z
•GNU eadline Compile and ins all eadline wi h ‘clang’ and ins all in /us /local.
•Fo an compile . Fo example GCC/GFORTRAN.
1.6.4 Gene al Compila ion Ins uc ions
When all lib a y dependencies a e ins alled, he compila ion p ocess can begin. Execu e cmake in he oo di ec o y
o he SPEX sou ce ee, whe e CMakeLis s. x is loca ed (mind he do ):
unix:~/So wa e/SPEX-3.08.02-Sou ce> cmake .
I no e o s occu ed and all lib a ies we e ound, hen ype ‘make’:
unix:~/So wa e/SPEX-3.08.02-Sou ce> make
When he p og am needs o be ins alled sys em wide, hen execu e:
unix:~/So wa e/SPEX-3.08.02-Sou ce> sudo make ins all
The p og am will be ins alled o /op /spex by de aul . Usually, adminis a o igh s a e necessa y o copy he iles
o he igh loca ion.
Be o e you can un SPEX, he en i onmen needs o be se . This can be done wi h he sou ce command:
sou ce /op /spex/spexdis .sh (bash shell)
sou ce /op /spex/spexdis .csh (C- ype shell)
In case you used ano he p e ix o he SPEX ins alla ion di ec o y, you can ind spexdis .sh o spexdis .csh in he
p e ix di ec o y ha you se . To load he SPEX en i onmen au oma ically, add he ele an sou ce line o you
~/.csh c o ~/.bash c ile.
1.6.5 Op ional ea u es
The e a e se e al op ions ha can be passed o CMake o in luence he build p ocess h ough he -D ope a o . O
cou se, all op ions can be combined in a single cmake call. See he cmake documen a ion and he CMakeLis s. x
ile o de ails.
Compile selec ion
Selec a di e en o an compile :
unix:~/So wa e/SPEX-3.08.02-Sou ce> cmake . -DCMAKE_Fo an_COMPILER=i o
1.6. Compile SPEX om sou ce 17

SPEX Help Cen e Documen a ion, Release 3.08.02
Ins all p e ix
Ins all SPEX a a di e en loca ion in he ‘make ins all’ s ep:
unix:~/So wa e/SPEX-3.08.02-Sou ce> cmake . -DCMAKE_INSTALL_PREFIX=/home/use /
˓→so wa e
Fo ce use o SPEX lib a ies
The use o he SPEX lib a ies in he sou ce ee can be o ced:
unix:~/So wa e/SPEX-3.08.02-Sou ce> cmake . -DPGPLOT=YES
The command abo e will compile he pgplo lib a y om he SPEX sou ce ee. See he CMakeLis s. x ile o
mo e op ions.
1.7 Use SPEX h ough Docke
SPEX is w i en mos ly in Fo an 90 and depends on a ew sys em lib a ies. This makes i di icul o p o ide
a ew bina y e sions ha will con inue o un on mul iple pla o ms o e many yea s. The e o e, we ha e also
c ea ed a Docke image o SPEX ha can be un on he Docke pla o m, which is a ailable o Linux, Mac OS
and Windows.
1.7.1 S ep 1: Download and ins all Docke on you compu e
To un a Docke image, please ins all Docke on you compu e . See he Docke websi e o de ails and look o
he Docke Engine communi y edi ion. Once you ha e downloaded and ins alled Docke , you can con inue wi h
his u o ial.
1.7.2 S ep 2: Download he SPEX docke image om Zenodo
The SPEX Docke image is a ailable on his Zenodo page as a a .gz ile. Please download he ile called spex-
[ e sion]-Docke . a .gz, o example:
spex-3.08.02-Docke . a .gz
O , al e na i ely, you can pull he image om Docke hub wi h he command: docke pull spexx ay/
spex:la es .
1.7.3 S ep 3: Impo he SPEX image in o Docke
Be o e you can un he docke ile, i should be impo ed in o he docke sys em. This can be done on he command
line:
use @linux:~> docke load -i spex-3.08.02-docke . a .gz
The image will be named spexx ay/spex wi h he ag 3.08.02 and can be ound wi h he command:
use @linux:~> docke images
REPOSITORY TAG IMAGE ID CREATED SIZE
spexx ay/spex 3.08.02 0a0a0a0a0a0 1 minu e ago 996MB
18 Chap e 1. Ge ing s a ed
SPEX Help Cen e Documen a ion, Release 3.08.02
1.7.4 S ep 4: Run SPEX on Docke
Using he docke un command, he image can be execu ed and SPEX can be un in a so-called con aine . To enjoy
all he capabili ies o SPEX, wo hings need o be a anged in he docke un command: access o local di ec o ies
and a g aphical X11 connec ion. To a ange his, addi ional lags need o be speci ied on he command line.
1.7.5 Moun ing local di ec o ies o he con aine
I you would like o moun you own home di ec o y in o he SPEX con aine such ha you can use some spo and
es iles he e o sa e he ou pu iles, hen you need he ollowing lags:
-e LOCAL_USER_ID=`id -u $USER`
- /home/myuse name:/home/use
The i s lag a anges ha he use in he con aine will ha e he same use ID as you. This will allow you o ead
and w i e o you home di ec o y om wi hin he con aine .
The second lag a anges ha you ue local home di ec o y called /home/myuse name is moun ed o /home/use
inside he SPEX con aine .
MAC use s: Please no e ha on OSX you home di ec o y is in /Use s/myuse name.
1.7.6 A anging he X11 connec ion
To make su e PGPLOT can connec o he X11 se e on he hos , we need o make a ew connec ions om he
con aine o he hos machine. This is done wi h he ollowing lags:
-e DISPLAY=$DISPLAY
- / mp/.X11-unix:/ mp/.X11-unix
The i s lag se s he DISPLAY a iable inside he con aine o he DISPLAY a iable o he hos machine. The
second lag moun s he X11 empo a y di ec o y o he hos o he same di ec o y inside he con aine .
MAC use s: To use X11 on Mac, you need o ins all XQua z (o a simila X11 se e ) and se i o ‘Allow con-
nec ions om ne wo k clien s’ in he XQua z se ings. In addi ion, he X se e should be se o allow incoming
connec ions om localhos on he command line:
use @macos:~> xhos +127.0.0.1
Then he DISPLAY a iable on he docke un line should be se o hos .docke .in e nal:0
1.7.7 The comple e docke un command
The ull un commands o docke now look like below, whe e -w means ha he con aine will s a in wo king
di ec o y /home/use .
Fo Linux:
docke un -i
-e DISPLAY=$DISPLAY
-e LOCAL_USER_ID=`id -u $USER`
- / mp/.X11-unix:/ mp/.X11-unix
- /home/myuse name:/home/use
-w /home/use
spexx ay/spex:3.08.02
Fo Mac:
1.7. Use SPEX h ough Docke 19
SPEX Help Cen e Documen a ion, Release 3.08.02
docke un -i
-e DISPLAY=hos .docke .in e nal:0
-e LOCAL_USER_ID=`id -u $USER`
- / mp/.X11-unix:/ mp/.X11-unix
- /Use s/myuse name:/home/use
-w /home/use
spexx ay/spex:3.08.02
The docke un command abo e will p o ide you wi h a p omp ha will allow you o un spex:
use @linux:~> docke un -i -e DISPLAY=$DISPLAY -e LOCAL_USER_ID=`id -u $USER`
- / mp/.X11-unix:/ mp/.X11-unix - /home/myuse name:/home/use -w /home/use
spexx ay/spex:3.08.02
Welcome o he SPEX Docke Con aine !
Jus ype 'spex' o s a he p og am.
use @0922 2e4 85:~>
In his en i onmen , you can jus un spex o a o:
use @0922 2e4 85:~> spex
Welcome use o SPEX e sion 3.08.02
NEW in his e sion o SPEX:
07-10-2025 Added plo componen unc ionali y
07-10-2025 Added a bl model o load Xspec able models
07-10-2025 Added magne ism module o pion
07-10-2025 Added ebi model o labo a o y as ophysics
07-10-2025 Imp o emen o pa ial co e ing ac o
07-10-2025 Upda e o quick calcula ion mode
Se ing he numbe o h eads o 4 o op imal pe o mance.
Cu en ly using SPEXACT e sion 2.07.00. Type `help a calc` o de ails.
SPEX>
1.8 How o ins all SPEX using Anaconda
SPEX is now also a ailable h ough Anaconda o Linux and MacOS. The ins uc ions below assume ha you ha e
a wo king e sion o Anaconda on you sys em (o he wise see Anaconda download o Miniconda, which ins alls
he minimum needed).
1.8.1 SPEX s a us a Anaconda
1.8.2 C ea e a conda en i onmen o SPEX (op ional, bu ecommended)
To make su e ha SPEX keeps ha ing access o i s dependencies, i is bes o ins all i in i s own en i onmen . This
way, he numbe o po en ial con lic s wi h o he packages emains minimal.
Cu en ly, SPEX is a ailable o Py hon 3.10, 3.11 and 3.12, so please choose a e sion ha ma ches you needs.
A conda en i onmen can be c ea ed wi h he command below:
20 Chap e 1. Ge ing s a ed
SPEX Help Cen e Documen a ion, Release 3.08.02
(base) use @linux:~> conda c ea e -n spex py hon=3.12
Replace he e sion numbe in he lag py hon=3.12 wi h he Py hon e sion you need. Once he en i onmen is
c ea ed and he minimal packages a e ins alled, he en i onmen can be ac i a ed:
(base) use @linux:~> conda ac i a e spex
(spex) use @linux:~>
You now ha e a minimal en i onmen o ins all SPEX in o.
1.8.3 Ins all SPEX using conda
Ins alling SPEX in a conda en i onmen is as simple as:
(spex) use @linux:~> conda ins all -c spexx ay spex
Conda will au oma ically ins all he dependencies o SPEX. I is possible ha you need o e-ini ialize he conda
en i onmen o make SPEX un di ec ly om he command line:
(spex) use @linux:~> conda deac i a e
(base) use @linux:~> conda ac i a e spex
(spex) use @linux:~> spex
Welcome use o SPEX e sion 3.08.02
07-10-2025 Added plo componen unc ionali y
07-10-2025 Added a bl model o load Xspec able models
07-10-2025 Added magne ism module o pion
07-10-2025 Added ebi model o labo a o y as ophysics
07-10-2025 Imp o emen o pa ial co e ing ac o
07-10-2025 Upda e o quick calcula ion mode
Se ing he numbe o h eads o 4 o op imal pe o mance.
Cu en ly using SPEXACT e sion 2.07.00. Type `help a calc` o de ails.
SPEX> qui
Thank you o using SPEX
You p obably wan o ins all mo e packages in his en i onmen o you pu poses, like Jupy e lab o o he scien i ic
packages. This can be done using he conda ins all command as well.
On an Apple Mac, i is necessa y o ins all an Xse e , like XQua z.
1.8.4 Running SPEX in conda
E e y ime ha you wan o use SPEX in a new e minal, you ha e o ac i a e he spex en i onmen :
(base) use @linux:~> conda ac i a e spex
(spex) use @linux:~>
A e his command also he py hon in e ace o SPEX should be au oma ically ini ialized:
(spex) use @linux:~> py hon
>>> om pyspex.spex impo Session
>>> s=Session()
1.8. How o ins all SPEX using Anaconda 21
SPEX Help Cen e Documen a ion, Release 3.08.02
28 Chap e 2. Analysis h eads

SPEX Help Cen e Documen a ion, Release 3.08.02
2.1.6 Selec good da a and bin he spec um
Be o e we s a i ing, we can make su e ha only us wo hy da a is i ed. Fo MOS1, o example, we know
ha he calib a ion is alid o he ene gy ange be ween oughly 0.3 keV and 10 keV. To i only he good spec al
in e al, we need o igno e he pa s a low and high ene gies. This is done using he igno e command.
In addi ion, we can bin he spec um. To au oma ically ebin o he ecommended (op imal) bin size, one can use
he obin command. This command bins he spec um op imally based on he ins umen esolu ion and s a is ics.
SPEX> igno e 0:0.3 uni ke
SPEX> igno e 10:100 uni ke
SPEX> obin 0.3:10 uni ke
SPEX> plo
2.1.7 De ine he model
Nex we can de ine he model ha we wan o i . In his case, we a e looking a a MOS spec um o a galaxy
clus e . The simples model ha we can y is a single empe a u e spec um abso bed by gas in he ISM. We also
add a edshi componen eds (Reds: edshi model (page 224)) o shi he ene gy o he model spec um wi h
he igh amoun :
SPEX> com eds
You ha e de ined 1 componen .
SPEX> com ho
You ha e de ined 2 componen s.
(con inues on nex page)
2.1. Fi ing a CCD spec um 29
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
SPEX> com cie
You ha e de ined 3 componen s.
The ho model (Ho : collisional ionisa ion equilib ium abso p ion model (page 204)) is ac ually a gas in equi-
lib ium in abso p ion, which is a ai ep esen a ion o he neu al gas phase o he ISM. La e we will pu he
empe a u e o his componen o 5×10−4keV o emula e a neu al plasma.
The cie model (Cie: collisional ionisa ion equilib ium model (page 177)) ep esen s a single empe a u e plasma
in collisional ionisa ion equilib ium, which is commonly used o clus e s.
Then he componen s need o be ela ed o each o he , which means you need o speci y how he mul iplica i e
models should be applied o he addi i e models. The mul iplica i e componen s should be lis ed in o de om he
sou ce o he obse e (see also Comp: c ea e, dele e and ela e spec al componen s (page 111)):
SPEX> com el 3 1,2
This means ha he emi ed CIE componen (#3) will be i s edshi ed by componen #1 and hen abso bed by
componen #2. I you ha e mul iple addi i e componen s, his should be done o each one. I is possible o supply
a ange o componen s.
SPEX> calc
SPEX> plo
Calcula ing and plo ing he model unsu p isingly esul s in a cu e ha is no nea o he da a.
30 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
2.1.8 Ini ial guess o pa ame e s
To help he spec al i ing p ocess, i is good o p o ide ini ial guesses o he model pa ame e s. This way, he
spec al i s a s al eady wi h a model ha is in he igh di ec ion. As a mo e expe ienced use , you usually ha e a
ough idea wha he pa ame e s should be by looking a he aw spec um. Fo his clus e , o example, he edshi
is a ound 0.05, he abso p ion column is small, and he empe a u e o he clus e is a ound 3 keV. We can se he
guess pa ame e s as ollows:
SPEX> pa 1 1 z 0.05
SPEX> pa 1 1 z s
SPEX> pa 1 2 8E-6
SPEX> pa 1 2 s
SPEX> pa 1 2 nh 1E-4
SPEX> pa 1 3 no m 1000.
SPEX> pa 1 3 3.0
SPEX> ca
SPEX> pl
As we can see om he image, he i s guess o he model is al eady in he igh di ec ion.
In his example, we assume ha he exac edshi is unknown. Howe e , i you do ha e an accu a e measu emen
o he dis ance, i is wise o se ha dis ance in SPEX (Dis ance: se he sou ce dis ance (page 115)):
SPEX> dis 0.05 z
The command abo e se s he dis ance o 0.05 z and makes su e ha he luminosi ies a e co ec ly calcula ed.
No e ha his dis ance change also a ec s he alues o he no malisa ion o he models! So, we inc ease he
no malisa ion o keep he model easonably close o he da a:
2.1. Fi ing a CCD spec um 31
SPEX Help Cen e Documen a ion, Release 3.08.02
SPEX> pa 1 3 no m 1E+8
2.1.9 Fi he model
We a e now eady o i he spec um. To see he i ing s eps, we can gi e he command i p in 1. This needs
o be se only once pe session. A subsequen i command (Fi : spec al i ing (page 120)) s a s o op imize he
pa ame e s:
SPEX> i p in 1
SPEX> i
42102.6 5 5.000E-02 1.000E-04 1.000E+08 3.00
2461.87 10 5.404E-02 9.087E-05 2.021E+08 2.04
428.533 15 5.439E-02 1.041E-04 2.412E+08 2.31
414.925 20 5.437E-02 9.425E-05 2.429E+08 2.37
414.651 25 5.426E-02 9.229E-05 2.428E+08 2.37
414.532 30 5.408E-02 9.269E-05 2.428E+08 2.37
414.525 35 5.412E-02 9.281E-05 2.428E+08 2.37
414.524 42 5.411E-02 9.270E-05 2.428E+08 2.37
414.524 48 5.411E-02 9.265E-05 2.428E+08 2.37
--------------------------------------------------------------------------------------
˓→------------
sec comp mod ac o pa ame e wi h uni alue s a us minimum maximum␣
˓→lsec lcom lpa
1 1 eds z Redshi 5.4108180E-02 hawn -1.0 1.00E+10
1 1 eds lag Flag: cosmo=0, el=1 0.000000 ozen 0.0 1.0
1 2 ho nh X-Column (1E28/m**2) 9.2653019E-05 hawn 0.0 1.00E+20
1 2 ho Tempe a u e (keV) 1.9999999E-04 ozen 2.00E-04 1.00E+03
1 2 ho T(balance) / T(spec) 1.000000 ozen 1.00E-04 1.00E+04
1 2 ho co Co e ing ac ion 1.000000 ozen 0.0 1.0
1 2 ho RMS Veloci y (km/s) 100.0000 ozen 0.0 3.00E+05
1 2 ho ms RMS blend (km/s) 0.000000 ozen 0.0 1.00E+05
1 2 ho d Vel. sepa . (km/s) 100.0000 ozen 0.0 1.00E+05
1 2 ho z A e age el. (km/s) 0.000000 ozen -1.00E+05 1.00E+05
1 2 ho e Re e ence a om 1.000000 ozen 1.0 30.
1 2 ho 01 Abundance H 1.000000 ozen 0.0 1.00E+10
1 2 ho 02 Abundance He 1.000000 ozen 0.0 1.00E+10
1 2 ho 03 Abundance Li 1.000000 ozen 0.0 1.00E+10
1 2 ho 04 Abundance Be 1.000000 ozen 0.0 1.00E+10
1 2 ho 05 Abundance B 1.000000 ozen 0.0 1.00E+10
1 2 ho 06 Abundance C 1.000000 ozen 0.0 1.00E+10
1 2 ho 07 Abundance N 1.000000 ozen 0.0 1.00E+10
1 2 ho 08 Abundance O 1.000000 ozen 0.0 1.00E+10
1 2 ho 09 Abundance F 1.000000 ozen 0.0 1.00E+10
1 2 ho 10 Abundance Ne 1.000000 ozen 0.0 1.00E+10
1 2 ho 11 Abundance Na 1.000000 ozen 0.0 1.00E+10
1 2 ho 12 Abundance Mg 1.000000 ozen 0.0 1.00E+10
1 2 ho 13 Abundance Al 1.000000 ozen 0.0 1.00E+10
1 2 ho 14 Abundance Si 1.000000 ozen 0.0 1.00E+10
1 2 ho 15 Abundance P 1.000000 ozen 0.0 1.00E+10
1 2 ho 16 Abundance S 1.000000 ozen 0.0 1.00E+10
1 2 ho 17 Abundance Cl 1.000000 ozen 0.0 1.00E+10
1 2 ho 18 Abundance A 1.000000 ozen 0.0 1.00E+10
1 2 ho 19 Abundance K 1.000000 ozen 0.0 1.00E+10
1 2 ho 20 Abundance Ca 1.000000 ozen 0.0 1.00E+10
(con inues on nex page)
32 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
1 2 ho 21 Abundance Sc 1.000000 ozen 0.0 1.00E+10
1 2 ho 22 Abundance Ti 1.000000 ozen 0.0 1.00E+10
1 2 ho 23 Abundance V 1.000000 ozen 0.0 1.00E+10
1 2 ho 24 Abundance C 1.000000 ozen 0.0 1.00E+10
1 2 ho 25 Abundance Mn 1.000000 ozen 0.0 1.00E+10
1 2 ho 26 Abundance Fe 1.000000 ozen 0.0 1.00E+10
1 2 ho 27 Abundance Co 1.000000 ozen 0.0 1.00E+10
1 2 ho 28 Abundance Ni 1.000000 ozen 0.0 1.00E+10
1 2 ho 29 Abundance Cu 1.000000 ozen 0.0 1.00E+10
1 2 ho 30 Abundance Zn 1.000000 ozen 0.0 1.00E+10
1 2 ho ile File elec .dis ib.
1 3 cie no m ne nX V (1E64/m**3) 2.4279381E+08 hawn 0.0 1.00E+20
1 3 cie Tempe a u e (keV) 2.372914 hawn 5.00E-04 1.00E+03
1 3 cie sig Sigma 0.000000 ozen 0.0 1.00E+04
1 3 cie sup Sigma up 0.000000 ozen 0.0 1.00E+04
1 3 cie log T g id (lin/log) 1.000000 ozen 0.0 1.0
1 3 cie ed El dens (1E20/m**3) 9.9999998E-15 ozen 1.00E-22 1.00E+10
1 3 cie i Ion emp (keV) 1.000000 ozen 1.00E-04 1.00E+07
1 3 cie T(balance) / T(spec) 1.000000 ozen 1.00E-04 1.00E+04
1 3 cie ms RMS Veloci y (km/s) 0.000000 ozen 0.0 3.00E+05
1 3 cie e Re e ence a om 1.000000 ozen 1.0 30.
1 3 cie 01 Abundance H 1.000000 ozen 0.0 1.00E+10
1 3 cie 02 Abundance He 1.000000 ozen 0.0 1.00E+10
1 3 cie 03 Abundance Li 1.000000 ozen 0.0 1.00E+10
1 3 cie 04 Abundance Be 1.000000 ozen 0.0 1.00E+10
1 3 cie 05 Abundance B 1.000000 ozen 0.0 1.00E+10
1 3 cie 06 Abundance C 1.000000 ozen 0.0 1.00E+10
1 3 cie 07 Abundance N 1.000000 ozen 0.0 1.00E+10
1 3 cie 08 Abundance O 1.000000 ozen 0.0 1.00E+10
1 3 cie 09 Abundance F 1.000000 ozen 0.0 1.00E+10
1 3 cie 10 Abundance Ne 1.000000 ozen 0.0 1.00E+10
1 3 cie 11 Abundance Na 1.000000 ozen 0.0 1.00E+10
1 3 cie 12 Abundance Mg 1.000000 ozen 0.0 1.00E+10
1 3 cie 13 Abundance Al 1.000000 ozen 0.0 1.00E+10
1 3 cie 14 Abundance Si 1.000000 ozen 0.0 1.00E+10
1 3 cie 15 Abundance P 1.000000 ozen 0.0 1.00E+10
1 3 cie 16 Abundance S 1.000000 ozen 0.0 1.00E+10
1 3 cie 17 Abundance Cl 1.000000 ozen 0.0 1.00E+10
1 3 cie 18 Abundance A 1.000000 ozen 0.0 1.00E+10
1 3 cie 19 Abundance K 1.000000 ozen 0.0 1.00E+10
1 3 cie 20 Abundance Ca 1.000000 ozen 0.0 1.00E+10
1 3 cie 21 Abundance Sc 1.000000 ozen 0.0 1.00E+10
1 3 cie 22 Abundance Ti 1.000000 ozen 0.0 1.00E+10
1 3 cie 23 Abundance V 1.000000 ozen 0.0 1.00E+10
1 3 cie 24 Abundance C 1.000000 ozen 0.0 1.00E+10
1 3 cie 25 Abundance Mn 1.000000 ozen 0.0 1.00E+10
1 3 cie 26 Abundance Fe 1.000000 ozen 0.0 1.00E+10
1 3 cie 27 Abundance Co 1.000000 ozen 0.0 1.00E+10
1 3 cie 28 Abundance Ni 1.000000 ozen 0.0 1.00E+10
1 3 cie 29 Abundance Cu 1.000000 ozen 0.0 1.00E+10
1 3 cie 30 Abundance Zn 1.000000 ozen 0.0 1.00E+10
1 3 cie ile File elec .dis ib.
1 3 cie x1 T1/T0 1.000000 ozen 1.0 1.00E+10
1 3 cie y1 N1/N0 0.000000 ozen 0.0 1.00E+10
(con inues on nex page)
2.1. Fi ing a CCD spec um 33

SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
Ins umen 1 egion 1 has no m 1.00000E+00 and is ozen
--------------------------------------------------------------------------------
Fluxes and es ame luminosi ies be ween 2.0000 and 10.000 keV
sec comp mod pho on lux ene gy lux n o pho ons luminosi y
(pho /m**2/s) (W/m**2) (pho ons/s) (W)
1 3 cie 4.13667 2.229383E-15 2.655905E+51 1.422295E+36
--------------------------------------------------------------------------------
Fi me hod : Classical Le enbe g-Ma qua d
Fi s a is ic : C-s a is ic
C-s a is ic : 414.52
Expec ed C-s a : 247.13 +/- 21.92
Chi-squa ed alue : 528.16
Deg ees o eedom: 239
W-s a is ic : 0.00
A he end o he op imiza ion s ep, SPEX p in s ou an o e iew o he i pa ame e s and he i s a is ics. He e
we can see ha he i imp o ed, bu he e is s ill oom o imp o emen .
34 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
2.1.10 Fi ing abundances
Al hough he C-s a is ics a e no oo bad, he e a e s ill esiduals in he spec um, especially a ound he s onges
spec al lines. This is because he me al abundances in he gas a e s ill ixed o 1.0. We can le he abundances
a y in he op imiza ion by se ing hem o hawn:
SPEX> pa 1 3 08 s
SPEX> pa 1 3 12 s
SPEX> pa 1 3 14 s
SPEX> pa 1 3 16 s
SPEX> pa 1 3 18 s
SPEX> pa 1 3 20 s
SPEX> pa 1 3 26 s
SPEX> pa 1 3 28 s
SPEX> i
The op imiza ion leads o an e en be e i :
Fi me hod : Classical Le enbe g-Ma qua d
Fi s a is ic : C-s a is ic
C-s a is ic : 266.80
Expec ed C-s a : 247.12 +/- 21.91
Chi-squa ed alue : 366.77
Deg ees o eedom: 231
W-s a is ic : 0.00
2.1. Fi ing a CCD spec um 35
SPEX Help Cen e Documen a ion, Release 3.08.02
2.1.11 Calcula ing e o s
When we ha e he bes i , we can calcula e he e o s (E o : Calcula e he e o s o he i ed pa ame e s
(page 119)). This has o be done pe pa ame e . Below we calcula e, o example, he e o on he bes i empe -
a u e:
SPEX> e o 1 3
pa ame e C-s a Del a Del a
alue alue pa ame e C-s a
----------------------------------------------------
2.33348 267.68 -2.246547E-02 0.89
2.31101 270.23 -4.493093E-02 3.44
2.33348 267.68 -2.246547E-02 0.89
2.33247 267.69 -2.346587E-02 0.90
2.32425 268.52 -3.169394E-02 1.73
2.32836 268.05 -2.758002E-02 1.26
2.33042 267.87 -2.552295E-02 1.07
2.33127 267.79 -2.466774E-02 1.00
2.37841 267.71 2.246547E-02 0.92
2.40087 270.28 4.493093E-02 3.49
2.37841 267.71 2.246547E-02 0.92
2.37914 267.77 2.319646E-02 0.98
2.37940 267.78 2.345586E-02 0.99
2.37974 267.81 2.379751E-02 1.02
Pa ame e 1 3 : 2.3559 E o s: -2.46677E-02 , 2.37975E-02
The e o command epo s he bes i alue o he empe a u e and he lowe and uppe 1 sigma (68%) con idence
le el.
Usually, he e o calcula ion s age is he end poin o a spec al analysis. In his example, we can qui SPEX now:
SPEX> qui
Thank you o using SPEX!
2.2 Modeling pa icle backg ound
2.2.1 Goal
Time dependen pa icle backg ounds in X- ay spec a a e e y di icul o co ec ly sub ac , especially o ex ended
sou ces. Many imes, a quiescen pa icle backg ound emains p esen in he spec um a e la e il e ing. In his
example, we show how o model he quiescen so -p o on con ibu ion in a spec um ex ac ed om an annulus
a ound he co e o a clus e o galaxies. The di icul y he e is ha he e ec i e a ea o so p o ons is e y di e en
om he e ec i e a ea o X- ays. Please no e ha he example p o ided is no necessa ily scien i ically co ec .
The goal o his example is o show a gene al me hod o deal wi h hese kind o p oblems in SPEX. The choice o
models p obably needs o be di e en in o he cases.
36 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
2.2.2 SPEX solu ion
The basic p oblem we ha e o sol e he e, is ha we need a numbe o model componen s ha a e olded h ough
he mi o e ec i e a ea ( he cosmic X- ays) and a ew componen s desc ibing he pa icle backg ound, which a e
no olded h ough he ARF. In SPEX, his can be sol ed using sec o s (Sec o s and egions (page 357)). Sec o s
a e essen ially model g oups ep esen ing di e en a eas o di e en componen s on he sky. In his case, we will
c ea e wo sec o s: one o he cosmic X- ays and one o he pa icle backg ound. The second sec o should no be
olded h ough he ARF. To achie e his, we ha e o c ea e a special spec um and esponse ile wi h a o (T a o
(page 245)) in which we de ine he sec o s.
Fig. 1: Schema ic ep esen a ion o he sec o s and egions in his example. We load wo spec a wi h a o and
we de ine wo sec o s (le ). The exac model componen s a e la e de ined in SPEX. The models o sec o s 1
and 2 a e olded h ough he esponse ma ix sepa a ely. The esul o he olding is added and applied o he i s
spec um ( egion 1 on he igh ) only.
Running a o
In his a o un, we will ac ually load he same spec um wice. One o e e y sec o . He e we use a MOS1
spec um ex ac ed om an annulus be ween 6 and 9 a cmin om he clus e co e. The backg ound spec um was
ex ac ed using he XMM Ex ended Sou ce Analysis So wa e by Snowden & Kun z. A e s a ing a o we ha e
o ell i ha we wan o ans o m wo spec a in wo sec o s:
P og am a o: ans o m da a o SPEX 2.0 o ma
This is e sion 1.02, o a o
A e you da a in OGIP o ma : ype=1
Old (Ve sion 1.10 and below) SPEX o ma : ype=2
En e he ype: 1
En e he numbe o spec a you wan o ans o m: 2
En e he maximum numbe o esponse g oups pe ene gy pe spec um: 1000000
En e he numbe o sec o s you wan o c ea e: 2
The egion numbe esp esen s he spec al da a ha we will i . Because we wan o add he cosmic X- ay spec um
and he pa icle backg ound spec um, we wan bo h sec o s o poin o egion 1. Fi s , we en e he spec a o he
i s sec o . We only show he mos ele an inpu /ou pu lines he e.
En e he sec o and egion numbe : 1 1
How should he ma ix be pa ioned?
Op ion 1: keep as p o ided (1 componen , no e-a angemen s)
(con inues on nex page)
2.2. Modeling pa icle backg ound 37
SPEX Help Cen e Documen a ion, Release 3.08.02
2.3.6 De ining he b oadband model
We a e s udying he in e s ella dus along he line o sigh o a b igh low-mass X- ay bina y loca ed nea he
Galac ic bulge (dis ance 6.1 kpc).
Se ing he dis ance o he sou ce
SPEX> dis ance 6.1 kpc
Dis ances assuming H0 = 70.0 km/s/Mpc, Omega_m = 0.300 Omega_Lambda = 0.700 Omega_ ␣
˓→= 0.000
Sec o m A.U. ly pc kpc Mpc edshi cz ␣
˓→age(y )
--------------------------------------------------------------------------------------
˓→--------
1 1.882E+20 1.258E+09 1.990E+04 6100.0000 6.1000 6.100E-03 0.0000 0.4␣
˓→1.990E+04
--------------------------------------------------------------------------------------
˓→--------
Se ing he SED
Se he in insic spec al-ene gy-dis ibu ion (SED) o he low-mass X- ay bina y. Fo a ypical X- ay bina y, he
SED be ween 0.1 and 10 keV is desc ibed by wo componen s (Mi suda e al. 1984): a he mal componen , e.g. a
black-body (Bb: blackbody model (page 176)), and a non- he mal componen , e.g. a powe -law (Pow: powe law
model (page 222)):
SPEX> com pow
You ha e de ined 1 componen .
SPEX> pa 1 1 no m alue 30
SPEX> pa 1 1 gamm alue 1.1
SPEX> com bb
You ha e de ined 2 componen s.
SPEX> pa 1 2 no m alue 3.e-7
SPEX> pa 1 2 alue 0.8
Se ing he Galac ic cold neu al abso p ion
SPEX> com ho
You ha e de ined 3 componen s.
SPEX> pa 1 3 nh alue 1.9e-2
SPEX> pa 1 3 alue 8e-6
SPEX> pa 1 3 s a us ozen
2.3.7 De ining he dus abso p ion
He e we in oduce he amol componen s (Amol: in e s ella dus abso p ion model (page 172)) o cha ac e ise
he in e s ella dus ex inc ion. In his example we add ou a bi a y dus compounds: a-oli ine (index=4230,
MgFeSiO4), a-qua z (index=2234, SiO2), c- o s e i e (index=3230, Mg2SiO4), and a-ens a i e (index=3231,
MgSiO3). The ull lis o all compounds is epo ed in Table Compounds lis (page 172) and Table Addi ional
compounds lis (page 173) in he Amol: in e s ella dus abso p ion model (page 172) sec ion o he manual.
44 Chap e 2. Analysis h eads

SPEX Help Cen e Documen a ion, Release 3.08.02
Se ing he in e s ella dus models
De ining amol wi h he ini ial guess o he column densi ies o he dus compounds:
SPEX> com amol
You ha e de ined 4 componen s.
SPEX> pa 1 4 i1 alue 4230
SPEX> pa 1 4 i2 alue 2234
SPEX> pa 1 4 i3 alue 3230
SPEX> pa 1 4 i4 alue 3231
SPEX> pa 1 4 n1 alue 1e-7
SPEX> pa 1 4 n2 alue 1e-7
SPEX> pa 1 4 n3 alue 1e-7
SPEX> pa 1 4 n4 alue 1e-7
SPEX> pa 1 4 n1 s a us hawn
SPEX> pa 1 4 n2 s a us hawn
SPEX> pa 1 4 n3 s a us hawn
SPEX> pa 1 4 n4 s a us hawn
Wa ning: I is necessa y o change and le ee o a y he ela i e abundances o he cold gas elemen s (Ho :
collisional ionisa ion equilib ium abso p ion model (page 204) in his case) which a e also con ained in he
dus compounds. In his example, he dus models con ain oxygen (08), magnesium (12), silicon (14) and i on
(26). We le hem o a y wi hin a limi ed ange acco ding o he deple ion in e als de ined by Whi e e al.
(2002) and Jenkins e al. (2009).
SPEX> pa 1 3 08 alue 0.7
SPEX> pa 1 3 12 alue 0.10
SPEX> pa 1 3 14 alue 0.10
SPEX> pa 1 3 26 alue 0.05
SPEX> pa 1 3 08 ange 0.4 1
SPEX> pa 1 3 12 ange 0 0.4
SPEX> pa 1 3 14 ange 0 0.4
SPEX> pa 1 3 26 ange 0 0.2
SPEX> pa 1 3 08 s a us hawn
SPEX> pa 1 3 12 s a us hawn
SPEX> pa 1 3 14 s a us hawn
SPEX> pa 1 3 26 s a us hawn
Se ing he componen ela ions
Adding he mul iplica i e componen s ho and amol o he b oad-band model:
SPEX> com el 1:2 4,3
SPEX> model show
--------------------------------------------------------------------------------
Numbe o sec o s : 1
Sec o : 1 Numbe o model componen s: 4
N . 1: pow [4,3 ]
N . 2: bb [4,3 ]
N . 3: ho
N . 4: amol
2.3. Fi ing in e s ella dus abso p ion 45
SPEX Help Cen e Documen a ion, Release 3.08.02
2.3.8 Fi ing
We i he model o he da a and p in he ee pa ame e s:
SPEX> calc
SPEX> i p in 1
SPEX> i
SPEX> i
SPEX> plo
SPEX> pa show ee
--------------------------------------------------------------------------------------
˓→------------
sec comp mod ac o pa ame e wi h uni alue s a us minimum maximum␣
˓→lsec lcom lpa
1 1 pow no m No m (1E44 ph/s/keV) 23.14066 hawn 0.0 1.00E+20
1 1 pow gamm Pho on index 0.9320605 hawn -10. 10.
1 2 bb no m A ea (1E16 m**2) 3.5883755E-07 hawn 0.0 1.00E+20
1 2 bb Tempe a u e (keV) 0.7793768 hawn 1.00E-04 1.00E+03
1 3 ho nh X-Column (1E28/m**2) 2.0304110E-02 hawn 0.0 1.00E+20
1 3 ho 08 Abundance O 0.5010648 hawn 0.40 1.0
1 3 ho 12 Abundance Mg 0.1016048 hawn 0.0 0.40
1 3 ho 14 Abundance Si 0.1060375 hawn 0.0 0.40
1 3 ho 26 Abundance Fe 0.000000 hawn 0.0 0.20
1 4 amol n1 Column 1 (1E28/m**2) 5.6286910E-07 hawn 0.0 1.00E+20
1 4 amol n2 Column 1 (1E28/m**2) 1.1466740E-07 hawn 0.0 1.00E+20
1 4 amol n3 Column 1 (1E28/m**2) 1.3037014E-07 hawn 0.0 1.00E+20
1 4 amol n4 Column 1 (1E28/m**2) 9.8849377E-08 hawn 0.0 1.00E+20
Ins umen 1 egion 1 has no m 1.00000E+00 and is ozen
Ins umen 1 egion 2 has no m 1.00000E+00 and is ozen
--------------------------------------------------------------------------------
Fluxes and es ame luminosi ies be ween 2.0000 and 10.000 keV
sec comp mod pho on lux ene gy lux n o pho ons luminosi y
(pho /m**2/s) (W/m**2) (pho ons/s) (W)
1 1 pow 7877.93 6.754451E-12 4.125361E+45 3.331746E+30
1 2 bb 3030.35 1.681985E-12 1.818740E+45 9.538203E+29
--------------------------------------------------------------------------------
Fi me hod : Classical Le enbe g-Ma qua d
Fi s a is ic : C-s a is ic
C-s a is ic : 2388.02
Expec ed C-s a : 2402.60 +/- 69.35
Chi-squa ed alue : 2406.15
Deg ees o eedom: 2388
W-s a is ic : 0.00
46 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
2.3.9 Final ema ks
This is he end o his analysis h ead. I you wan , you can sa e he pa ame e s and qui SPEX:
SPEX> pa w i e pa ame e s
SPEX> log ou i _ esul
SPEX> pa show
SPEX> log close ou pu
SPEX> qui
Thank you o using SPEX!
2.4 Impo UV/Op ical da a
Fo some applica ions i would be help ul o include non-X- ay da a in o he spec al i . Fo example, his can
be an op ical/UV spec um ha he use wan s o i simul aneously wi h he X- ay spec um using he models o
SPEX.
Fo some ins umen s, namely he pho ome ic il e s o XMM-New on’s OM and Swi ’s UVOT, he da a p oduc s
a e a ailable in he same o ma as he X- ay da a (i.e. he OGIP-s anda d PHA and esponse iles). The e o e,
o OM and UVOT il e s, he use is ecommended o con e he PHA and esponse iles o SPEX o ma using
TRAFO as no mally done o he X- ay da a.
In o ma ion abou he ins umen al esponse iles o OM and UVOT il e s can be ound he e:
h ps://www.cosmos.esa.in /web/xmm-new on/om- esponse- iles
h ps://swi .gs c.nasa.go /p oposals/swi _ esponses.h ml
Howe e , o some o he ins umen s he use may no know, o ha e access, o he coun s and ins umen al esponse
2.4. Impo UV/Op ical da a 47
SPEX Help Cen e Documen a ion, Release 3.08.02
in o ma ion. Fo example, he use ob ained op ical/UV luxes om NED o a able in a pape . In such cases he use
is ecommended o i s use he FTOOLS p og am called lx2xsp o con e hei da a o he OGIP-s anda d
PHA and esponse iles. The webpage o lx2xsp p o ides all he ins uc ions wi h some use ul examples:
h ps://heasa c.gs c.nasa.go /lheaso / ools/headas/ lx2xsp.h ml
This p og am eads a ex ile con aining he spec um wi h he speci ied uni s, and c ea es he co esponding PHA
and RSP iles. These iles can be hen con e ed o SPEX o ma using TRAFO as usual.
The SPEX equi alen o lx2xsp is U ospex (page 257). Please ollow he link o ind a b ie manual o his
ool. I c ea es a SPEX o ma spec um and esponse ma ix based on he luxes as unc ion o wa eleng h s o ed
in a ex ile. The ins umen esolu ion is needed in uni s o km/s (FWHM).
No e: The e a e some OM esponse ma ices a ound ha do no con o m o he OGIP s anda d.
The ex ension o he esponse ma ix is hen called ‘SPECTRESP MATRIX’ ins ead o he s anda d
‘SPECRESP MATRIX’. a o and ogip2spex will exi wi h an e o when his name e o is en-
coun e ed. This can be sol ed by enaming he ex ension o ‘SPECRESP MATRIX’ in he m ile.
This can be done, o example, by using he HEASOFT ask .
2.5 PION se up o AGN wa m abso be
By: Junjie Mao, Missagh Mehdipou , and Jelle Kaas a
2.5.1 Goal
Se up he PION model o he wa m abso be in a nea by Sey e 1 galaxy obse ed wi h Chand a HRC/LETGS.
No e: A simula ed spec um was used because his h ead me ely in ends o show he se up o he PION model.
2.5.2 P epa a ion
To ollow his h ead, you need o download he example iles he e: chl.spo and chl. es.
2.5.3 S a SPEX
S a SPEX in a linux e minal window:
use @linux:~> spex
Welcome use o SPEX e sion 3.05.00
SPEX>
48 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
2.5.4 Load da a
A command ile ailo ed o his h ead o load da a is a ailable he e da a.com
use @linux:~> ca da a.com
# Simula ed da a
#---------------
# HRC/LETGS DATA
da a chl chl
bin ins 1 eg 1 0:10000 2 uni ang
igno e ins 1 eg 1 0:1.5 uni ang
igno e ins 1 eg 1 60:1000 uni ang
Load he abo e command ile in o SPEX:
SPEX> log exe da a
2.5.5 Plo da a
A command ile ailo ed o his h ead o plo he da a is a ailable he e plo .com
use @linux:~> ca plo .com
# plo se ing
plo de xw
plo ype da a
plo x lin
plo ux a
plo x 1.5:60
plo y lin
plo uy a
plo y 0:20
plo se 1
plo mo lw 3
plo ill disp
plo back disp
plo cap id disp
plo cap u disp
plo cap l disp
plo
Load he abo e command ile in o SPEX:
SPEX> log exe plo
2.5.6 De ine model componen s and componen ela ions (s ep-by-s ep)
He e we a e looking a he wa m abso be in a nea by (z = 0.07) Sey e 1 galaxy.
2.5. PION se up o AGN wa m abso be 49

SPEX Help Cen e Documen a ion, Release 3.08.02
Se he dis ance o he sou ce
SPEX> dis 0.07 z
Dis ances assuming H0 = 70.0 km/s/Mpc, Omega_m = 0.300 Omega_Lambda = 0.700 Omega_ ␣
˓→= 0.000
Sec o m A.U. ly pc kpc Mpc edshi cz ␣
˓→age(y )
--------------------------------------------------------------------------------------
˓→--------
1 9.740E+24 6.511E+13 1.030E+09 3.157E+08 3.157E+05 315.6554 0.0700 20985.5 9.
˓→302E+08
--------------------------------------------------------------------------------------
˓→--------
SPEX> com eds
You ha e de ined 1 componen .
SPEX> pa 1 1 z al 0.07
50 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
Se he edshi componen
SPEX> com eds
You ha e de ined 1 componen .
SPEX> pa 1 1 z al 0.07
Se he galac ic abso p ion
SPEX> com ho
You ha e de ined 2 componen s.
SPEX> pa 1 2 nh al 2.0e-4
SPEX> pa 1 2 al 8E-6
SPEX> pa 1 2 s
SPEX> pa 1 2 nh s
Se he SED
Se he in insic spec al-ene gy-dis ibu ion (SED) o he AGN abo e he Lyman limi along ou line-o -sigh .
Fo a ypical Sey e 1 galaxy, he SED has h ee componen s (Mehdipou e al. 2015):
•A Comp onized disk componen (Com : comp onisa ion model (page 190)) o op ical o so X- ays
da a,
•A powe -law componen (Pow: powe law model (page 222)) o X- ay da a,
•A neu al e lec ion componen (Re l: e lec ion model (page 224)) o ha d X- ays da a. Usually, he
e lec ion componen has an exponen ial cu -o ene gy (300 keV he e).
SPEX> com com
You ha e de ined 3 componen s.
SPEX> pa 1 3 no m al 3.E12
SPEX> pa 1 3 no m s
SPEX> pa 1 3 0 al 5e-4
SPEX> pa 1 3 0 s
SPEX> pa 1 3 1 al 0.15
SPEX> pa 1 3 1 s
SPEX> pa 1 3 au al 20
SPEX> pa 1 3 au s
SPEX> com pow
You ha e de ined 4 componen s.
SPEX> pa 1 4 no m al 1.E+09
SPEX> pa 1 4 no m s
SPEX> pa 1 4 gamm al 1.7
SPEX> pa 1 4 gamm s
SPEX> com e l
You ha e de ined 5 componen s.
SPEX> pa 1 5 no m couple 1 4 no m
SPEX> pa 1 5 gamm couple 1 4 gamm
SPEX> pa 1 5 ecu al 300
SPEX> pa 1 5 ecu s
SPEX> pa 1 5 pow: g 0
SPEX> pa 1 5 scal al 1.
SPEX> pa 1 5 scal s
2.5. PION se up o AGN wa m abso be 51
SPEX Help Cen e Documen a ion, Release 3.08.02
Apply an exponen ial cu -o o he powe -law
Apply exponen ial cu -o o he powe -law componen o he SED bo h below he Lyman limi and abo e he
high-ene gy cu -o .
No e: The ecu pa ame e in he e l componen applies o i sel only.
SPEX> com e au
You ha e de ined 6 componen s.
SPEX> pa 1 6 a al -1
SPEX> pa 1 6 a s
SPEX> pa 1 6 au al 1.3605E-2
SPEX> pa 1 6 au s
SPEX> com e au
You ha e de ined 7 componen s.
SPEX> pa 1 7 a al 1
SPEX> pa 1 7 a s
SPEX> pa 1 7 au al 3.3333E-3
SPEX> pa 1 7 au s
Se he PION (abso p ion) componen s
He e we in oduce h ee PION componen s (Pion: SPEX pho oionised plasma model (page 216)). The pa ame e s
o he PION componen s a e es ic ed o imp o e he e iciency o a ealis ic i ing p ocess. co =1 e e s o he
PION componen ully co e s he line-o -sigh . omeg=1.E-7 e e s o a negligible solid angle (Ω) sub ended by
he PION componen wi h espec o he nucleus (omeg = Ω/4𝜋).
No e: The hi d pion componen is a spa e one wi h co =0 and omeg=0. This is p ac ical when analyzing eal
da a wi hou any p io knowledge o he numbe o PION componen s equi ed.
No e: To see he densi y e ec o he abso p ion ea u es, i is necessa y o se a non-ze o omeg alue.
SPEX> com pion
You ha e de ined 8 componen s.
** Pion model: ake ca e abou p ope COM REL use: check manual!
SPEX> com pion
You ha e de ined 9 componen s.
** Pion model: ake ca e abou p ope COM REL use: check manual!
SPEX> com pion
You ha e de ined 10 componen s.
** Pion model: ake ca e abou p ope COM REL use: check manual!
SPEX> pa 1 8:10 nh ange 1.E-7:1.E1
SPEX> pa 1 8:10 xil ange -5:5
SPEX> pa 1 8:10 omeg ange 0:1
SPEX> pa 1 8 nh al 5.E-03
SPEX> pa 1 8 xil al 2.7
SPEX> pa 1 8 z al -500
SPEX> pa 1 8 z s
SPEX> pa 1 8 al 100
SPEX> pa 1 8 s
SPEX> pa 1 8 omeg al 1.E-7
SPEX> pa 1 9 nh al 2.E-03
(con inues on nex page)
52 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
SPEX> pa 1 9 xil al 1.6
SPEX> pa 1 9 z al -100
SPEX> pa 1 9 z s
SPEX> pa 1 9 al 50
SPEX> pa 1 9 s
SPEX> pa 1 9 omeg al 1.E-7
SPEX> pa 1 10 nh al 1.E-7
SPEX> pa 1 10 xil al 0
SPEX> pa 1 10 co al 0
SPEX> pa 1 10 omega al 0
Se componen ela ion along ou line o sigh
Se he componen ela ion o he in insic AGN SED abo e he Lyman limi along ou line-o -sigh .
No e: Pho ons om bo h he Comp onized disk and powe -law componen s a e sc eened by he wa m abso be
componen s a he edshi o he a ge , as well as he galac ic abso p ion be o e eaching he de ec o . Pho ons
om he neu al e lec ion componen is assumed no o be sc eened by he wa m abso be o simplici y. I is s ill
edshi ed and equi es he galac ic abso p ion.
SPEX> com el 3 8,9,10,1,2
SPEX> com el 4 6,7,8,9,10,1,2
SPEX> com el 5 1,2
Se he componen ela ion o he PION componen s
Assuming ha he wa m abso be componen s close o he cen al engine a e de ined i s (wi h a smalle com-
ponen index), pho ons ansmi ed om he inne PION componen s (wi h a nonze o omeg alue) a e sc eened by
all he ou e PION componen s a he edshi o he a ge , as well as he galac ic abso p ion be o e eaching he
de ec o :
SPEX> com el 8 9,10,1,2
SPEX> com el 9 10,1,2
SPEX> com el 10 1,2
2.5. PION se up o AGN wa m abso be 53
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
SPEX> pa 1 3 au al 20
SPEX> pa 1 3 au s
SPEX> com pow
You ha e de ined 4 componen s.
SPEX> pa 1 4 no m al 1.E+09
SPEX> pa 1 4 no m s
SPEX> pa 1 4 gamm al 1.7
SPEX> pa 1 4 gamm s
SPEX> com e l
You ha e de ined 5 componen s.
SPEX> pa 1 5 no m couple 1 4 no m
SPEX> pa 1 5 gamm couple 1 4 gamm
SPEX> pa 1 5 ecu al 300
SPEX> pa 1 5 ecu s
SPEX> pa 1 5 pow: g 0
SPEX> pa 1 5 scal al 1.
SPEX> pa 1 5 scal s
(B) Apply exponen ial cu -o o he powe -law componen o he SED bo h below he Lyman limi and abo e he
high-ene gy cu -o .
No e: The ecu pa ame e in he e l componen applies o i sel only.
SPEX> com e au
You ha e de ined 6 componen s.
SPEX> pa 1 6 a al -1
SPEX> pa 1 6 a s
SPEX> pa 1 6 au al 1.3605E-2
SPEX> pa 1 6 au s
SPEX> com e au
You ha e de ined 7 componen s.
SPEX> pa 1 7 a al 1
SPEX> pa 1 7 a s
SPEX> pa 1 7 au al 3.3333E-3
SPEX> pa 1 7 au s
(C) Se he PION (obscu ing wind) componen s.
He e we in oduce wo PION componen s o he obscu ing wind (Kaas a e al. 2014). The pa ame e s o he
PION componen s a e es ic ed o imp o e he e iciency o a ealis ic i ing p ocess.
No e: The second pion componen is a spa e one wi h co =0 and omeg=0. This is p ac ical when analyzing
eal da a wi hou any p io knowledge o he numbe o PION componen s equi ed.
SPEX> com pion
You ha e de ined 8 componen s.
** Pion model: ake ca e abou p ope COM REL use: check manual!
SPEX> com pion
You ha e de ined 9 componen s.
** Pion model: ake ca e abou p ope COM REL use: check manual!
SPEX> pa 1 8:9 nh ange 1.E-7:1.E1
SPEX> pa 1 8:9 xil ange -5:5
SPEX> pa 1 8 nh al 5.E-02
SPEX> pa 1 8 xil al 0.0
(con inues on nex page)
60 Chap e 2. Analysis h eads

SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
SPEX> pa 1 8 z al -3000
SPEX> pa 1 8 z s
SPEX> pa 1 8 al 1100
SPEX> pa 1 8 s
SPEX> pa 1 9 nh al 1.E-7
SPEX> pa 1 9 nh s
SPEX> pa 1 9 xil al 0
SPEX> pa 1 9 xil s
SPEX> pa 1 9 co al 0
SPEX> pa 1 9 omega al 0
(D) Se he PION (wa m abso be ) componen s.
He e we in oduce h ee PION componen s o he X- ay wa m abso be . omeg=1.E-7 e e s o a negligible solid
angle (Ω) sub ended by he PION componen wi h espec o he nucleus (omeg = Ω/4𝜋).
No e: To see he densi y e ec o he abso p ion ea u es, i is necessa y o se a non-ze o omeg alue.
SPEX> com pion
You ha e de ined 10 componen s.
** Pion model: ake ca e abou p ope COM REL use: check manual!
SPEX> com pion
You ha e de ined 11 componen s.
** Pion model: ake ca e abou p ope COM REL use: check manual!
SPEX> com pion
You ha e de ined 12 componen s.
** Pion model: ake ca e abou p ope COM REL use: check manual!
SPEX> pa 1 10:12 nh ange 1.E-7:1.E1
SPEX> pa 1 10:12 xil ange -5:5
SPEX> pa 1 10:12 omeg ange 0:1
SPEX> pa 1 10 nh al 5.E-03
SPEX> pa 1 10 xil al 2.7
SPEX> pa 1 10 z al -500
SPEX> pa 1 10 z s
SPEX> pa 1 10 al 100
SPEX> pa 1 10 s
SPEX> pa 1 10 omeg al 1.E-7
SPEX> pa 1 11 nh al 2.E-03
SPEX> pa 1 11 xil al 1.6
SPEX> pa 1 11 z al -100
SPEX> pa 1 11 z s
SPEX> pa 1 11 al 50
SPEX> pa 1 11 s
SPEX> pa 1 11 omeg al 1.E-7
SPEX> pa 1 12 nh al 1.E-7
SPEX> pa 1 12 xil al 0
SPEX> pa 1 12 co al 0
SPEX> pa 1 12 omega al 0
(E) Se he componen ela ion o line-o -sigh #1.
No e: Pho ons om bo h he Comp onized disk and powe -law componen s a e sc eened by he obscu ing wind
and wa m abso be componen s a he edshi o he a ge , as well as he galac ic abso p ion be o e eaching he
de ec o . Pho ons om he neu al e lec ion componen is assumed no o be sc eened by he obscu ing wind and
wa m abso be o simplici y. I is s ill edshi ed and equi es he galac ic abso p ion.
2.6. PION se up o emission and abso p ion ea u es in AGN 61
SPEX Help Cen e Documen a ion, Release 3.08.02
SPEX> com el 3 8,9,10,11,12,1,2
SPEX> com el 4 6,7,8,9,10,11,12,1,2
SPEX> com el 5 1,2
(F) Se he componen ela ion o he PION componen s. Assuming ha he obscu ing wind and wa m abso be
componen s close o he cen al engine a e de ined i s (wi h a smalle componen index), pho ons ansmi ed
om he inne PION componen s (wi h a nonze o omeg alue) a e sc eened by all he ou e PION componen s a
he edshi o he a ge , as well as he galac ic abso p ion be o e eaching he de ec o .
SPEX> com el 8 9,10,11,12,1,2
SPEX> com el 9 10,11,12,1,2
SPEX> com el 10 11,12,1,2
SPEX> com el 11 12,1,2
SPEX> com el 12 1,2
Se he componen s and componen ela ions o line-o -sigh s #2 and #3
(A) Se he AGN SED abo e he Lyman limi along line-o -sigh s #2a and #3a.
No e: He e we assume ha he pho oionizing SED o he X- ay b oad emission PION componen (s) is se o be
he same as ha o he obscu ing wind and wa m abso be . This simpli ica ion assumes ha he X- ay b oad-line
egion espond o he pho oionizing SED ins an aneously. Because he X- ay b oad-line egion is ypically a ew
ligh days away om he cen al engine and i has a ela i ely high densi y. On he o he hand, he pho oionizing SED
o he X- ay na ow emission PION componen (s) is se o a long- e m a e aged SED. This simpli ica ion assumes
ha he X- ay na ow-line egion is in a s eady s a e, i.e. i a ies sligh ly a ound a mean alue co esponding o he
mean lux le el o e ime. Because he X- ay na ow-line egion is ypically a ew pa secs away om he cen al
engine and i has a ela i ely low densi y. Reade s a e e e ed o Sil a e al. 2016 o a de ailed spec al iming
s udy.
SPEX> com com
You ha e de ined 13 componen s.
SPEX> pa 1 13 no m: ype couple 1 3 no m: ype
SPEX> com pow
You ha e de ined 14 componen s.
SPEX> pa 1 14 no m:lum couple 1 4 no m:lum
SPEX> com com
You ha e de ined 15 componen s.
SPEX> pa 1 15 no m al 1.E12
SPEX> pa 1 15 no m s
SPEX> pa 1 15 0 al 3.E-4
SPEX> pa 1 15 0 s
SPEX> pa 1 15 1 al 0.125
SPEX> pa 1 15 1 s
SPEX> pa 1 15 au al 20
SPEX> pa 1 15 au s
SPEX> com pow
You ha e de ined 16 componen s.
SPEX> pa 1 16 no m al 6.E9
SPEX> pa 1 16 no m s
SPEX> pa 1 16 gamm al 1.6
SPEX> pa 1 16 gamm s
(B) Apply exponen ial cu -o o he abo e AGN SEDs a all ene gies because hese pho ons do no each us (dashed
g ay lines in Figu e 1).
62 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
SPEX> com e au
You ha e de ined 17 componen s.
SPEX> pa 1 17 au al 1.E3
SPEX> pa 1 17 au s
SPEX> pa 1 17 a al 0
SPEX> pa 1 17 a s
(C) Se he PION (emission) componen s.
He e we in oduce h ee PION componen s. The pa ame e s o he PION componen s a e es ic ed o imp o e he
e iciency o a ealis ic i ing p ocess. co =0 o he emission PION componen s.
No e: The i s pion componen e e s o he X- ay b oad-line egion. The second pion componen e e s o he
X- ay na ow-line egion. The hi d pion componen is a spa e one wi h co =0 and omeg=0. This is p ac ical
when analyzing eal da a wi hou any p io knowledge o he numbe o PION componen s equi ed.
SPEX> com pion
You ha e de ined 18 componen s.
** Pion model: ake ca e abou p ope COM REL use: check manual!
SPEX> com pion
You ha e de ined 19 componen s.
** Pion model: ake ca e abou p ope COM REL use: check manual!
SPEX> com pion
You ha e de ined 20 componen s.
** Pion model: ake ca e abou p ope COM REL use: check manual!
SPEX> pa 1 16:18 nh ange 1.E-7:1.E1
SPEX> pa 1 16:18 xil ange -5:5
SPEX> pa 1 16:18 omeg ange 0:1
SPEX> pa 1 16 nh al 8.E-02
SPEX> pa 1 16 xil al 0.8
SPEX> pa 1 16 z al 0
SPEX> pa 1 16 z s
SPEX> pa 1 16 al 100
SPEX> pa 1 16 s
SPEX> pa 1 16 omeg al 3.E-2
SPEX> pa 1 16 omeg s
SPEX> pa 1 17 nh al 5.E-02
SPEX> pa 1 17 xil al 2.3
SPEX> pa 1 17 z al 0
SPEX> pa 1 17 z s
SPEX> pa 1 17 al 240
SPEX> pa 1 17 s
SPEX> pa 1 17 omeg al 5.E-2
SPEX> pa 1 17 omeg s
SPEX> pa 1 18 nh al 1.E-7
SPEX> pa 1 18 nh s
SPEX> pa 1 18 xil al 0
SPEX> pa 1 18 xil s
SPEX> pa 1 18 co al 0
SPEX> pa 1 18 omeg al 0
(D) Se he b oadening due o mac oscopic mo ion o he PION (emission) componen s.
No e: The pa ame e in PION componen s e e o he mic oscopic (i.e. u bulen ) mo ion. The mac oscopic
mo ion e e s o he o a ion a ound he black hole. Fo he X- ay b oad emission lines, he mac oscopic mo ion
domina es he b oadening. Fo he X- ay na ow emission lines, he mic oscopic and mac oscopic mo ion a e o en
2.6. PION se up o emission and abso p ion ea u es in AGN 63
SPEX Help Cen e Documen a ion, Release 3.08.02
degene a e (Mao e al. 2018). The second and hi d gau componen s a e spa e.
SPEX> com gau
You ha e de ined 21 componen s.
pa 1 21 sig al 7.E3
pa 1 21 sig s
SPEX> com gau
You ha e de ined 22 componen s.
SPEX> com gau
You ha e de ined 23 componen s.
(E) Se he componen ela ion o line-o -sigh s #2a and #3a.
No e: Pho ons om bo h he Comp onized disk and powe -law (wi h exponen ial low- and high-ene gy cu -o s)
componen s a e he pho oionizing sou ce o he PION emission componen s a he edshi o he a ge . While
( e lec ed/ ep ocessed) pho ons om he PION emission componen s each us.
SPEX> com el 13 18,1,17
SPEX> com el 14 6,7,18,1,17
SPEX> com el 15 19,20,1,17
SPEX> com el 16 6,7,19,20,1,17
(F) Se he componen ela ion o he PION (emission) componen s.
No e: He e we assume ha he obscu ing wind is ou side he X- ay b oad-line egion and i sc eens pho ons
emi ed om he X- ay b oad-line egion be o e i eaches us. On he o he hand, since he obscu ing wind is
close o he cen al engine han he X- ay na ow-line egion, pho ons emi ed om he X- ay na ow-line egion
a e no sc eened by he obscu ing wind.
SPEX> com el 18 21,8,9,1,2,26
SPEX> com el 19 22,1,2,26
SPEX> com el 20 23,1,2,26
(G) Se he componen ela ion o he AGN SED below he Lyman limi (op ical/UV) along line-o -sigh #1.
SPEX> com el 24 30,1,31,27
SPEX> com el 25 6,7,30,1,31,27
SPEX> com el 28 1
SPEX> com el 29 1
2.6.7 Check se ings and calcula e
We check he se ing o he componen ela ion:
SPEX> model show
--------------------------------------------------------------------------------
Numbe o sec o s : 1
Sec o : 1 Numbe o model componen s: 31
N . 1: eds
N . 2: ho
N . 3: com [8,9,10,11,12,1,2,26 ]
N . 4: pow [6,7,8,9,10,11,12,1,2,26 ]
N . 5: e l[1,2,26 ]
(con inues on nex page)
64 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
N . 6: e au
N . 7: e au
N . 8: pion[9,10,11,12,1,2,26 ]
N . 9: pion[10,11,12,1,2,26 ]
N . 10: pion[11,12,1,2,26 ]
N . 11: pion[12,1,2,26 ]
N . 12: pion[1,2,26 ]
N . 13: com [18,1,17 ]
N . 14: pow [6,7,18,1,17 ]
N . 15: com [19,20,1,17 ]
N . 16: pow [6,7,19,20,1,17 ]
N . 17: e au
N . 18: pion[21,8,9,1,2,26 ]
N . 19: pion[22,1,2,26 ]
N . 20: pion[23,1,2,26 ]
N . 21: gau
N . 22: gau
N . 23: gau
N . 24: com [30,1,31,27 ]
N . 25: pow [6,7,30,1,31,27 ]
N . 26: e au
N . 27: e au
N . 28: ile[1 ]
N . 29: ile[1 ]
N . 30: eb
N . 31: eb
We check he se ing o he ee pa ame e s and calcula e he 1–1000 Ryd ionizing luminosi y:
SPEX> elim 1.E0:1.E3 yd
SPEX> calc
SPEX> plo
SPEX> pa show ee
--------------------------------------------------------------------------------------
˓→------------
sec comp mod ac o pa ame e wi h uni alue s a us minimum maximum␣
˓→lsec lcom lpa
1 3 com no m No m (1E44 ph/s/keV) 3.0000001E+12 hawn 0.0 1.00E+20
1 3 com 0 Wien emp (keV) 5.0000002E-04 hawn 1.00E-05 1.00E+10
1 3 com 1 Plasma emp (keV) 0.1500000 hawn 1.00E-05 1.00E+10
1 3 com au Op ical dep h 20.00000 hawn 1.00E-03 1.00E+03
1 4 pow no m No m (1E44 ph/s/keV) 1.0000000E+09 hawn 0.0 1.00E+20
1 4 pow gamm Pho on index 1.700000 hawn -10. 10.
1 8 pion nh X-Column (1E28/m**2) 5.0000001E-02 hawn 1.00E-07 10.
1 8 pion xil Log xi (1E-9 Wm) 0.000000 hawn -5.0 5.0
1 8 pion RMS Veloci y (km/s) 1100.000 hawn 0.0 3.00E+05
1 8 pion z A e age el. (km/s) -3000.000 hawn -1.00E+05 1.00E+05
(con inues on nex page)
2.6. PION se up o emission and abso p ion ea u es in AGN 65

SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
1 10 pion nh X-Column (1E28/m**2) 4.9999999E-03 hawn 1.00E-07 10.
1 10 pion xil Log xi (1E-9 Wm) 2.700000 hawn -5.0 5.0
1 10 pion RMS Veloci y (km/s) 100.0000 hawn 0.0 3.00E+05
1 10 pion z A e age el. (km/s) -500.0000 hawn -1.00E+05 1.00E+05
1 11 pion nh X-Column (1E28/m**2) 2.0000001E-03 hawn 1.00E-07 10.
1 11 pion xil Log xi (1E-9 Wm) 1.600000 hawn -5.0 5.0
1 11 pion RMS Veloci y (km/s) 50.00000 hawn 0.0 3.00E+05
1 11 pion z A e age el. (km/s) -100.0000 hawn -1.00E+05 1.00E+05
1 18 pion nh X-Column (1E28/m**2) 7.9999998E-02 hawn 1.00E-07 10.
1 18 pion xil Log xi (1E-9 Wm) 0.8000000 hawn -5.0 5.0
1 18 pion omeg Scaling ac o emis. 2.9999999E-02 hawn 0.0 1.0
1 19 pion nh X-Column (1E28/m**2) 5.0000001E-02 hawn 1.00E-07 10.
1 19 pion xil Log xi (1E-9 Wm) 2.300000 hawn -5.0 5.0
1 19 pion RMS Veloci y (km/s) 240.0000 hawn 0.0 3.00E+05
1 19 pion omeg Scaling ac o emis. 9.9999998E-03 hawn 0.0 1.0
1 21 gau sig Sigma (km/s) 7000.000 hawn 0.0 3.00E+05
1 28 ile no m Flux scale ac o 0.3000000 hawn 0.0 1.00E+20
1 29 ile no m Flux scale ac o 0.4000000 hawn 0.0 1.00E+20
1 30 eb eb E(B-V) (mag) 0.1000000 hawn 0.0 1.00E+20
1 31 eb eb E(B-V) (mag) 0.1200000 hawn 0.0 1.00E+20
Ins umen 1 egion 1 has no m 1.00000E+00 and is ozen
Ins umen 2 egion 1 has no m 1.00000E+00 and is ozen
Ins umen 3 egion 1 has no m 1.00000E+00 and is ozen
Ins umen 4 egion 1 has no m 1.00000E+00 and is ozen
Ins umen 5 egion 1 has no m 1.00000E+00 and is ozen
Ins umen 6 egion 1 has no m 1.00000E+00 and is ozen
Ins umen 7 egion 1 has no m 1.00000E+00 and is ozen
Ins umen 8 egion 1 has no m 1.00000E+00 and is ozen
--------------------------------------------------------------------------------
Fluxes and es ame luminosi ies be ween 1.36057E-02 and 13.606 keV
(con inues on nex page)
66 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
sec comp mod pho on lux ene gy lux n o pho ons luminosi y
(pho /m**2/s) (W/m**2) (pho ons/s) (W)
1 3 com 7.891731E-04 1.775058E-19 1.447225E+54 7.988903E+36
1 4 pow 38.8452 3.366349E-14 2.869709E+54 1.021578E+38
1 5 e l 5.98573 7.190706E-15 6.284845E+51 7.467510E+36
1 8 pion 0.00000 0.00000 0.00000 0.00000
1 9 pion 0.00000 0.00000 0.00000 0.00000
1 10 pion 1.755872E-08 5.460370E-24 2.240611E+44 1.101832E+28
1 11 pion 7.849879E-10 9.871699E-26 3.169252E+45 7.940836E+27
1 12 pion 0.00000 0.00000 0.00000 0.00000
1 13 com 1213.94 6.701157E-15 1.447225E+54 7.988903E+36
1 14 pow 1657.30 8.033095E-14 2.869709E+54 1.021578E+38
1 15 com 0.00000 0.00000 1.106767E+53 5.268881E+35
1 16 pow 0.00000 0.00000 1.296679E+55 6.397146E+38
1 18 pion 2.157629E-03 5.832195E-19 1.541392E+54 9.503085E+36
1 19 pion 3.30138 4.647512E-16 5.174083E+52 1.025305E+36
1 20 pion 0.00000 0.00000 0.00000 0.00000
1 24 com 0.501314 1.089752E-18 1.447225E+54 7.988903E+36
1 25 pow 0.193548 4.207327E-19 2.869709E+54 1.021578E+38
1 28 ile 0.00000 0.00000 0.00000 0.00000
1 29 ile 0.00000 0.00000 0.00000 0.00000
Fi me hod : Classical Le enbe g-Ma qua d
Fi s a is ic : C-s a is ic
C-s a is ic : 1215.69
Expec ed C-s a : 1212.71 +/- 49.26
Chi-squa ed alue : 1221.23
Deg ees o eedom: 0
W-s a is ic : 0.00
Con ibu ions o ins umen s and egions:
Ins Reg Bins C-s a Exp C-s a Rms C-s a chi**2 W-s a
1 1 996 1007.73 996.70 44.66 1012.35 0.00
2 1 210 197.87 210.01 20.49 198.61 0.00
3 1 1 3.06 1.00 1.41 3.22 0.00
4 1 1 0.01 1.00 1.41 0.01 0.00
5 1 1 0.31 1.00 1.41 0.32 0.00
6 1 1 0.20 1.00 1.41 0.20 0.00
7 1 1 4.62 1.00 1.41 4.67 0.00
8 1 1 1.89 1.00 1.41 1.87 0.00
2.6.8 Final ema ks
This is he end o his analysis h ead. I you wan , you can qui SPEX now:
SPEX> qui
Thank you o using SPEX!
Below, we p o ide a use ul command ile.
2.6. PION se up o emission and abso p ion ea u es in AGN 67
SPEX Help Cen e Documen a ion, Release 3.08.02
De ine model componen s and componen ela ions ( unning sc ip s)
calc.com is he command ile ailo ed o his h ead.
Load he abo e command ile in o SPEX:
use @linux:~> spex
Welcome use o SPEX e sion 3.05.00
SPEX> log exe calc
2.7 Fi ing wo di e en spec a simul aneously
Suppose one wan s o i wo obse ed spec a om di e en sou ces (o a eas on he sky) simul aneously wi h wo
di e en models, bu wi h ce ain pa ame e s coupled o each o he . This is possible wi h SPEX! In his h ead, we
will guide you h ough he necessa y s eps o make his wo k.
68 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
2.7.1 Goal
Suppose we ha e wo poin sou ces abso bed by he same molecula cloud in on o hem. The elemen al abun-
dances in he cloud appea o be non-sola , bu a e assumed o be cons an ough he cloud. Le ’s say, we wan o
i bo h sou ces, while we couple he abundance in he abso be . This equi es us o load wo di e en spec a and
apply wo di e en sou ce models o hem, while cons aining some pa ame e s be ween he models.
2.7.2 Sec o s and egions
Be o e we begin, i is good o unde s and he SPEX de ini ions o ‘sec o s’ and ‘ egions’. These SPEX concep s a e
e y use ul when c ea ing mo e complica ed i ing se ups, bu a e o en conside ed o be con using. In his con ex ,
i is also use ul o know he de ini ion o ‘ins umen s’, because his is e y close o he de ini ion o ‘ egion’.
Sec o s a e used in SPEX o c ea e mul iple sepa a e models, o example o model wo di e en sou ces o a eas
o an ex ended sou ce. Key is ha his is a di ision in model space. Each sec o is assigned an in ege numbe
such ha each model can be iden i ied.
Regions a e used in SPEX o dis inguish di e en obse ed spec a, o example obse ed spec a om di e en
sou ces o spec a ex ac ed om di e en ex ac ion egions on he de ec o . Key is ha his is a di ision in da a
space. Each obse ed spec um is assigned i s own in ege numbe o be iden i ied. Regions a e usually de ined
when he spec a and esponse a e combined in o one .spo and . es ile.
Ins umen s a e ano he di ision in da a space. Spec a om each .spo and . es ile combina ion ha a e ead in,
2.7. Fi ing wo di e en spec a simul aneously 69
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
2 1 ho 10 Abundance Ne 1.000000 ozen 0.0 1.00E+10
2 1 ho 11 Abundance Na 1.000000 ozen 0.0 1.00E+10
2 1 ho 12 Abundance Mg 1.000000 ozen 0.0 1.00E+10
2 1 ho 13 Abundance Al 1.000000 ozen 0.0 1.00E+10
2 1 ho 14 Abundance Si 1.000000 ozen 0.0 1.00E+10
2 1 ho 15 Abundance P 1.000000 ozen 0.0 1.00E+10
2 1 ho 16 Abundance S 1.000000 ozen 0.0 1.00E+10
2 1 ho 17 Abundance Cl 1.000000 ozen 0.0 1.00E+10
2 1 ho 18 Abundance A 1.000000 ozen 0.0 1.00E+10
2 1 ho 19 Abundance K 1.000000 ozen 0.0 1.00E+10
2 1 ho 20 Abundance Ca 1.000000 ozen 0.0 1.00E+10
2 1 ho 21 Abundance Sc 1.000000 ozen 0.0 1.00E+10
2 1 ho 22 Abundance Ti 1.000000 ozen 0.0 1.00E+10
2 1 ho 23 Abundance V 1.000000 ozen 0.0 1.00E+10
2 1 ho 24 Abundance C 1.000000 ozen 0.0 1.00E+10
2 1 ho 25 Abundance Mn 1.000000 ozen 0.0 1.00E+10
2 1 ho 26 Abundance Fe 1.000000 ozen 0.0 1.00E+10
2 1 ho 27 Abundance Co 1.000000 ozen 0.0 1.00E+10
2 1 ho 28 Abundance Ni 1.000000 ozen 0.0 1.00E+10
2 1 ho 29 Abundance Cu 1.000000 ozen 0.0 1.00E+10
2 1 ho 30 Abundance Zn 1.000000 ozen 0.0 1.00E+10
2 1 ho ile File elec .dis ib.
2 2 pow no m No m (1E44 ph/s/keV) 1.000000 hawn 0.0 1.00E+20
2 2 pow gamm Pho on index 2.000000 hawn -10. 10.
2 2 pow dgam Pho on index b eak 0.000000 ozen -10. 10.
2 2 pow e0 B eak ene gy (keV) 1.0000000E+10 ozen 0.0 1.00E+20
2 2 pow b B eak s eng h 0.000000 ozen 0.0 10.
2 2 pow ype Type o no m 0.000000 ozen 0.0 1.0
2 2 pow elow Low lux limi (keV) 2.000000 ozen 1.00E-20 1.00E+10
2 2 pow eupp Upp lux limi (keV) 10.00000 ozen 1.00E-20 1.00E+10
2 2 pow lum Luminosi y (1E30 W) 2.5786482E-02 ozen 0.0 1.00E+20
Ins umen 1 egion 1 has no m 1.00000E+00 and is ozen
Ins umen 1 egion 2 has no m 1.00000E+00 and is ozen
--------------------------------------------------------------------------------
Fluxes and es ame luminosi ies be ween 2.0000 and 10.000 keV
sec comp mod pho on lux ene gy lux n o pho ons luminosi y
(pho /m**2/s) (W/m**2) (pho ons/s) (W)
1 2 pow 2.963082E-03 2.752802E-18 4.000000E+43 2.578606E+28
2 2 pow 2.963082E-03 2.752802E-18 4.000000E+43 2.578606E+28
--------------------------------------------------------------------------------
Fi me hod : Classical Le enbe g-Ma qua d
Fi s a is ic : C-s a is ic
C-s a is ic : 2929139.50
Expec ed C-s a : 64.11 +/- 16.31
Chi-squa ed alue : 158042.30
Deg ees o eedom: 0
W-s a is ic : 0.00
Ob iously, he ini ial model pa ame e s a e qui e a o . We also need o ix he ho model o a low empe a u e o
mimic neu al gas:
76 Chap e 2. Analysis h eads

SPEX Help Cen e Documen a ion, Release 3.08.02
2.7. Fi ing wo di e en spec a simul aneously 77
SPEX Help Cen e Documen a ion, Release 3.08.02
SPEX> pa 1 1 2E-4
SPEX> pa 2 1 2E-4
SPEX> pa 1 1 s a
SPEX> pa 2 1 s a
SPEX> pa 1 1 nh 1E-3
SPEX> pa 2 1 nh 1E-3
SPEX> pa 1 2 no m 1000
SPEX> pa 2 2 no m 1000
SPEX> calc
SPEX> plo
Now, he model spec um is much close o he bes solu ion, so we can a emp a i :
SPEX> i
which p o ides he ollowing bes i pa ame e s:
SPEX> pa show ee
--------------------------------------------------------------------------------------
˓→------------
sec comp mod ac o pa ame e wi h uni alue s a us minimum maximum␣
˓→lsec lcom lpa
1 1 ho nh X-Column (1E28/m**2) 2.1649615E-04 hawn 0.0 1.00E+20
1 2 pow no m No m (1E44 ph/s/keV) 2507.844 hawn 0.0 1.00E+20
(con inues on nex page)
78 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
1 2 pow gamm Pho on index 1.496156 hawn -10. 10.
2 1 ho nh X-Column (1E28/m**2) 1.5288954E-04 hawn 0.0 1.00E+20
2 2 pow no m No m (1E44 ph/s/keV) 1878.148 hawn 0.0 1.00E+20
2 2 pow gamm Pho on index 2.292902 hawn -10. 10.
Ins umen 1 egion 1 has no m 1.00000E+00 and is ozen
Ins umen 1 egion 2 has no m 1.00000E+00 and is ozen
--------------------------------------------------------------------------------
Fluxes and es ame luminosi ies be ween 2.0000 and 10.000 keV
sec comp mod pho on lux ene gy lux n o pho ons luminosi y
(pho /m**2/s) (W/m**2) (pho ons/s) (W)
1 2 pow 156.468 1.123012E-13 1.971041E+47 1.413442E+32
2 2 pow 41.1973 2.504328E-14 5.188680E+46 3.152038E+31
--------------------------------------------------------------------------------
Fi me hod : Classical Le enbe g-Ma qua d
Fi s a is ic : C-s a is ic
C-s a is ic : 1334.89
Expec ed C-s a : 1306.19 +/- 49.94
Chi-squa ed alue : 1240.11
Deg ees o eedom: 1272
W-s a is ic : 0.00
And plo :
This i al eady looks accep able, bu le ’s assume ha we wan o es i he oxygen abundance in he abso be is
consis en wi h sola . To do his, we can couple he oxygen abundances in he wo ho models o each o he :
SPEX> pa 2 1 08 couple 1 1 08
SPEX> pa 1 1 08 s
SPEX> i
SPEX> pa show ee
--------------------------------------------------------------------------------------
˓→------------
sec comp mod ac o pa ame e wi h uni alue s a us minimum maximum␣
˓→lsec lcom lpa
1 1 ho nh X-Column (1E28/m**2) 2.1453765E-04 hawn 0.0 1.00E+20
1 1 ho 08 Abundance O 1.083166 hawn 0.0 1.00E+10
1 2 pow no m No m (1E44 ph/s/keV) 2509.920 hawn 0.0 1.00E+20
1 2 pow gamm Pho on index 1.496786 hawn -10. 10.
2 1 ho nh X-Column (1E28/m**2) 1.5155401E-04 hawn 0.0 1.00E+20
2 1 ho 08 Abundance O 1.083166 ozen 0.0 1.00E+10 ␣
˓→1 1 08
2 2 pow no m No m (1E44 ph/s/keV) 1879.305 hawn 0.0 1.00E+20
(con inues on nex page)
2.7. Fi ing wo di e en spec a simul aneously 79
SPEX Help Cen e Documen a ion, Release 3.08.02
80 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
2 2 pow gamm Pho on index 2.293384 hawn -10. 10.
Ins umen 1 egion 1 has no m 1.00000E+00 and is ozen
Ins umen 1 egion 2 has no m 1.00000E+00 and is ozen
--------------------------------------------------------------------------------
Fluxes and es ame luminosi ies be ween 2.0000 and 10.000 keV
sec comp mod pho on lux ene gy lux n o pho ons luminosi y
(pho /m**2/s) (W/m**2) (pho ons/s) (W)
1 2 pow 156.456 1.122785E-13 1.970944E+47 1.413182E+32
2 2 pow 41.1969 2.504092E-14 5.188782E+46 3.151799E+31
--------------------------------------------------------------------------------
Fi me hod : Classical Le enbe g-Ma qua d
Fi s a is ic : C-s a is ic
C-s a is ic : 1334.81
Expec ed C-s a : 1306.19 +/- 49.94
Chi-squa ed alue : 1239.62
Deg ees o eedom: 1273
W-s a is ic : 0.00
The example abo e shows ha we can couple pa ame e s ac oss sec o s o each o he and i hem. Al hough his
may no be a ealis ic science case, i shows how i ing wo di e en spec a simul aneously can be done and how
pa ame e s o di e en models can be coupled o each o he .
By he way, he oxygen abundance in his example did no u n ou o be signi ican ly di e en om sola when
one calcula es he e o on oxygen:
SPEX> e o 1 1 08
pa ame e C-s a Del a Del a
alue alue pa ame e C-s a
----------------------------------------------------
0.838682 1335.33 -0.244484 0.52
0.594198 1336.85 -0.488968 2.03
0.838682 1335.33 -0.244484 0.52
0.761005 1335.70 -0.322161 0.89
0.739144 1335.82 -0.344022 1.01
0.741589 1335.81 -0.341577 0.99
1.32765 1335.17 0.244484 0.36
1.57213 1336.28 0.488968 1.46
1.41755 1335.50 0.334387 0.69
1.48019 1335.78 0.397026 0.97
1.48650 1335.82 0.403330 1.00
Pa ame e 1 1 08 : 1.0832 E o s: -0.34158 , 0.40333
2.7. Fi ing wo di e en spec a simul aneously 81

SPEX Help Cen e Documen a ion, Release 3.08.02
2.8 How o use he SPEX use model
Some use s would like o add hei own models o he SPEX p og am, simila o he local model op ion in Xspec.
Since he de elope s o SPEX do no ha e he man powe o implemen all possible models ou he e in a SPEX
a ie y, we ha e de ised a quick way o unning ex e nal models in SPEX.
SPEX con ains wo use models use (Use : Use de ined model (page 234)) and mus (Mus : Use de ined
mul iplica i e model (page 211)) o addi i e and mul iplica i e models espec i ely. These model componen s
communica e wi h he ex e nal model h ough an inpu and ou pu ile con aining he model pa ame e s, he ene gy
g id and he calcula ed spec um. By c ea ing a p og am ha eads in he inpu pa ame e s and ene gy g id,
calcula es he spec um, and w i es he esul o an ou pu ile in he igh o ma , use s ha e a e y lexible way o
using any model in SPEX.
Since his se up o e s many possibili ies, we can only show a ew examples o how hese use model componen s
can be used. We ha e p epa ed a helpe lib a y o Py hon and Fo an.
2.8.1 Py hon
The Py hon helpe lib a y o he use model is pa o he pyspex ools package. A gene al example o how o use
he Py hon in e ace o he use model can be ound he e.
As a mo e speci ic example we also p o ide a me hod o calcula e APEC models and impo hem o SPEX using
he Py hon in e ace.
2.8.2 Fo an
Using he Fo an module moduse , we lis a numbe o example use models below:
Use any Xspec model in SPEX
The mos gene al way o inco po a e Xspec models in SPEX is o call Xspec i sel di ec ly by a SPEX use
model execu able. He e we p o ide a o an+ cl example o use an Xspec buil -in comp model. The p og am
comp -xspec. 90 can be modi ied o calcula e di e en models.
I equi es he ollowing iles:
•Xspec as p o ided in HEASARC web si e.
•Module moduse . 90 om ou Gi hub si e.
•Example p og am comp -xspec. 90 as p o ided on ou Gi hub page.
Modi y he comm -xspec p og am (op ional)
The key pa o he model can be ound in line 18-21 o comp -xspec. 90. The e, he TCL sc ip se s up he
model in Xspec. I you need ano he model han comp , hen change he model name and modi y he numbe o
pa ame e s acco dingly!
82 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
Compile he execu able
The p og am can be compiled in a ew simple s eps:
linux:~/lmodel>g o an -g-c-o moduse .o moduse . 90
linux:~/lmodel>g o an -g-c-o comp -xspec.o comp -xspec. 90
linux:~/lmodel>g o an -g-o comp -xspec comp -xspec.o moduse .o
Use he Xspec model in SPEX
He e a e he SPEX commands o calcula e he Xspec- e sion comp model. I you a e using a di e en Xspec
model, please adap he numbe o pa ame e s o he numbe o pa ame e s in he Xspec model:
SPEX>com use
SPEX>pa 1exec a ./comp -xspec
SPEX>pa 1npa 6
# The numbe o pa ame e needed by he Xspec model
SPEX>pa 1p01 0
...
SPEX>calc
Use local Xspec model ismabs in SPEX
In his example, we include he Xspec local model called ismabs (Ga uzz e al., 2015) in o a SPEX use model
execu able. The local model consis s o a FITS ile wi h a omic da a, a ismabs. 90 Fo an ile, and a pa ame e
de ini ion ile called lmodel_ismabs.da whe e he pa ame e s o he model a e de ined. Since he local model
is w i en in Fo an 90, he easies way o use i in a SPEX use model is o w i e a Fo an 90 p og am ha will
be he in e ace be ween SPEX and he model.
In his case, we need he ollowing iles and lib a ies:
•The c i sio lib a y should be ins alled on he sys em.
•Module moduse . 90 om ou Gi hub si e.
•Example p og am loc-xspec. 90 as p o ided by ou Gi hub si e.
•The ismabs local model iles as p o ided on he XSPEC web si e.
W i e a small use p og am
The moduse . 90 ile is a lib a y wi h use callable unc ions o make i easy o w i e a use model. This ile does
no need any edi ing. The use should only edi he example p og am loc-xspec. 90 and some imes also he
local XSPEC model, which will be explained la e . The example p og am loc-xspec. 90 looks like his:
p og am locxspec
use moduse
implici none
in ege :: i
! Ge inpu and ou pu ilenames
call ge ilenames( in, ou ,ie )
! Read inpu ile
call eadp m( im( in))
(con inues on nex page)
2.8. How o use he SPEX use model 83
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
! Alloca e ou pu a ays
call allopa ()
! Call local XSPEC model
call ismabs(ipa %eg,ipa %neg,ipa %pa ,1,opa %sene )
! Do no use wene alues o now
do i=1,opa %neg
opa %wene (i)=0.0
enddo
! W i e esul o ou pu ile
call w i espc( ou )
! Clean up memo y
call deallpa ()
end p og am
Explana ion o he called ou ines
ge ilenames( in, ou ,ie ) is a ou ine o ead he ile names om he command line. The o ma o he iles and he
o de on he command line is de ined by he use model in SPEX. This ou ine e u ns he ile names he p og am
needs o ead he inpu pa ame e s and w i e he esul .
eadp m( im( in)) is he ou ine ha eads he inpu pa ame e s and he inpu ene gy g id. I alloca es and ills
he s uc u e ipa wi h he needed numbe s.
allopa () alloca es he memo y o he ou pu a ays based on he inpu ile.
ismabs(ipa %eg,ipa %neg,ipa %pa ,1,opa %sene ) is he ac ual call o he XSPEC local model. The pa am-
e e s om he ipa s uc u e con ain he inpu pa ame e s and he opa s uc u e con ains he ou pu spec um. Fo
o he local models han ismabs, simply change he name o he ou ine on his line.
w i espc( ou ) w i es he esul ing spec um o he ou pu ile.
deallpa () dealloca es all he alloca ed a iables om he moduse module.
Compile he execu able
In p inciple, he sou ce iles can now be compiled in o an execu able ha he SPEX use model can use. Make su e
you ha e all he necessa y iles in one di ec o y (see abo e) and execu e he ollowing commands in a e minal:
linux:~/lmodel>g o an -g-c-o moduse .o moduse . 90
linux:~/lmodel>g o an -g-c-o ismabs.o ismabs. 90
linux:~/lmodel>g o an -g-c-o loc-xspec.o loc-xspec. 90
linux:~/lmodel>g o an -g-o loc-xspec loc-xspec.o ismabs.o moduse .o
In he las s ep, i will be clea whe he he execu able has access o all he necessa y unc ions. In his case, he
ismabs model needs c i sio o ead he i s ile wi h a omic da a. I also needs a ew XSPEC in e nal unc ions o
ead he pa h o he FITS ile. The c i sio lib a y can be easily linked by adding -lc i sio o he las command in he
sequence abo e. Fo he in e nal Xspec calls, we need o adap ismabs. 90 sligh ly. The ew calls o he XSPEC
ou ines can be emo ed and wi h a sligh modi ica ion we can also make su e i inds he i s ile. This s ep needs
a li le p og amming expe ience o do i igh . Always keep a backup o he o iginal ou ine.
When you a e done, epea he ollowing commands o c ea e he execu able:
84 Chap e 2. Analysis h eads
SPEX Help Cen e Documen a ion, Release 3.08.02
linux:~/lmodel>g o an -g-c-o ismabs.o ismabs. 90
linux:~/lmodel>g o an -g-o loc-xspec loc-xspec.o ismabs.o
moduse .o-L/pa h/ o/c i sio -lc i sio
The ’-L/pa h/ o/c i sio’ is op ional. You may need o adap i in case he compile canno ind libc i sio.so in he
lib a y pa h. In his lag, you can speci y he co ec pa h o libc i sio.so.
Use he Xspec local model in SPEX
S a SPEX in a di ec o y whe e he loc-xspec execu able ha we jus made is loca ed. Since he ismabs model is
a mul iplica i e model, we need o load he mus componen . In he example below, we show how a powe -law
model is abso bed by ismabs in SPEX:
SPEX>com po
SPEX>com mus
SPEX>com el 1 2
# Link he new loc-xspec execu able o he mus componen
SPEX>pa 12exec a ./loc-xspec
# The numbe o pa ame e s is ound in ’local_ismabs.da ’, supplied by he Xspec model
SPEX>pa 12npa 31
The ile local_ismabs.da also desc ibes he pa ame e s and hei limi s in o de . I is ad isable o w i e a SPEX
command ile o se he pa ame e s and hei anges o hei de aul alues. The o de o he pa ame e s should be
he same in he mus model and in he local_ismabs.da ile. I he bookkeeping is igh , you should be able
o issue a calcula e command in SPEX and show he abso bed powe law in a plo .
2.9 SPEX solu ion o he ela i is ic disk e lec ion
By: Liyi Gu
He e wo se s o disk e lec ion se ups a e compa ed: XILLVER con ol ed wi h a SPEITH line p o ile, and RELX-
ILL.
2.9.1 Se up o xill e *spei
The able model based on he X- ay e lec ion code XILLVER can be inco po a ed in SPEX h ough a bl (A bl:
Addi i e able model (page 175)):
SPEX> com a bl
SPEX> pa 1 1 ile a /di ec o y/ o/xill e /xill e Cp_ 3.6. i s
SPEX> calc
The ela i is ic line p o ile can be ob ained by applying he con olu ion model SPEITH:
SPEX> com spei
SPEX> pa 1 2 i couple 1 1 incl
SPEX> com el 1 2
In his way, he inclina ion o he SPEI componen is coupled o ha o he XILLVER model, and he ela i is ic
ke nel SPEI has been applied o he XILLVER spec um.
2.9. SPEX solu ion o he ela i is ic disk e lec ion 85
SPEX Help Cen e Documen a ion, Release 3.08.02
Ou pu ypes
The possible ou pu ypes a e lis ed below. Depending on he speci ic spec al model, no all ypes a e allowed
o each spec al componen . The keywo d in on o each i em is he one ha should be used o he app op ia e
syn ax.
Mos op ions gi e ou pu as a able wi h se e al columns. They a e labeled he e below wi h T1 a e he keywo d.
A ew op ions p o ide only a lis o pa ame e s. They a e labeled below wi h T0 a e he keywo d.
Gene al
plas (T0):
basic plasma p ope ies like empe a u es, densi ies, sound speed, e c. (Ou pu able p ope ies (page ??))
abun (T1):
elemen al abundances and a e age cha ge pe elemen . (Ou pu able p ope ies (page ??))
Ionisa ion balance & a es, imescales
icon (T1):
ion concen a ions, bo h wi h espec o Hyd ogen and he ele an elemen al abundance. (Ou pu able
p ope ies (page ??))
ion (T1):
ioniza ion a es pe a omic subshell, speci ied acco ding o he di e en con ibu ing p ocesses. (Ou pu
able p ope ies (page ??))
a e (T1):
o al ioniza ion, ecombina ion and cha ge- ans e a es speci ied pe ion. (Ou pu able p ope ies
(page ??))
ime (T1):
ecombina ion ime scale pe ion acco ding o Bo o e al. (2000) de ini ion, and ela i e ion concen a ions.
No e ha he ecombina ion ime scale depends upon he hyd ogen densi y, so do no o ge o se he ele an
densi y in he model. (Ou pu able p ope ies (page ??))
Ene gy le el popula ions and p ocesses con ibu ing o i
pop (T1):
he occupa ion numbe s as well as upwa ds/downwa ds loss and gain a es o all quan um le els included.
(Ou pu able p ope ies (page ??))
le (T1):
he con ibu ions o he popula ion o he ene gy le els by a ious p ocesses: posi i e o gain, nega i e o
loss (Ou pu able p ope ies (page ??))
elex (T1):
he collisional exci a ion and de-exci a ion a es o each le el, due o collisions wi h elec ons. (Ou pu able
p ope ies (page ??))
p ex (T1):
he collisional exci a ion and de-exci a ion a es o each le el, due o collisions wi h p o ons. (Ou pu able
p ope ies (page ??))
ad (T1):
he adia i e ansi ion a es om each le el. (Ou pu able p ope ies (page ??))
wo (T1):
he wo-pho on emission ansi ion a es om each le el. (Ou pu able p ope ies (page ??))
92 Chap e 3. Command o e iew

SPEX Help Cen e Documen a ion, Release 3.08.02
ec (T1):
he popula ing con ibu ions om adia i e, dielec onic and cha ge exchange ecombina ion, as well as
inne -shell ionisa ion (Ou pu able p ope ies (page ??))
Emi ed spec um wi h con inuum and line emission con ibu ions
g id (T1):
he ene gy and wa eleng h g id used in he las e alua ion o he spec um. (Ou pu able p ope ies
(page ??))
con (T1):
he ee- ee, ee-bound, wo-pho on and o al con inuum spec um, o he las plasma laye o he model.
(Ou pu able p ope ies (page ??))
con (T1):
he ee- ee, ee-bound, wo-pho on and o al con inuum spec um, added o all plasma laye s o he model.
(Ou pu able p ope ies (page ??))
ccon (T1):
lis o he ions ha con ibu e o he ee- ee, ee-bound and wo-pho on con inuum emission, o he las
plasma laye o he model. (Ou pu able p ope ies (page ??))
cco (T1):
lis o he ions ha con ibu e o he ee- ee, ee-bound and wo-pho on con inuum emission, combined
o all plasma laye s o he model.
clin (T1):
he con inuum, line and o al spec um o each ene gy bin o he las plasma laye o he model. (Ou pu
able p ope ies (page ??))
cl (T1):
he con inuum, line and o al spec um o each ene gy bin added o all plasma laye s o he model. (Ou pu
able p ope ies (page ??))
line (T1):
emission line ene gies, luxes, iden i ica ions and a ious o he line p ope ies o each line con ibu ing o
he spec um, o he las plasma laye o he model. (Ou pu able p ope ies (page ??))
lin (T1):
emission line ene gies, luxes, iden i ica ions and a ious o he line p ope ies o each line con ibu ing o
he spec um, combined o all plasma laye s o he model. (Ou pu able p ope ies (page ??))
Abso bed spec um wi h con inuum and line con ibu ions
al (T1):
abso p ion line p ope ies (ene gies, equi alen wid hs, op ical dep hs, e c) a e lis ed o he ho , pion, slab,
xabs and wa m models. (Ou pu able p ope ies o he lines (page ??))
ac (T1):
abso p ion edge p ope ies (ene gies, equi alen wid hs. op ical dep hs, e c) a e lis ed o he ho , pion, slab,
xabs and wa m models. (Ou pu able p ope ies o he lines (page ??))
col (T1):
he ionic column densi ies o he ho , pion, slab, xabs and wa m models (Ou pu able p ope ies o he
lines (page ??))
wcol (T1):
simila o he col op ion, bu in addi ion he e ec i e ioniza ion pa ame e s and empe a u es o he wa m
model only.
wa m (T1):
he column densi ies and ionisa ion pa ame e s o he wa m model
3.1. Command syn ax 93
SPEX Help Cen e Documen a ion, Release 3.08.02
Ene gy balance o pho oionized plasmas only
hea (T0):
hea ing and cooling a es o a ious p ocesses (Ou pu able p ope ies (page ??))
ebal (T1):
he ene gy balance con ibu ions o each laye (only o pho oionized plasmas). (Ou pu able p ope ies
(page ??))
Non-equilib ium ionisa ion, supe no a emnan and clus e models
nei (T1):
he his o y o ionisa ion pa ame e and empe a u e in NEI calcula ions. (Ou pu able p ope ies (page ??))
sn (T0):
hyd odynamical and o he p ope ies o he supe no a emnan (only o supe no a emnan models such as
Sedo , Che alie e c.). (Ou pu able p ope ies (page ??))
clus (T1):
he hyd odynamical pa ame e s o he clus e as a unc ion o adius.
clup (T1):
p ojec ed adial p o ile (pho on and ene gy lux) wi hin speci ied ene gy bands, as a unc ion o p ojec ed
adius.
Di e en ial emission measu e models
dem (T1):
he emission measu e dis ibu ion ( o he pdem model) (Ou pu able p ope ies (page ??))
Ou pu de ices
The ollowing ou pu op ions a e cu en ly implemen ed:
e :
ou pu o he sc een o he e minal
ile:
ou pu o an ascii- ile; he ile name has o bep o ided by he use , wi hou ex ension (.asc will be appended)
i s:
ou pu o a ile in i s- o ma ; he ull ile name has o be p o ided by he use , including any ex ensions, i
desi ed.
Selec ion, so ing and o ma ing o he da a
The da a can be so ed acco ding o any column o he able, and he use can make selec ions o which da a o
display in he ou pu . Fu he , o ascii- ype o ou pu , mo e o ma ing op ions o he da a a e possible. The
in o ma ion on so ing, selec ion and o ma ing should be p o ided by he use , in an ascii- ile. The use hen
p o ides he name o his ascii- ile a e he “key” wo d in he command (see he syn ax below). No e ha his ile
mus be in he di ec o y whe e you un SPEX, o you should add he ele an pa h o he ile in he name ha you
p o ide o SPEX. The ile is ead each ime ha you issue he ou pu -op ion, so i you would like o in es iga e
mo e ou pu op ions o he same model, you can use sepa a e iles o each i em, e.g. a ile myplas.da o he
plasma ou pu , and myline.da o he emission line p ope ies.
The selec ion ile con ains a numbe o lines wi h on each line one and only one ins uc ion o he selec ion, so ing
and o ma ing. Each line has o s a wi h one o he wo ds sel,so o o o selec ion, so ing and o ma ing
espec i ely. The o de od hese lines is a bi a y. A e he i s keywo d he ac onym o he ele an column
should be gi en, ollowed, i ele an , by he nume ical ange. We speci y his in mo e de ail below:
94 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
sel: he use can make up o 10 selec ions simul aneously. A e he sel wo d, he ac onym o he ele an column
should be gi en, ollowed by wo numbe s: he minimum and maximum alue o he en y in his column ha
should be used o he selec ion; all en ies wi h column alues below his minimum and abo e his maximum
will be omi ed om he inal ou pu . I he use wan s only one alue, o example only a omic numbe 26, hen
simply use his numbe o bo h he minimum and maximum alue. See also he example below. Selec ion only
wo ks o columns wi h logical, in ege o eal numbe s; you canno make selec ion on ascii-columns, bu o
almos all ascii- ype columns, he e is an equi alen nume ical column ha can be used o selec ion.
so : he use can so on any column. Only one so ing ins uc ion is allowed. Like o he selec ion op ion, only
non-ascii columns can be used o so ing.
o : o ascii- ype o ou pu (bo h on he e minal and on an ascii- ile), he numbe o signi ican digi s o be
displayed can be changed by he use . In gene al he s anda d se ings a e ine, bu his op ion allows o show
mo e, less o no digi s a all. I is explained bes in he example below.
Example: We use he e he “line” ou pu op ion on he e minal o sec o 1, componen 1. We issue he ollowing
command o SPEX:
asc e 1 1 line key mysel.da
And he ile mysel.da (in he cu en wo king di ec o y) con ains he ollowing ex lines:
sel iz 26 26
sel jz 16 18
sel ene 0.5 2.0
so wa
o lux 1
o wa e 15
o ion 0
Wha you will see hen on you sc een is he ollowing:
•only lines wi h a omic numbe 26 ( he ac onym o ha is “iz”)
•only lines wi h ionis ion s age be ween 16-18 (i.e., Fe XVI o Fe XVIII)
•only lines wi h ene gy be ween 0.5 and 2.0 keV
• he lines a e so ed acco ding o hei ene gy lux (as con ained in he column labeled “wa ”)
• he column lux is displayed wi h only 1 signi ican digi behind he pe iod, i.e. you ge a numbe like
2.3E+32, a he han he de aul o his column o 2.349E+32
• he column wi h he wa eleng h (ac onym “wa e”) will display wi h 15 signi can digi s, a he han he
de aul 6 digi s o his column.
• he column wi h ac onym “ion” ep esen ing he ion numbe will no be displayed a all (wid h 0).
See he ele an subsec ion o Ou pu ypes (page 92) o he column ac onyms o be used in he ile o he selec ion,
so ing and o ma ing o he da a.
3.1. Command syn ax 95
SPEX Help Cen e Documen a ion, Release 3.08.02
Syn ax
The ollowing syn ax ules apply o ascii ou pu :
ascdump e minal #i1 #i2 #a : Dump he ou pu o sky sec o #i1 and componen #i2 o he e minal
sc een; he ype o ou pu is desc ibed by he pa ame e #a which is lis ed in he able abo e.
ascdump e minal #i1 #i2 #a1 key #a2 : As abo e, bu a gumen #a2 ha ollows he manda o y wo d
“key” is he name o a he ile se ing he so ing, selec ion and o ma ing o he columns
ascdump ile #a1 #i1 #i2 #a2 : As abo e, bu ou pu w i en o an ascii ile wi h i s name gi en by he
pa ame e #a1. The su ix “.asc” will be appended au oma ically o his ilename.
ascdump ile #a1 #i1 #i2 #a2 key #a3 : As abo e, bu a gumen #a3 ha ollows he manda o y wo d
“key” is he name o a he ile se ing he so ing, selec ion and o ma ing o he columns
ascdump i s #a1 #i1 #i2 #a2 : As abo e, bu ou pu w i en o a i s- o ma ile wi h i s name gi en by he
pa ame e #a1. Con a y o he ile op ion, no su ix is appended o his ilename.
ascdump i s #a1 #i1 #i2 #a2 key #a3 : As abo e, bu a gumen #a3 ha ollows he manda o y wo d
“key” is he name o a he ile se ing he so ing, selec ion and o ma ing o he columns
Wa ning: Any exis ing iles wi h he same name will be o e w i en.
Examples
ascdump e minal 3 2 icon : dumps he ion concen a ions o componen 2 o sky sec o 3 o he e minal
sc een.
ascdump ile mydump 3 2 icon : dumps he ion concen a ions o componen 2 o sky sec o 3 o an
ascii- ile named mydump.asc.
ascdump i s mydump. i s 3 2 icon : dumps he ion concen a ions o componen 2 o sky sec o 3 o a
i s- ile named mydump. i s.
ascdump e minal 3 2 line key mysel.sel : dumps he emission line p ope ies o componen 2 o sky
sec o 3 o he e minal sc een, using selec ions, so ing and o ma ing op ions as desc ibed in he ile mysel.sel
3.1.4 Ascdump ou pu able p ope ies
This sec ion con ains he ou pu able p ope ies o he a ious ascdump commands.
96 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Plas
Table 3: Ou pu o op ion: plas
Type Digi s Ac onym Desc ip ion Uni s
D 6 e Elec on empe a u e keV
D 6 ion Ion empe a u e keV
D 6 iba kT (ionisa ion balance) keV
D 6 mic 𝑏=√2𝜎𝑣km/s
D 6 cs Sound speed km/s
D 6 eden Elec on densi y /m**3
D 6 hden Hyd ogen densi y /m**3
D 6 eide Elec on+Ion densi y /m**3
D 6 ho Mass densi y kg/m**3
D 6 ed Elec on/Hyd ogen densi y
D 6 eid (Elec on+Ion)/Hyd ogen densi y
D 6 denm Mass densi y / (n𝐻*m𝑝)
D 6 epla Plasma equency ene gy keV
Abun
Table 4: Ou pu o op ion: abun
Type Digi s Ac onym Desc ip ion Uni s
I 2 iz Z nuclea cha ge
A 2 elem Elemen name
D 4 abus Abundance Sola
D 4 abua Abundance Absolu e
D 4 cha A e age cha ge
Icon
Table 5: Ou pu o op ion: icon
Type Digi s Ac onym Desc ip ion Uni s
I 2 iz Z nuclea cha ge
I 2 jz Ionisa ion s age
A 2 elem Elemen name
A 6 s ag Ionisa ion s age
I 2 ii ii Iso-elec onic sequence
I 3 ion Ion numbe
D 4 c el Concen a ion ( ela i e)
D 4 cabs Concen a ion (absolu e)
3.1. Command syn ax 97

SPEX Help Cen e Documen a ion, Release 3.08.02
Rion
Table 6: Ou pu o op ion: ion
Type Digi s Ac onym Desc ip ion Uni s
I 2 iz Z nuclea cha ge
I 2 jz Ionisa ion s age
I 2 is Shell numbe wi hin ion
I 2 ii ii Iso-elec onic sequence
I 3 ion Ion numbe
I 4 ind Shell numbe
A 2 elem Elemen name
A 6 s ag Ionisa ion s age
A 5 shel Shell name
D 4 pion Pho o-ionisa ion /s/ion
D 4 cion Comp on-ionisa ion /s/ion
D 4 eion Elec on impac ionisa ion /s/ion
D 4 phea Pho o ionisa ion hea ing W/ion
D 4 chea Comp on ionisa ion hea ing W/ion
D 4 ecoo Elec on impac ionisa ion cooling W/ion
Ra e
Table 7: Ou pu o op ion: a e
Type Digi s Ac onym Desc ip ion Uni s
I 2 iz Z nuclea cha ge
I 2 jz Ionisa ion s age
I 2 ii ii Iso-elec onic sequence
I 3 ion Ion numbe
A 2 elem Elemen name
A 6 s ag Ionisa ion s age
D 4 ion To al ionisa ion a e /s/ion
D 4 ec To al Recombina ion a e /s/ion
D 4 cxi CX ionisa ion a e /s/ion
D 4 cx CX ecombina ion a e /s/ion
Time
Table 8: Ou pu o op ion: ime
Type Digi s Ac onym Desc ip ion Uni s
I 2 iz Z nuclea cha ge
I 2 jz Ionisa ion s age
I 2 ii ii Iso-elec onic se-
quence
I 3 ion Ion numbe
A 2 elem Elemen name
A 6 s ag Ionisa ion s age
D 4 ec Recombina ion
ime (s)
D 4 c el Concen a ion ( ela i e)
98 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Pop
Table 9: Ou pu o op ion: pop
Type Digi s Ac onym Desc ip ion Uni s
I 2 iz Z nuclea cha ge
I 2 jz Ionisa ion s age
A 2 elem Elemen name
A 6 s ag Ionisa ion s age
I 2 ii ii Iso-elec onic sequence
I 3 ion Ion numbe
I 5 il le el numbe
A 32 le Con igu a ion and e m
D 8 ene Ene gy keV
D 6 occ Popula ion
D 4 occ Popula ion / LTE popula ion
D 4 gcas Gain Cascades om abo e (/s)
D 3 gexc Gain Exci a ion om below (/s)
D 3 ldow Loss Downwa ds (/s)
D 3 lupp Loss Upwa ds (/s)
D 3 a Gain om Radia i e ecombina ion (/s)
D 3 ad Gain om Dielec onic ecombin. (/s)
D 3 aii Gain om Inne -shell ionisa ion (/s)
D 3 acx Gain om Cha ge Exchange (CX) (/s)
Le
Table 10: Ou pu o op ion: le
Type Digi s Ac onym Desc ip ion Uni s
I 2 iz Z nuclea cha ge
I 2 jz Ionisa ion s age
I 2 ii ii Iso-elec onic sequence
I 3 ion Ion numbe
A 2 elem Elemen name
A 6 s ag Ionisa ion s age
I 5 il lowe le el
I 5 iu uppe le el
D 8 elow Lowe le el ene gy keV
D 8 eupp Uppe le el ene gy keV
D 8 de Ene gy di e ence keV
D 6 eex Elec on exci a ion (/s)
D 6 edex Elec on de-exci a ion (/s)
D 6 pex P o on exci a ion (/s)
D 6 pdex P o on de-exci a ion (/s)
D 6 dec Radia i e decay (/s)
D 6 2p Two pho on emission (/s)
D 6 abs Radia i e abso p ion (/s)
D 6 ec Radia i e ecombina ion (/s)
D 6 d ec Dielec onic ecombina ion (/s)
D 6 luo Fluo escence (/s)
D 6 cx Cha ge exchange (/s)
D 6 sum To al (/s)
A 32 lle Lowe con igu a ion + e m
A 32 ule Uppe con igu a ion + e m
3.1. Command syn ax 99
SPEX Help Cen e Documen a ion, Release 3.08.02
Elex
Table 11: Ou pu o op ion: elex
Type Digi s Ac onym Desc ip ion Uni s
I 2 iz Z nuclea cha ge
I 2 jz Ionisa ion s age
I 2 ii ii Iso-elec onic sequence
I 3 ion Ion numbe
A 2 elem Elemen name
A 6 s ag Ionisa ion s age
I 5 il lowe le el
I 5 iu uppe le el
A 65 an T ansi ion
D 6 eexc Exci a ion Ene gy keV
D 4 ups Upsilon
D 4 gba gba
D 4 exc Exci a ion a e /s/ion
D 4 dex Deexci a ion a e /s/ion
P ex
Table 12: Ou pu o op ion: p ex
Type Digi s Ac onym Desc ip ion Uni s
I 2 iz Z nuclea cha ge
I 2 jz Ionisa ion s age
I 2 ii ii Iso-elec onic sequence
I 3 ion Ion numbe
A 2 elem Elemen name
A 6 s ag Ionisa ion s age
I 5 il lowe le el
I 5 iu uppe le el
A 65 an T ansi ion
D 6 eexc Exci a ion Ene gy keV
D 4 ups Upsilon
D 4 gba gba
D 4 exc Exci a ion a e /s/ion
D 4 dex Deexci a ion a e /s/ion
100 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Rad
Table 13: Ou pu o op ion: ad
Type Digi s Ac onym Desc ip ion Uni s
I 2 iz Z nuclea cha ge
I 2 jz Ionisa ion s age
A 2 elem Elemen name
A 6 s ag Ionisa ion s age
I 2 ii ii Iso-elec onic sequence
I 3 ion Ion numbe
I 5 il lowe le el
I 5 iu uppe le el
A 65 an T ansi ion
D 6 ene Ene gy keV
D 6 wa Wa eleng h Ang
D 4 osc Oscilla o s eng h
D 4 a T ansi ion p obabili y /s
D 4 a ad To al adia i e loss p obabili y /s
D 6 a o To al decay p obabili y /s
D 4 b B anching a io
Two
Table 14: Ou pu o op ion: wo
Type Digi s Ac onym Desc ip ion Uni s
I 2 iz Z nuclea cha ge
I 2 jz Ionisa ion s age
A 2 elem Elemen name
A 6 s ag Ionisa ion s age
I 2 ii ii Iso-elec onic sequence
I 3 ion Ion numbe
I 5 il lowe le el
I 5 iu uppe le el
A 65 an T ansi ion
D 6 ene Ene gy keV
D 6 wa Wa eleng h Ang
D 4 osc Oscilla o s eng h
D 4 a T ansi ion p obabili y /s
D 4 a ad To al adia i e loss p obabili y /s
D 6 a o To al decay p obabili y /s
D 4 b B anching a io
3.1. Command syn ax 101
SPEX Help Cen e Documen a ion, Release 3.08.02
Ebal
Table 28: Ou pu o op ion: ebal
Type Digi s Ac onym Desc ip ion Uni s
I 4 s ep S ep
I 3 i i
I 3 i cx CX i e
D 3 hden H densi y /m**3
D 3 eden el densi y /m**3
D 3 nenh n
D 3 e kT elec on keV
D 3 del Del a
D 3 hea To al hea ing W/m**3
D 3 cool To al cooling W/m**3
D 15 hcom Hea ing Comp on sca e ing W/m**3
D 15 h Hea ing ee- ee abso p ion W/m**3
D 15 hphe Hea ing pho o-elec ons W/m**3
D 15 hci Hea ing Comp on ionisa ion W/m**3
D 15 haug Hea ing Auge elec ons W/m**3
D 15 hcol Hea ing collis. de-exci a ion W/m**3
D 15 hex Hea ing ex e nal sou ce W/m**3
D 15 ccom Cooling in e se Comp on sca e . W/m**3
D 15 ccoi Cooling elec on ionisa ion W/m**3
D 15 c ec Cooling adia i e ecombina ion W/m**3
D 15 c e Cooling ee- ee emission W/m**3
D 15 ccol Cooling collisional exci a ion W/m**3
D 15 cd Cooling dielec onic ecombin. W/m**3
D 15 cadi Cooling adiaba ic expansion W/m**3
Nei
Table 29: Ou pu o op ion: nei
Type Digi s Ac onym Desc ip ion Uni s
D 4 uhis U = in eg al (ne ) s/m**3
D 4 his kT keV
Sn
Table 30: Ou pu o op ion: sn
Type Digi s Ac onym Desc ip ion Uni s
D 6 age Age yea
D 6 s Shock adius pc
D 6 nh ISM Hyd ogen densi y cm**-3
D 6 eexp Explosion ene gy 1E43 J
D 6 mesh Shocked ejec ed mass Sola uni s
D 6 mesw swep -up ISM mass Sola uni s
D 6 s ISM densi y g adien s
D 6 n ejec a densi y g adien n
D 6 al a Hamil ons alpha pa ame e
D 6 nu Hamil ons nu pa ame e
con inues on nex page
108 Chap e 3. Command o e iew

SPEX Help Cen e Documen a ion, Release 3.08.02
Table 30 – con inued om p e ious page
Type Digi s Ac onym Desc ip ion Uni s
D 6 s Shock empe a u e keV
D 6 ej A . emp. shocked ejec a keV
D 6 ism A . emp. shocked ISM keV
D 6 u Ionisa ion pa ame e 1E20 s/m**3
D 6 uej A . ionis. shocked ejec a 1E20 s/m**3
D 6 uism A . ionis. shocked ISM 1E20 s/m**3
D 6 yej Em. measu e shocked ejec a 1E64 /m**3
D 6 yism Em. measu e shocked ISM 1E64 /m**3
D 6 ej A . adius shocked ejec a pc
D 6 ism A . adius shocked ISM pc
D 6 aej A . plasma age shocked ejec a yea
D 6 aism A . plasma age shocked ISM yea
D 6 ej A . gas eloci y shocked ejec a km/s
D 6 ism A . gas eloci y shocked ISM km/s
D 6 s Shock eloci y km/s
D 6 s Re e se shock adius pc
D 6 cd Con ac discon inui y adius pc
D 6 cmax Maximum dis ance clumps pc
D 6 nenh Ra io elec on/Hyd ogen densi y
D 6 dis Dis ance kpc
Clus
Table 31: Ou pu o op ion: clus
Type Digi s Ac onym Desc ip ion Uni s
I 3 i Bin numbe
D 6 1 Lowe adius m
D 6 2 Uppe adius m
D 6 d Bin wid h m
D 6 w Mean adius m
D 6 hw Densi y Hyd ogen p o ile /m**3
D 6 w Tempe a u e p o ile keV
D 6 pw P essu e p o ile Pa
D 6 yw Emission measu e p o ile /m**3
D 6 sw Tu bulen eloci y p o ile km/s
D 6 zw Ou low eloci y p o ile km/s
D 6 abu Rela i e abundance
3.1. Command syn ax 109
SPEX Help Cen e Documen a ion, Release 3.08.02
Clup
Table 32: Ou pu o op ion: clup
Type Digi s Ac onym Desc ip ion Uni s
I 8 i P ojec ed bin numbe
D 6 1 Lowe adius m
D 6 2 Uppe adius m
D 6 d Bin wid h m
D 6 w Mean adius m
D 6 sp o Radial pho on lux p o ile ph/m**2/s
D 6 pp o Powe p o ile W/m**2
D 6 scum Cumula i e Radial p o ile ph/s
D 6 pcum Cumula i e Powe p o ile W
Dem
Table 33: Ou pu o op ion: dem
Type Digi s Ac onym Desc ip ion Uni s
D 4 Tempe a u e keV
D 4 y Em. measu e 1E64 m**-3
3.1.5 Bin: ebin he spec um
O e iew
This command ebins he da a ( hus bo h he spec um ile and he esponse ile) in a manne as desc ibed in Sec ion
Da a: ead esponse ile and spec um (page 113). The ange o be ebinned can be speci ied ei he as a channel
ange (no uni s equi ed) o in ei he any o he ollowing uni s: keV, eV, Rydbe g, Joule, He z, Å, nanome e , wi h
he ollowing abb e ia ions: ke , e , yd, j, hz, ang, nm.
No e: Usually, he igno e command and he bin command a e used a ound he same ime. The sa es o de is o
igno e pa s o he spec um i s and hen e-bin i . I he bin command is done i s and hen pa s o he spec um
a e igno ed using a di e en ene gy ange, hen bins a he edges o he ene gy ange could end up being educed
in wid h.
Syn ax
The ollowing syn ax ules apply:
bin # #i : This is he simples syn ax allowed. One needs o gi e he ange, # , o e a leas he inpu da a
channels one wan s o ebin. I one wan s o ebin he whole inpu ile he ange mus be a leas he whole ange
o e da a channels (bu a g ea e numbe is also allowed). #i is hen he ac o by which he da a will be ebinned.
bin [ins umen #i1] [ egion #i2] # #i : He e one can also speci y he ins umen and egion o be
used in he binning. This syn ax is necessa y i mul iple ins umen s o egions a e used in he da a inpu .
bin [ins umen #i1] [ egion #i2] # #i [uni #a] : In addi ion o he abo e he e one can also
speci y he uni s in which he binning ange is gi en. The uni s can be eV, Å, o any o he o he uni s speci ied
abo e.
110 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Examples
bin 1:10000 10 : Rebins he inpu da a channel 1:10000 by a ac o o 10.
bin ins umen 1 1:10000 10 : Rebins he da a om he i s ins umen as abo e.
bin 1:40 10 uni a : Rebins he inpu da a be ween 1 and 40 Å by a ac o o 10.
3.1.6 Calcula e: e alua e he spec um
O e iew
This command e alua es he cu en model spec um. When one o mo e ins umen s a e p esen , i also calcula es
he model olded h ough he ins umen . Whene e he use has modi ied he model o i s pa ame e s manually,
and wan s o plo he spec um o display model pa ame e s like he lux in a gi en ene gy band, his command
should be execu ed i s (o he wise he spec um is no upda ed). On he o he hand, i a spec al i is done (by
yping he i command) he spec um will be upda ed au oma ically and he calcula e command needs no o be
gi en.
Syn ax
The ollowing syn ax ules apply:
calc : E alua es he spec al model.
Examples
calc : E alua es he spec al model.
3.1.7 Comp: c ea e, dele e and ela e spec al componen s
O e iew
In i ing o e alua ing a spec um, one needs o build up a model made ou o a leas 1 componen . This se o
commands can c ea e a new componen in he model, as well as dele e any componen . Usually we dis inguish wo
ypes o spec al componen s in SPEX.
The addi i e componen s co espond o emission componen s, such as a powe law, a Gaussian emission line, a
collisional ioniza ion equilib ium (CIE) componen , e c.
The second class (dubbed he e mul iplica i e componen s o ease) consis s o ope a ions o be applied o he
addi i e componen s. Examples a e uly mul iplica i e ope a ions, such as he Galac ic abso p ion, whe e he
model spec um o any addi i e componen should be mul iplied by he ansmission o he abso bing in e s ella
medium, wa m abso be s e c. O he ope a ions con ained in his class a e edshi s, con olu ions wi h ce ain
eloci y p o iles, e c.
The use needs o de ine in SPEX which mul iplica i e componen should be applied o which addi i e componen s,
and in which o de . The o de is impo an as ope a ions a e no always communa i e. This se ing is also done
wi h his componen command.
I mul iple sec o s a e p esen in he spec al model o esponse ma ix (see Sec ion Sec o s and egions (page ??))
hen one has o speci y he spec al componen s and hei ela ion o each sec o . The possible componen s o he
model a e lis ed and desc ibed in Sec ion Spec al models (page ??).
No e ha he o de ha you de ine he componen s is no impo an . Howe e , o each sec o , he componen s a e
numbe ed s a ing om 1, and hese numbe s should be used when ela ing he mul iplica i e componen s o he
addi i e componen s.
3.1. Command syn ax 111
SPEX Help Cen e Documen a ion, Release 3.08.02
I you wan o see he model componen s and he way hey a e ela ed, ype “model show”.
Wa ning: I in any o he commands as lis ed abo e you omi he sec o numbe o sec o numbe ange, he
ope a ion will be done o all sec o s ha a e p esen . Fo example, ha ing 3 sec o s, he “comp pow” command
will de ine a powe law componen o each o he h ee sec o s. I you only wan o de ine/dele e/ ela e he
componen o one sec o , you should speci y he sec o numbe (s). In he e y common case ha you ha e
only one sec o you can always omi he sec o numbe s.
Wa ning: A e dele ing a componen , all componen s a e e-numbe ed! So i you ha e componen s 1,2,3 o
example as pow, cie, gaus, and you ype “comp del 2”, you a e le wi h 1=pow, 2=gaus.
Syn ax
The ollowing syn ax ules apply:
comp [#i:] #a : C ea es a componen #a as pa o he model o he (op ional) sec o ange #i:
comp dele e [#i1:] #i2: : Dele es he componen s wi h numbe om ange #i2: o sec o ange
(op ional) #i1. See also he wa ning abo e
comp ela ion [#i1:] #i2: #i3,...,#in : Apply mul iplica i e componen s #i3, ..., #in (numbe s) in
his o de , o he addi i e componen s gi en in he ange #i2: o sec o s in he ange #i1 (op ional). No e ha he
mul iplica i e componen s mus be sepa a ed by a “,”
Examples
comp pow : C ea es a powe -law componen o modeling he spec um o all sec o s ha a e p esen .
comp 2 pow : Same as abo e, bu now he componen is c ea ed o sec o 2.
comp 4:6 pow : C ea e he powe law o sec o s 4, 5 and 6
com abs : C ea es a Mo ison & McCammon abso p ion componen .
comp dele e 2 : Dele es he second c ea ed componen . Fo example, i you ha e 1 = pow, 2 = cie and 3 =
gaus, his command dele s he cie componen and enumbe s 1 = pow, 2 = gaus
comp del 1:2 : In he example abo e, his will dele e he pow and cie componen s and enumbe s now 1 = gaus
comp del 4:6 2 : I he abo e h ee componen model (pow, cie, gaus) would be de ined o 8 sec o s
(numbe ed 1–8), hen his command dele es he cie componen (n . 2) o sec o s 4–6 only.
comp el 1 2 : Apply componen 2 o componen 1. Fo example, i you ha e de ined be o e wi h “comp pow”
and “comp “abs” a powe law and galac ic abso p ion, he his command ells you o apply componen 2 (abs) o
componen 1 (pow).
comp el 1 5,3,4 : Taking componen 1 a powe law (pow), componen 3 a edshi ope a ion ( eds),
componen 4 galac ic abso p ion (abs) and componen 5 a wa m abso be (wa m), his command has he e ec
ha he powe law spec um is mul iplied i s by he ansmission o he wa m abso be (5=wa m), hen
edshi ed (3= eds) and inally mul iplied by he ansmission o ou galaxy (4=abs). No e ha he o de is always
om he sou ce o he obse e !
comp el 1:2 5,3,4 : Taking componen 1 a powe law (pow), componen 2 a gaussian line (gaus), and 3–5 as
abo e, his model applies mul iplica i e componen s 5, 3 and 4 (in ha o e ) o he emission spec a o bo h
componen 1 (pow) and 2 (cie).
comp el 7:8 1:2 5,3,4 : As abo e, bu only o sec o s 7 and 8 (i hose a e de ined).
comp el 3 0 : Remo e all ela ions om componen 3.
112 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
3.1.8 Da a: ead esponse ile and spec um
O e iew
In o de o i an obse ed spec um, SPEX needs a spec al da a ile and a esponse ma ix. These da a a e s o ed
in FITS o ma , ailo ed o SPEX (see sec ion Response o ma s (page ??)). The da a iles need no necessa ily be
loca ed in he same di ec o y, one can also gi e a pa hname plus ilename in his command.
Wa ning: Filenames should be en e ed in he da a command wi hou hei ex ension. Fo he iles esponse. es
and spec um.spo, he da a command would look like: da a esponse spec um.
Syn ax
The ollowing syn ax ules apply:
da a #a1 #a2 : Read esponse ma ix #a1 and spec um #a2
da a dele e ins umen #i : Remo e ins umen #i om he da a se
da a me ge sum #i: : Me ge ins umen s in ange #i: o a single spec um and esponse ma ix, by adding he
da a and ma ices
da a me ge a e #i: : Me ge ins umen s in ange #i: o a single spec um and esponse ma ix, by
a e aging he da a and ma ices
da a sa e #i #a [o e w i e] : Sa e da a #a om ins umen #i wi h he op ion o o e w i e he exis en
ile. SPEX au oma ically ags he .spo ex ension o he gi en ile name. No esponse ile is sa ed.
da a show : Shows he da a inpu gi en, as well as he coun ( a es) o sou ce and backg ound, he ene gy ange
o which he e is da a he esponse g oups and da a channels. Also he in eg a ion ime and he s anda d plo ing
op ions a e gi en.
Examples
da a mos esp mosspec : ead a spec al esponse ile named mos esp. es and he co esponding spec al ile
mosspec.spo. Hin , al hough 2 di e en names a e used he e o ease o unde s anding, i is eased i he spec um
and esponse ile ha e he same name, wi h he app op ia e ex ension.
da a dele e ins umen 1 : dele e he i s ins umen
da a me ge a e 3:5 : me ge ins umen s 3–5 in o a single new ins umen 3 ( eplacing he old ins umen 3),
by a e aging he spec a. Spec a 3–5 could be spec a aken wi h he same ins umen a di e en epochs.
da a me ge sum 1:2 : add spec a o ins umen s 1–2 in o a single new ins umen 1 ( eplacing he old
ins umen 1), by adding he spec a. Use ul o example in combining XMM-New on MOS1 and MOS2 spec a.
da a sa e 1 myda a : Sa es he da a om ins umen 1 in he wo king di ec o y unde he ilename o
myda a.spo
da a /mydi /da a/mos esp /mydi /da a/mosspec : ead he spec um and esponse om he di ec o y
/mydi /da a/
3.1.9 DEM: di e en ial emission measu e analysis
O e iew
SPEX o e s he oppo uni y o do a di e en ial emission measu e analysis. This is an e ec i e way o model mul i-
empe a u e plasmas in he case o con inuous empe a u e dis ibu ions o a la ge numbe o disc e e empe a u e
componen s.
The spec al model can only ha e one addi i e componen : he DEM componen ha co esponds o a mul i-
empe a u e s uc u e. The e a e no es ic ions o he numbe o mul iplica i e componen s. Fo a desc ip ion o
3.1. Command syn ax 113

SPEX Help Cen e Documen a ion, Release 3.08.02
he DEM analysis me hod see documen SRON/SPEX/TRPB05 (in he documen a ion o e sion 1.0 o SPEX),
Mewe e al. (1994),Mewe e al. (1995) and Kaas a e al. (1996).
SPEX has 5 di e en dem analysis me hods implemen ed, as lis ed sho ly below. We e e o he abo e pape s o
mo e de ails.
1. eg – Regula iza ion me hod (minimizes second o de de i a i e o he DEM; ad an age: p oduces e o
ba s; disad an age: needs ine- uning wi h a egula iza ion pa ame e and can p oduce nega i e emission
measu es.
2. clean – Clean me hod: uses he clean me hod ha is widely used in adio as onomy. Use ul o “spiky
emission measu e dis ibu ions.
3. poly – Polynomial me hod: app oxima es he DEM by a polynomial in he log 𝑇−log 𝑌plane, whe e 𝑌is
he emission measu e. Wo ks well i he DEM is smoo h.
4. mul – Mul i- empe a u e me hod: ies o i he DEM o he sum o Gaussian componen s as a unc ion o
log 𝑇. Good o disc e e and sligh ly b oadened componen s, bu may no always con e ge.
5. gene – Gene ic algo i hm: using a gene ic algo i hm y o ind he bes solu ion. Ad an age: a he obus
o a oiding local subminima.Disad an age: may equi e a lo o cpu ime, and each un p oduces sligh ly
di e en esul s (due o andomiza ion).
In p ac ice o use he DEM me hods he use should do he ollowing s eps:
1. Read and p epa e he spec al da a ha should be analysed
2. De ine he dem model wi h he “comp dem” command
3. De ine any mul iplica i e models (abso p ion, edshi s, e c.) ha should be applied o he addi i e model
4. De ine he pa ame e s o he dem model: numbe o empe a u e bins, empe a u e ange, abundances e c.
5. Gi e he “dem lib” command o c ea e a lib a y o iso he mal spec a.
6. Do he dem me hod o choice (each one o he i e me hods ou lined abo e)
7. Fo di e en abundances o pa ame e s o any o he spec al componen s, i s he “dem lib” command mus
be e-issued!
Syn ax
The ollowing syn ax ules apply:
dem lib : C ea e he basic DEM lib a y o iso he mal spec a
dem eg au o : Do DEM analysis using he egula iza ion me hod, using an au oma ic sea ch o he op imum
egula iza ion pa ame e . I de e mines he egula isa ion pa ame e 𝑅in such a way ha
𝜒2(𝑅) = 𝜒2(0)[1 + 𝑠√︀2/(𝑛−𝑛T]whe e he scaling ac o 𝑠= 1,𝑛is he numbe o spec al bins in he da a
se and 𝑛Tis he numbe o empe a u e componen s in he DEM lib a y.
dem eg au o # : As abo e, bu o he scaling ac o 𝑠se o # .
dem eg # : Do DEM analysis using he egula iza ion me hod, using a ixed egula iza ion pa ame e 𝑅=# .
dem chi eg # 1:# 2 #i : Do a g id sea ch o e he egula iza ion pa ame e 𝑅, wi h #i s eps and 𝑅
dis ibu ed loga i hmically be ween # 1 and # 2. Use ul o scan he 𝜒2(𝑅)cu e whene e i is complica ed and
o see how much “penal y’ (nega i e DEM alues) he e a e o each alue o 𝑅.
dem clean : Do DEM analysis using he clean me hod
dem poly #i : Do DEM analysis using he polynomial me hod, whe e #i is he deg ee o he polynomial
dem mul #i : Do DEM analysis using he mul i- empe a u e me hod, whe e #i is he numbe o b oad
componen s
dem gene #i1 #i2 : Do DEM analysis using he gene ic algo i hm, using a popula ion size gi en by #i1
(maximum alue 1024) and #i2 is he numbe o gene a ions (no limi , in p ac ice a e ∼100 gene a ions no
much change in he solu ion. Expe imen wi h hese numbe s o you p ac ical case.
114 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
dem ead #a : Read a DEM dis ibu ion om a ile named #a which au oma ically ge s he ex ension “.dem”. I
is an ascii ile wi h a leas wo columns, he i s column is he empe a u e in keV and he second column he
di e en ial emission measu e, in uni s o 1064 m:ma h:^{-3} keV:ma h:^{-1}. The maximum numbe o da a
poin s in his ile is 8192. Tempe a u e should be in inc easing o de . The da a will be in e pola ed o ma ch he
empe a u e g id de ined in he dem model (which is se by he use ).
dem sa e #a : Sa e he DEM o a ile #a wi h ex ension “.dem”. The same o ma as abo e is used o he ile.
A hi d column has he co esponding e o ba s on he DEM as de e mined by he DEM me hod used (no
always ele an o well de ined, exep o he egula iza ion me hod).
dem smoo h # : Smoo hes a DEM p e iously de e mined by any DEM me hod using a block il e / He e # is
he ull wid h o he il e exp essed in 10 log 𝑇. No e ha his smoo hing will in p inciple wo sen he 𝜒2o he
solu ion, bu i is some imes use ul o “wash ou ” some esidual noise in he DEM dis ibu ion, p ese ing o al
emission measu e.
Examples
dem lib : c ea e he DEM lib a y
dem eg au o : use he au oma ic egula iza ion me hod
dem eg 10. : use a egula iza ion pa ame e o 𝑅= 10 in he egula iza ion me hod
dem chi eg 1.e-5:1.e5 11 : do a g id sea ch using 11 egula isa ion pa ame e s 𝑅gi en by 10−5,10−4,
0.001, 0.01, 0.1, 1, 10, 100, 1000, 104,105.
dem clean : use he clean me hod
dem poly 7 : use a 7 h deg ee polynomial me hod
dem gene 512 128 : use he gene ic algo i hm wi h a popula ion o 512 and 128 gene a ions
dem sa e mydem : sa e he cu en dem on a ile named mydem.dem
dem ead modeldem : ead he dem om a ile named modeldem.dem
dem smoo h 0.3 : smoo h he DEM o a empe a u e wid h o 0.3 in 10 log 𝑇(app oxima ely a ac o o 2 in
empe a u e ange).
Recommended ci a ion: Mewe e al. (1995).
3.1.10 Dis ance: se he sou ce dis ance
O e iew
One o he main p inciples o SPEX is ha spec al models a e in p inciple calcula ed a he loca ion o he X- ay
sou ce. Once he spec um has been e alua ed, he lux ecei ed a Ea h can be calcula ed. In o de o do ha , he
dis ance o he sou ce mus be se .
SPEX allows o he simul aneous analysis o mul iple sky sec o s. In each sec o , a di e en spec al model migh
be se up, including a di e en dis ance. Fo example, a o eg ound objec ha coincides pa ially wi h he p ima y
X- ay sou ce has a di e en dis ance alue.
The use can speci y he dis ance in a numbe o di e en uni s. Allowed dis ance uni s a e shown in he able
below.
3.1. Command syn ax 115
SPEX Help Cen e Documen a ion, Release 3.08.02
Table 34: SPEX dis ance uni s
Abb e a ion Uni
spex in e nal SPEX uni s o 1022 m ( his is he de aul )
m me e
au As onomical Uni , 1.49597892 1011 m
ly ligh yea , 9.46073047 1015 m
pc pa sec, 3.085678 1016 m
kpc kpc, kilopa sec, 3.085678 1019 m
mpc Mpc, Megapa sec, 3.085678 1022 m
z edshi uni s o he gi en cosmological pa ame e s
cz ecession eloci y in km/s o he gi en cosmological pa ame e s
The de aul uni o 1022 m is in e nally used in all calcula ions in SPEX. The eason is ha wi h his scaling all
calcula ions anging om sola la es o clus e s o galaxies can be done wi h single p ecision a i hme ic, wi hou
causing unde low o o e low. Fo he las wo uni s (z and cz), i is necessa y o speci y a cosmological model.
Cu en ly his model is simply desc ibed by H0,Ω𝑚(ma e densi y), ΩΛ(cosmological cons an ela ed densi y),
and Ω𝑟( adia ion densi y). A s a up, he alues a e:
H0: 70 km/s/Mpc ,
Ω𝑚: 0.3 ,
ΩΛ: 0.7 ,
Ω𝑟: 0.0
i.e. a la model wi h cosmological cons an . Howe e , he use can speci y o he alues o he cosmological
pa ame e s. No e ha he dis ance is in his case he luminosi y dis ance.
No e ha he p e ious de aul s o SPEX (H0= 50,𝑞0= 0.5) can be ob ained by pu ing H0= 50,Ω𝑚= 1,
ΩΛ= 0 and Ω𝑟= 0.
Wa ning: When H0o any o he Ωis changed, he luminosi y dis ance will no change, bu he equi a-
len edshi o he sou ce is adjus ed. Fo example, se ing he dis ance i s o z=1 wi h he de aul H0=70
km/s/Mpc esul s in o a dis ance o 2.039 1026 m. When H0is hen changed o 100 km/s/Mpc, he dis ance is
s ill 2.168 1026 m, bu he edshi is adjus ed o 1.3342.
Wa ning: In he ou pu also he ligh a el ime is gi en. This should no be con used wi h he (luminosi y)
dis ance in ligh yea s, which is simply calcula ed om he luminosi y dis ance in m!
Syn ax
The ollowing syn ax ules apply o se ing he dis ance:
dis ance [sec o #i:] # [#a] : se he dis ance o he alue # in he uni #a. This op ional dis ance uni
may be omi ed. In ha case i is assumed ha he dis ance uni is he de aul SPEX uni o 1022 m. The dis ance
is se o he sky sec o ange #i:. When he op ional sec o ange is omi ed, he dis ance is se o all sec o s.
dis ance show : displays he dis ance in a ious uni s o all sec o s.
dis ance h0 # : se s he Hubble cons an H0 o he alue # .
dis ance om # : se s he Ω𝑚pa ame e o he alue # .
dis ance ol # : se s he ΩΛpa ame e o he alue # .
dis ance o # : se s he Ω𝑟pa ame e o he alue # .
116 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Examples
dis ance 2 : se s he dis ance o 2 de aul uni s, i.e. o 2E22 m.
dis ance 12.0 pc : se s he dis ance o all sec o s o 12 pc.
dis ance sec o 3 0.03 z : se s he dis ance o sec o 3 o a edshi o 0.03.
dis ance sec o 2 : 4 50 ly : se s he dis ance o sec o s 2-4 o 50 ligh yea .
dis ance h0 50. : se s he Hubble cons an o 50 km/s/Mpc.
dis ance om 0.27 : se s he ma e densi y pa ame e Ω𝑚 o 0.27
dis ance show : displays he dis ances o all sec o s, see he example below o he ou pu o ma .
SPEX> di 100 mpc
Dis ances assuming H0 = 70.0 km/s/Mpc, Omega_m = 0.300 Omega_Lambda = 0.700 Omega_ ␣
˓→= 0.000
Sec o m A.U. ly pc kpc Mpc edshi cz ␣
˓→age(y )
--------------------------------------------------------------------------------------
˓→--------
1 3.086E+24 2.063E+13 3.262E+08 1.000E+08 1.000E+05 100.0000 0.0229 6878.7␣
˓→3.152E+08
--------------------------------------------------------------------------------------
˓→--------
3.1.11 Eg id: de ine model ene gy g ids
O e iew
SPEX ope a es essen ially in wo modes: wi h an obse a ional da a se ( ead using he da a commands), o wi hou
da a, i.e. heo e ical model spec a. In he i s case, he ene gy g id needed o e alua e he spec a is aken di ec ly
om he da a se . In he second case, he use can choose his own ene gy g id.
The ene gy g id can be a linea g id, a loga i hmic g id o an a bi a y g id ead om an ascii- ile. I is also possible
o sa e he cu en ene gy g id, wha e e ha may be. In case o a linea o loga i hmic g id, he lowe and uppe
limi , as well as he numbe o bins o he s ep size mus be gi en.
The ollowing uni s can be used o he ene gy o wa eleng h: keV ( he de aul ), eV, Ryd, J, Hz, Å, nm.
When he ene gy g id is ead o w i en om an ascii- ile, he ile mus ha e he ex ension “.eg ”, and con ains he
bin bounda ies in keV, s a ing om he lowe limi o he i s bin and ending wi h he uppe limi o he las bin.
Thus, he ile has 1 en y mo e han he numbe o bins! In gene al, he ene gy g id mus be inc easing in ene gy
and i is no allowed ha wo neighbou ing bounda ies ha e he same alue.
Finally, he de aul ene gy g id a s a up o SPEX is a loga i hmic g id be ween 0.001 and 100 keV, wi h 8192
ene gy bins.
Wa ning: When a da ase is al eady loaded, he eg id command o e w i es he model g id se by he esponse
ma ix. This can cause p oblems when con ol ing he model spec um wi h he ma ix. The e o e, i you need
a special ene gy g id ( o ins ance, ex ended ene gy ange needed o pho oionisa ion models such as pion),
i s issue he eg id command, and a e ha ead you da a iles.
3.1. Command syn ax 117
SPEX Help Cen e Documen a ion, Release 3.08.02
i s a is ic cs a : Use he C-s a is ic o all ins umen s o he minimisa ion. This is he de aul a
s a -up.
i s a is ic ws a : Use he W-s a is ic o all ins umen s o he minimisa ion.
i s a is ic chi2 #i1: #i2: : Change o he 𝜒2s a is ic o he ins umen ( ange) #i1: and egion
( ange) #i2: o he minimisa ion.
i s a is ic cs a #i1: #i2: : Change o he C-s a is ic o he ins umen ( ange) #i1: and egion
( ange) #i2: o he minimisa ion. This is he de aul a s a -up.
i s a is ic ws a #i1: #i2: : Change o he W-s a is ic o he ins umen ( ange) #i1: and egion
( ange) #i2: o he minimisa ion.
i me hod classical : Use he classical Le enbe g-Ma qua d minimisa ion as he i ing me hod.
i me hod simplex : Use simplex minimisa ion as he i ing me hod.
i me hod anneal : Use simula ed annealing minimisa ion as he i ing me hod.
i ann # : Change he empe a u e educ ion ac o . De aul alue is 0.85.
i ann # : Change he s a empe a u e. De aul alue: 5.
i ann eps # : Change he con e gence c i e ion 𝜖. I he inal unc ion alues om he las 4 empe a u es
di e om he co esponding alue a he cu en empe a u e by less han 𝜖and he inal unc ion alue a he
cu en empe a u e di e s om he cu en op imal unc ion alue by less han 𝜖, execu ion e mina es. De aul
alue is 0.10.
i ann m # : The s ep leng h ec o . On inpu i should encompass he egion o in e es gi en he s a ing
alue X. Fo poin X(I), he nex ial poin is selec ed is om X(I) - VM(I) o X(I) + VM(I). Since VM is
adjus ed so ha abou hal o all poin s a e accep ed, he inpu alue is no e y impo an (i.e. i he alue is o ,
he algo i hm adjus s VM o he co ec alue). De aul alue: 1.
i ann ns #i : Numbe o cycles. A e 𝑛𝑠 *𝑛 unc ion e alua ions, whe e 𝑛is he numbe o ee
pa ame e s, each elemen o he ec o VM is adjus ed so ha app oxima ely hal o all unc ion e alua ions a e
accep ed. The ec o VM con ols he ela i e s ep size o he ee pa ame e s. De aul alue o 𝑛𝑠 is 20.
i ann max #i : The maximum numbe o unc ion e alua ions. I du ing i e a ion mo e han his maximum
nunbe o e alua ions is used, he p ocess e mina es wi h an e o message (no con e ged). De aul alue:
100000.
i ann p in # : Con ols he p in ing o de ails o h simula ed annealing p ocess du ing he i . Allowed
alues 0 o 3. Only ele an o debugging you p oblem, may gi e a lo o ou pu depending on i s alue. De aul
alue: 0 (no p in ing). This is o e uled by he i p in ... command, which o he simula ed annealing me hod
p in s e e y new se o pa ame e s and plo s i s spec um i a new minimum is ound.
Examples
i : Pe o ms a spec al i . A he end he lis o bes i pa ame e s is p in ed, and i he e is a plo his will be
upda ed.
i p in 1 : I ollowed by he abo e i command, he in e media e i esul s a e p in ed o he sc een, and
he plo o spec um, model o esiduals is upda ed (p o ided a plo is selec ed).
i i e 10 : S op he a e 10 i e a ions o ea lie i con e gence is eached be o e en i e a ions a e comple ed.
i i e 0 : S op i ing only a e ull con e gence (de aul ).
i weigh model : Ins ead o using he da a o he s a is ical weigh s in he i , use he cu en model.
i weigh da a : Use he da a ins ead o he s a is ical weigh s in he i .
i me hod clas : Use he classical Le ebe g-Ma qua d me hod o ind minima.
i ann 0.5 : changes he empe a u e educ ion ac o o simula ed annealing o 0.5.
i s a is ic chi2 : Swi ch om C-s a is ics o 𝜒2( o all ins umen s and egions).
i s a is ic cs a : Swi ch back o C-s a is ics.
i s a is ic chi2 2 3:4 : Swi ch o 𝜒2s a is ics o ins umen 2, egions 3 o 4.
124 Chap e 3. Command o e iew

SPEX Help Cen e Documen a ion, Release 3.08.02
3.1.15 Ibal: se ype o ionisa ion balance
O e iew
Fo he plasma models, di e en ionisa ion balance calcula ions a e possible.
Cu en ly, he de aul se is U dampille a e al. (2017) The Table below lis s he possible op ions.
Table 36: Ionisa ion balance modes
Abb e a ion Re e ence
ese de aul (=u17)
a 85 A naud & Ro hen lug (1985)
a 92 A naud & Raymond (1992) o Fe,
A naud & Ro hen lug (1985) o he o he elemen s
b yans09 B yans e al. (2009)
u17 U dampille a e al. (2017) (de aul )
Syn ax
The ollowing syn ax ules apply:
ibal #a : Se he ionisa ion balance o se #a wi h #a in he able abo e.
ibal show : Show he cu en ly ac i e ionisa ion balance.
Examples
ibal ese : Take he s anda d ionisa ion balance
ibal a 85 : Take he A naud & Ro hen lug ionisa ion balance
3.1.16 Igno e: igno ing pa o he spec um
O e iew
I one wan s o igno e pa o a da a se in i ing he inpu model, as well as in plo ing his command should be
used. The spec al ange one wan s o igno e can be speci ied as a ange in da a channels o a ange in wa eleng h
o ene gy. No e ha he i s numbe in he ange mus always be smalle o equal o he second numbe gi en. I
mul iple ins umen s a e used, one mus speci y he ins umen as well. I he da a se con ains mul iple egions,
one mus speci y he egion as well. So pe ins umen / egion one needs o speci y which ange o igno e. The
s anda d uni chosen o he ange o da a o igno e is da a channels. To undo igno e, see he use command (Use:
euse pa o he spec um (page 150)).
The ange o be igno ed can be speci ied ei he as a channel ange (no uni s equi ed) o in ei he any o he ollowing
uni s: keV, eV, Rydbe g, Joule, He z, Å, nanome e , wi h he ollowing abb e a ions: ke , e , yd, j, hz, ang, nm.
3.1. Command syn ax 125
SPEX Help Cen e Documen a ion, Release 3.08.02
Syn ax
The ollowing syn ax ules apply:
igno e [ins umen #i1] [ egion #i2] # : Igno e a ce ain ange # gi en in da a channels o
ins umen #i1 and egion #i2. The ins umen and egion need o be speci ied i he e a e mo e han 1 da a se s in
one ins umen da a se o i he e a e mo e han 1 da a se om di e en ins umen s.
igno e [ins umen #i1] [ egion #i2] # uni #a : Same as he abo e, bu now one also speci ies he
uni es #a in which he ange # o da a poin s o be igno ed a e gi en. The uni s can be ei he Å (ang) o (k)eV.
Examples
igno e 1000:1500 : Igno es da a channels 1000 ill 1500.
igno e egion 1 1000:1500 : Igno e da a channels 1000 ill 1500 o egion 1.
igno e ins umen 1 egion 1 1000:1500 : Igno es he da a channels 1000 ill 1500 o egion 1 om he
i s ins umen .
igno e ins umen 1 egion 1 1:8 uni ang : Same as he abo e example, bu now he ange is
speci ied in uni s o Å ins ead o in da a channels.
igno e 1:8 uni ang : Igno es he da a om 1 o 8 Å, only wo ks i he e is only one ins umen and one
egion included in he da a se s.
3.1.17 Ion: selec ions o he plasma models
O e iew
Fo he plasma models, i is possible o include o exclude speci ic g oups o ions om he line calcula ions. This
is help ul i a be e physical unde s anding o he (a omic) physics behind he spec um is eques ed.
In addi ion, he e is an op ion o mu e pa icula lines in he spec um o speci ic analysis pu poses.
The e a e wo main easons why he use may use his op ion: compu a ional speed and educa ional easons.
Compu a ional speed
The i s eason is accele a ing he calcula ions. Fo complex spec al models, he compu a ional ime may be
long due o he la ge numbe o ions and ansi ions ha need o be aken in o accoun , in pa icula o he line
calcula ions.
By educing he numbe o ions in he calcula ion, o using a maximum p incipal quan um numbe , o o he educ-
ions, allow o make he calcula ions as e by simply skipping he line emission om hose ansi ions. No e ha
ob iously his leads o less accu a e spec a as compa ed o he ull calcula ion. Technically, i is done by using
he “ions igno e ...” o “ions use ...” commands ( o ge ing id o , o including line emission om speci ic ions),
o he “ions nmax ...” o “ions lmax ...” commands, o educe he maximum p incipal quan um numbe 𝑛and
he maximum o bi al quan um numbe 𝑙, espec i ely. Also, by using he “ions new ...”, “ions qc ...”, and “ions
old ...” commands one may swi ch be ween he de aul (new) spex calcula ions, he quick-cie mode, and he (old)
mekal calcula ions. See Op imizing model pe o mance (page 240) o mo e de ails.
A mino no e mus be made he e: when excluding a single ion, he calcula ions becomes less accu a e, because
le el popula ions o ions depend also on how many ionisa ions o ecombina ions occu om le els o neighbou ing
ions. By igno ing an ion, i also canno con ibu e o i s neighbou s.
Cu en ly hese se ings only a ec he line emission; in he calcula ion o he ionisa ion balance as well as he
con inuum always all ions a e aken in o accoun (unless o cou se he abundance is pu o ze o).
126 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Diagnos ics & educa ion
The second eason o include o exclude ions is o diagnos ic o educa ional easons. I may be o in e es o
know how he spec um o a single ion looks, o how he o al spec um would look wi hou an ion. Fo such cases,
SPEX has he “ions mu e ...” o i s in e se “ions unmu e ...” commands.
Con a y o he use/igno e commands, wi h his command he ull spec um is calcula ed, and only a he las s ep
he con ibu ion o he ion is mu ed o unmu ed. Also, con a y o he use/igno e commands, his op ion wo ks on
he ull spec um (con inuum and lines, bo h in emission and abso p ion). Finally, ake ca e when combining he
use/igno e wi h he mu e/unmu e commands. Whene e you igno e an ion, i will no be calcula ed and in hose
cases he mu e o unmu e commands a e no e ec i e.
Finally, when you use he mu e/unmu e commands, i will also a ec he ascii ou pu o a ew impo an ou pu
op ions, like he “line” and “ a” op ions o line emission o abso p ion.
Wa ning: When using he pion model wi h his op ion, you will ge a di e en solu ion, because i a ec s he
hea ing and cooling a es, and hus he ionisa ion balance (equilib ium empe a u e). Excep ion is when you use
he mod=1 op ion o pion, which o ces he empe a u e o be equal o wha you p esc ibe h ough pa ame e
inp. Fo diagnosing he hea ing/cooling con ibu ions o ions o elemen s, i is he e o e ecommended o un
i s he model wi h all ions, make an ascii-ou pu o he plasma pa ame e s, ake he empe a u e om he e as
he “ inp” pa ame e , and se mod=1. You can play hen wi h he mu e/unmu e command.
Quicklook
A new quicklook mode is in oduced in SPEX 3.0. This mode can g ea ly educe compu a ion ime by excluding
he a omic le els o ou e shells ha ba ely a ec he ob ained spec um. The maximum quan um numbe s 𝑛and
𝑙o Hyd ogen-like ions a e p o ided in he able below.
The quicklook mode is enabled by he command:
SPEX> ions ql
To undo he quicklook mode, jus ype ions use all.
Wa ning: This mode will no wo k o CX model, since elec on cap u ed by cha ge exchange usually popula e
he ou e shells.
Table 37: P ese maximum 𝑛and 𝑙 o quicklook mode (H-like)
Ion max. 𝑛max. 𝑙Ion max. 𝑛max. 𝑙Ion max. 𝑛max. 𝑙
C VI 16 3 N VII 16 3 O VIII 16 5
F IX 2 1 Ne X 16 4 Na XI 9 2
Mg XII 16 4 Al XIII 9 2 Si XIV 16 4
P XV 5 1 S XVI 16 4 Cl XVII 4 1
A XVIII 13 2 K XIX 4 1 Ca XX 9 2
Sc XXI 2 1 Ti XXII 4 1 V XXIII 2 1
C XXIV 5 1 Mn XXV 4 1 Fe XXVI 16 4
Co XXVII 2 1 Ni XXVIII 8 2 Cu XXIX 2 1
Zn XXX 2 1
No e: he quicklook mode is di e en om he quick CIE mode se by ions qc o a calc qc.
3.1. Command syn ax 127
SPEX Help Cen e Documen a ion, Release 3.08.02
QC mode
QC, o he quick cie mode, is in oduced in SPEX 3.08 o a quick e alula ion o CIE- amily models, including
CIE,dem,pdem,wdem,c , and clus. This mode can be u ned on and o o indi idual ions o elemen s.
No e: ion qc is only alid when he sys em lag a calc is se o new o qc.
Ewlim
An al e na i e, unable me hod o educe he compu a ion ime is he ewlim mode. Fo a g id o empe a u es and
non-equilib ium ionisa ion o ecombina ion pa ame e s, o each spec al line in SPEX he maximum equi alen
wid h 𝑊has been compu ed. The equi alen wid h is he e he line in ensi y di ided by he con inuum in ensi y o
he same model. F om his, we compu e o each line 𝑄=𝑊/𝐸 wi h E he ene gy o he line. This is a measu e
o he ela i e in ensi y o he line o a gi en spec al esolu ion. Fu he , o each line we egis e he maximum
p incipal quan um numbe 𝑛.
The use now can selec a c i ical alue o 𝑄𝑐(o ac ually, he 10log o his quan i y). Now o each p incipal
quan um numbe , we check whe he he e is any line wi h 𝑄>𝑄𝑐. I so, all lines wi h his p incipal quan um
numbe a e e ained, bu i none o helines is onge han he h eshold, we will disca d lines om ha p icipal
quan um numbe . In his way we de e mine he maximum p incipal quan um numbe o each ion, gi en he alue
o 𝑄𝑐. Highe alues o 𝑄𝑐means less lines, because mo e lines will be deemed o be oo weak.
A pe o mance es shows ha a speed gain o a ac o o 2-3 gan be eached wi h his me hod. I is in pa icula
use ul o e o sea ches on pa ame e alues. T y expe imen ing wi h his.
Wa ning: i is ad ised, a e ob aining a bes i wi h some se ing o ewlim, o se he pa ame e ewlim o -25
(including all lines), issue a calcula e command, and compa e he cs a alue o his model wi h he cs a alue
o you i . Dicide i his is good enough o you pu pose.
Mu e lines
A new ea u e since e sion 3.06.01 is he line mu e command. In some cases, when use s wha o s udy a pa icula
line, hey wan o emo e he line om he spec um o eplace i , o example, wi h a del a line o Gaussian.
The ions mu e line command allows o mu e up o 10 spec al lines iden i ied om he asc e line ou pu .
Please no e ha his command only wo ks o SPEXACT 3 ( a calc new). When SPEXACT 3 is enabled,
he ascdump line command (Ascdump: ascii ou pu o plasma and spec al p ope ies (page 91)) will show a
line lis wi h line id numbe s:
1 O VIII 1s 2S1/2 - 2p 2P1/2 0.
˓→6534939 18.97252 1.418E+42 1.689E-06 3.957E-04
2 O VIII 1s 2S1/2 - 2s 2S1/2 0.
˓→6535030 18.97225 1.011E+39 1.419E-12 3.957E-04
3 O VIII 1s 2S1/2 - 2p 2P3/2 0.
˓→6536802 18.96711 2.834E+42 1.691E-06 3.958E-04
In he example o O VIII abo e, he line id is lis ed as an in ege in he i s column be o e O VIII. To no show he
O VIII Lya lines in he spec um, hey can be mu ed wi h he command:
SPEX> ions mu e line 1 ion 8 8
SPEX> ions mu e line 3 ion 8 8
Whe e he numbe behind line is he line id, and he numbe s behind ion a e he a omic numbe and ionisa ion
s age, espec i ely. I necessa y, he lines can be unmu ed wi h he ions unmu e line command which has a
e y simila syn ax.
128 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Syn ax
The ollowing syn ax ules apply:
ions show : Display he lis o ions cu en ly aken in o accoun
ions ewlim # : use only he s onges lines using c i e ion # .
use ul numbe s o he X- ay ange a e ypically he ange be ween -4 and 4;
he minimum and maximum allowed alues a e -25 and 7. A highe alue means
as e compu a ion bu less accu a e spec a.
ions use all : Use all possible ions in he calcula ion o he line spec um. This is he de aul a s a up o he
p og am.
ions use iso #i: : Use ions o he iso-elec onic sequences indica ed by #i: in he line spec um
ions use z #i: : Use ions wi h he a omic numbe s indica ed by #i: in he line spec um
ions use ion #i1 #i2: : Use ions wi h he a omic numbe indica ed by #i1 and ionisa ion s age indica ed by
#i2: in he line spec um
ions igno e all : Igno e all possible ions in he calcula ion o he line spec um
ions igno e iso #i: : Igno e ions o he iso-elec onic sequences indica ed by #i: in he line spec um
ions igno e z #i: : Igno e ions wi h he a omic numbe s indica ed by #i: in he line spec um
ions igno e ion #i1 #i2: : Igno e ions wi h he a omic numbe indica ed by #i1 and ionisa ion s age
indica ed by #i2: in he line spec um
ions unmu e all : Display he con ibu ions o all possible ions in he inal spec um. This is he de aul a
s a up o he p og am.
ions unmu e iso #i: : Display ions o he iso-elec onic sequences indica ed by #i: in he spec um
ions unmu e z #i: : Display ions wi h he a omic numbe s indica ed by #i: in he spec um
ions unmu e ion #i1 #i2: : Display ions wi h he a omic numbe indica ed by #i1 and ionisa ion s age
indica ed by #i2: in he spec um
ions mu e all : Igno e all possible ions in he display o he spec um; will c ea e a ze o emission o
ansmission spec um! Mos use ul when ollowed immiedi a ely by a “ions unmu e ...” command
ions mu e iso #i: : Do no display ions o he iso-elec onic sequences indica ed by #i: in he spec um
ions igno e z #i: : Do no display ions wi h he a omic numbe s indica ed by #i: in he spec um
ions igno e ion #i1 #i2: : Do no display ions wi h he a omic numbe indica ed by #i1 and ionisa ion
s age indica ed by #i2: in he spec um
ions nmax all #i: : Se maximum 𝑛 o all ions
ions nmax iso #i1: #i2 : Se maximum 𝑛 o #i2 o isoelec onic sequence indica ed by #i1
ions nmax z #i1: #i2 : Se maximum 𝑛 o #i2 o a omic numbe indica ed by #i1
ions nmax ion #i1 #i2: #i3 : Se maximum 𝑛 o #i3 o a omic numbe indica ed by #i1 and ionisa ion
s age indica ed by #i2.
ions lmax all #i: : Se maximum 𝑙 o all ions
ions lmax iso #i1: #i2 : Se maximum 𝑙 o #i2 o isoelec onic sequence indica ed by #i1
ions lmax z #i1: #i2 : Se maximum 𝑙 o #i2 o a omic numbe indica ed by #i1
ions lmax ion #i1 #i2: #i3 : Se maximum 𝑙 o #i3 o a omic numbe indica ed by #i1 and ionisa ion
s age indica ed by #i2.
ions old all : Fo ce he old calcula ion o all ions
ions old iso #i1: : Fo ce he old calcula ion o he isoelec onic sequence indica ed by #i1
ions old z #i1: : Fo ce he old calcula ion o a omic numbe indica ed by #i1
ions old ion #i1 #i2: : Fo ce he old calcula ion o a omic numbe indica ed by #i1 and ionisa ion s age
indica ed by #i2.
ions qc all : Fo ce he quick-cie calcula ion o all ions
ions qc iso #i1: : Fo ce he quick-cie calcula ion o he isoelec onic sequence indica ed by #i1
ions qc z #i1: : Fo ce he quick-cie calcula ion o a omic numbe indica ed by #i1
ions qc ion #i1 #i2: : Fo ce he quick-cie calcula ion o a omic numbe indica ed by #i1 and ionisa ion
s age indica ed by #i2.
3.1. Command syn ax 129

SPEX Help Cen e Documen a ion, Release 3.08.02
ions new all : Fo ce he new calcula ion o all ions
ions new iso #i1: : Fo ce he new calcula ion o he isoelec onic sequence indica ed by #i1
ions new z #i1: : Fo ce he new calcula ion o a omic numbe indica ed by #i1
ions new ion #i1 #i2: : Fo ce he new calcula ion o a omic numbe indica ed by #i1 and ionisa ion s age
indica ed by #i2.
ions mu e line #i1 ion #i2 #i3 : Mu e a line wi h id #i1 o elemen #i2 a ionisa ion s age #i3.
ions unmu e line #i1 ion #i2 #i3 : Unmu e a line wi h id #i1 o elemen #i2 a ionisa ion s age #i3.
Examples
ions igno e all : Do no ake any line calcula ion in o accoun
ions use iso 3 : Use ions om he 𝑍= 3 (Li) iso-elec onic sequence
ions use iso 1:2 : Use ions om he H-like and He-like isoelec onic sequences
ions igno e z 26 : Igno e all i on (𝑍= 26) ions
ions use ion 6 5:6 : Use C V o C VI
ions mu e ion 8 7 : does elimina e he O VII con inuum and lines om he displayed spec um
ions unmu e iso 2 : shows he emission om all He-like ions (again).
ions show : Display he lis o ions ha a e used
ions ql : Quicklook mode on
ions ewlim 1.2 : Selec s onges lines using he cu -o alue 1.2
ions old ion 6 6 : Use old calcula ion o C VI
ions qc ion 6 5 : Use quick-cie calcula ion o C V
ions nmax ion 26 25 5 : Se maximum p incipal quan um numbe o Fe XXV o 𝑛= 5.
ions lmax ion 26 25 3 : Se maximum angula momen um quan um numbe o Fe XXV o ℓ= 3.
ions mu e line 1 ion 8 8 : Mu e line id 1 o O VIII.
ions unmu e line 1 ion 8 8 : Unmu e line id 1 o O VIII.
3.1.18 Log: Making and using command iles
O e iew
In many ci cums ances a use o SPEX wan s o epea his analysis o a di e en se o pa ame e s. Fo example,
a e ha ing analysed he spec um o sou ce A, a simila spec al model and analysis could be ied on sou ce B.
In o de o acili a e such analysis, SPEX o e s he oppo uni y o sa e he commands ha we e used in a session
o an ascii- ile. This ascii- ile in u n can hen be ead by SPEX o execu e he same lis o commands again, o he
ile may be edi ed by hand.
The command iles can be nes ed. Thus, a any line o he command ile he use can in oke he execu ion o
ano he command ile, which is execu ed comple ely be o e execu ion wi h he cu en command ile is esumed.
Using nes ed command iles may help o keep complex analyses manageable, and allow he use easy modi ica ion
o he commands.
In o de o acili a e he eadabili y o he command iles, he use can pu commen lines in he command iles.
Commen lines a e ecognized by he i s cha ac e , ha mus be #. Also blank lines a e allowed in he command
ile, in o de o enhance (human) eadabili y.
130 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Sa ing commands o ile
A e he command log sa e #a is gi en on he SPEX command line (#a is he ile name), all he ollowing
commands en e ed by he use (NOT he ones be o e) a e s o ed on he command ile un il he log close ou
command is gi en. Excep ions a e he commands ead om a nes ed command ile (i is no necessa y o sa e
hese commands, since hey a e al eady in he nes ed command ile). Also, help calls and he command o open
he ile (“log sa e #a”) a e no s o ed.
All commands a e expanded o he ull keywo ds be o e hey a e sa ed in he ile. Howe e , o execu ion his is
no impo an , since he in e p e e can ead bo h abb e a ed and ull keywo ds.
Sa ing he commands o he command ile can be s opped by gi ing he command log close sa e. The ile wi h
he sa ed commands is closed and emains a he speci ied pa h. SPEX will au oma ically append he ex ension
“.com” o he ilename.
Sa ing ou pu o ile
I is also possible o s o e all he ou pu ha is p in ed on he sc een o a ile. This is use ull o long sessions o
o compu e sys ems wi h a limi ed sc een bu e . The ou pu sa ed his way could be inspec ed la e by (o he
p og ams o ) he use . I is also use ul i SPEX is un in a kind o ba ch-mode. The command o sa e he ou pu is
log ou #a, whe e #a should be he ilename wi hou ex ension. SPEX will au oma ically append he ex ension
“.ou ” o he ilename.
Execu ing commands om ile
ASCII iles wi h he .com ex ension con aining SPEX commands can be execu ed in SPEX using he command
log execu e #a, whe e #a s ands o he ile name wi hou he “.com” ex ension. When a command ile is ead
and he end o ile is eached, he ex “No mal end o command ile encoun e ed” is p in ed on he sc een, and
execu ion o he calling command ile is esumed, o i he command ile was opened om he e minal, con ol is
passed o e o he e minal again.
Fo example, he use may ha e a command ile named un which does his en i e analysis. This command ile
migh s a wi h he line log exe myda a ha will un he command ile myda a ha con ains all in o ma ion
ega ding o he da a se s ead, u he da a selec ion o binning e c. This could be ollowed by a second line in
un like “log exe mymodel” ha uns he command ile mymodel which could con ain he se -up o he spec al
model and/o pa ame e s. Also, o en used plo se ings (e.g. s acking o di e en plo ypes) could easily placed
in sepa a e command iles.
Syn ax
The ollowing syn ax ules apply o command iles:
log exe #a : Execu e he commands om he ile #a. The su ix “.com” will be au oma ically appended o his
ilename.
log sa e #a [o e w i e] [append] : S o e all subsequen commands on he ile #a. The su ix “.com” will
be au oma ically appended o his ilename. The op ional a gumen “o e w i e” will allow o o e w i e an al eady
exis ing ile wi h he same name. The a gumen “append” indica es ha i he ile al eady exis s, he new
commands will be appended a he end o his ile.
log close sa e : Close he cu en command ile whe e commands a e s o ed. No u he commands will be
w i en o his ile.
log ou #a [o e w i e] [append] : S o e all subsequen sc een ou pu on he ile #a. The su ix “.ou ” will
be au oma ically appended o his ilename. The op ional a gumen “o e w i e” will allow o o e w i e an al eady
exis ing ile wi h he same name. The a gumen “append” indica es ha i he ile al eady exis s, he new ou pu
will be appended a he end o his ile.
log close ou pu : Close he cu en ascii ile whe e sc een ou pu is s o ed. No u he ou pu will be w i en
o his ile.
3.1. Command syn ax 131
SPEX Help Cen e Documen a ion, Release 3.08.02
Examples
log sa e my un : w i es all subsequen commands o a new ile named “my un.com”. Howe e , in case he ile
al eady exis s, no hing is w i en bu he use ge s a wa ning ins ead.
log sa e my un append : as abo e, bu appends i o an exis ing ile
log sa e my un o e w i e : as abo e, bu now o e w i es wi hou wa ning any al eady exis ing ile wi h he
same name.
log close sa e : close he ile whe e commands a e s o ed.
log exe my un : execu es he commands in ile my un.com.
log ou pu my un : w i es all subsequen ou pu o ile my un.ou .
log close ou pu : closes he ile abo e.
3.1.19 Menu: Menu se ings
O e iew
When command lines a e yped, i equen ly happens ha o en he i s keywo ds a e iden ical o se e al subse-
quen lines. This may happen o example when a plo is edi ed. SPEX o e s a sho cu o his by using he menu
command.
Syn ax
The ollowing syn ax ules apply:
menu none : Qui he cu en menu ex se ings (i.e., e u n o he de aul spex p omp ).
menu ex #a : Fo all ollowing commands, he ex s ing #a will be appended au oma ically be o e he
ollowing commands.
Examples
menu ex plo : All ollowing comman s will ge he “plo ” keywo d pu in on o hem. So i he nex
comman would be “plo de xs” i is su icien o ype “de xs” ins ead.
menu none : Re u n o he no mal SPEX p omp .
menu ex "pa 1 2" : All ollowing commands wil ge he “pa 1 2” keywo ds pu in on o hem. The nex
command could be “ al 4.”, which will be expanded o he ull “pa 1 2 al 4.” o se he empe a u e o sec o
1, componen 2 o 4 keV. No e ha he e he ex has h ee keywo ds (pa , 1, 2) and hence i has o be pu be ween
“”, o indica e ha i is a single ex s ing. I he e is only one keywo d, hese “” a e no necessa y.
3.1.20 Model: show he cu en spec al model
O e iew
This commands p in s he cu en spec al model, o each sec o , o he sc een. The model is he se o spec al
componen s ha is used, including all addi i e and mul iplica i e componen s. Fo all addi i e componen s, i
shows in which o de he mul iplica i e componen s a e applied o he addi i e (emi ed) componen s. See Comp:
c ea e, dele e and ela e spec al componen s (page 111) o mo e de ails.
132 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Syn ax
The ollowing syn ax ules apply:
model show : P in s he model o all sec o s o he sc een.
model show #i : P in s he model o sec o #i o he sc een.
Examples
model show 2 : P in s he model o he second sec o
3.1.21 Mul iply: scaling o he esponse ma ix
O e iew
This command mul iplies (a componen o ) he esponse ma ix by a cons an .
Wa ning: I his command is epea ed o he same componen hen he o iginal esponse ma ix is changed
by he mul iplica ion o he cons an s. Fo example, a e mul iplying he esponse ma ix by a ac o o 2, he
o iginal ma ix is eco e ed by mul iplying he in e media e esul by 0.5.
Wa ning: The ins umen numbe mus be gi en in his command e en i you use only a single ins umen .
Syn ax
The ollowing syn ax ules apply:
mul iply #i1 [componen #i2] # : Mul iplies he esponse ma ix o componen #i2 o ins umen #i1 by
a cons an # .
Examples
mul iply 1 3.5 : Mul iplies he esponse ma ix om ins umen 1 by a ac o o 3.5.
mul iply 1 componen 2 3.5 : Mul iplies he second componen o ins umen 1 by he cons an 3.5.
3.1.22 Obin: op imal ebinning o he da a
O e iew
This command ebins (a pa o ) he da a ( hus bo h he spec um and he esponse) o he op imal bin size gi en
he s a is ics o he sou ce as well as he ins umen al esolu ion. This is ecommended o do in all cases, in o de o
a oid o e sampling o he da a. The heo y and algo i hms used o his ebinning a e desc ibed in de ail in Op imal
de ini ion o espons ma ices (page 361). A simple ca oon o his is: binning o 1/3 o he FWHM, bu he ac o
o 1/3 depends weakly upon he local coun a e a he gi en ene gy and he numbe o esolu ion elemen s. The
be e he s a is ics, he smalle he bin size.
3.1. Command syn ax 133
SPEX Help Cen e Documen a ion, Release 3.08.02
he s ing will be placed a “coo d”, i # = 1.0 he igh hand o #a will be placed a “coo d”. O he alues can be
used bu a e less use ul.
plo s ing new # 1 # 2 #a : Plo a new s ing wi h ex as speci ied in #a a x=# 1 and y = # 2. See Plo
ex (page 158) o mo e de ails abou ex s ings. Also do no o ge o pu #a be ween “” i i consis s o mo e
han one wo d (i.e., i i con ains spaces).
plo s ing del #i: : Dele e s ing numbe s speci ied by he ange #i om he plo .
plo s ing #i: disp #l : I ue (de aul ), display he s ings speci ied by he ange #i:.
plo s ing #i: ex #a : Change he ex o s ings #i: o #a
plo s ing #i1: col #i2 : Se he colou s o s ings #i1: o #i2
plo s ing #i1: back #i2 : Se he backg ound colou o he s ings #i1: o he alue #i2.
plo s ing #i1: lw #i2 : Se he line weigh o s ings #i1: o #i2.
plo s ing #i: h # : Se he on heigh o s ings #i o # .
plo s ing #i1: on #i2 : Se he on s yle o s ings #i1 o #i2.
plo s ing #i: x # : Se he x posi ion o s ings #i: o # .
plo s ing #i: y # : Se he y posi ion o s ing #i: o # .
plo s ing #i: angle # : Se he angle o s ings #i: o # .
plo s ing #i: jus # : Con ols jus i ica ion o he s ings #i: pa allel o he speci ied edge o he
iewpo . I # = 0.0, he le hand o he s ings will be placed a he posi ion speci ied by “x y” abo e; i # =
0.5, he cen e o he s ings will be placed a “x y”, i # = 1.0 he igh hand o #i: will be placed a “x y”. O he
alues can be used bu a e less use ul.
plo s ing #i: box #l : I #l is ue, plo a box a ound he ex s ings #i:. The de aul alue is alse (no
box).
plo s ing #i1: box l #i2 : Se he line s yle o he box a ound he s ings #i1: o he alue #i2.
plo s ing #i1: box lw #i2 : As abo e, bu o he line weigh speci ied by #i2.
plo s ing #i1: box col #i2 : As abo e, bu o he colou index o he box speci ied by #i2.
plo se #i: : Selec s da a se numbe s as speci ied by #i:. A e wa ds mos plo commands will only a ec
da a se s #i:
plo se all : Selec s all da a se s ha a e p esen . All subsequen plo commands will be execu ed o all da a
se s.
plo line disp #l : I #l is ue, plo s a connec ing line h ough he da a poin s, (de aul is alse).
plo line col #i : Se he colou o he connec ing line o #i.
plo line l #i : Se he line s yle o he connec ing line o #i.
plo line lw #i : Se he line weigh o he connec ing line o #i.
plo line his #l : I #l is ue, plo he connec ing line in his og am o ma (de aul is ue).
plo elin disp #l : I #l is ue, plo s a connec ing line h ough he end poin s o he e o ba s, (de aul
depends upon he plo ype).
plo elin col #i : Se he colou o he connec ing line h ough he end poin s o he e o ba s o #i.
plo elin l #i : Se he line s yle o he connec ing line h ough he end poin s o he e o ba s o #i.
plo elin lw #i : Se he line weigh o he connec ing line h ough he end poin s o he e o ba s o #i.
plo elin his #l : I #l is ue, plo he connec ing line h ough he end poin s o he e o ba s in his og am
o ma (de aul is ue).
plo model disp #l : I #l is ue, plo he cu en model co esponding o he ele an da a se (de aul is
ue).
plo model col #i : Se he colou o he model o numbe #i.
plo model l #i : Se he line s yle o he model o numbe #i.
plo model lw #i : Se he line weigh o he model o numbe #i.
plo model his #l : I #l is ue, plo he model in his og am o ma (de aul is ue).
plo back disp #l : I #l is ue, plo he sub ac ed backg ound (de aul is ue).
plo back col #i : Se he colou o he sub ac ed backg ound o numbe #i.
plo back l #i : Se he line s yle o he sub ac ed backg ound o numbe #i.
plo back lw #i : Se he line weigh o he sub ac ed backg ound o numbe #i.
plo back his #l : I ue, plo he sub ac ed backg ound in his og am o ma (de aul is ue).
140 Chap e 3. Command o e iew

SPEX Help Cen e Documen a ion, Release 3.08.02
plo ill disp #l : I #l is ue, ill he cu e below he model wi h he colou speci ied by he nex
command o he de aul colou .
plo ill col #i : Change he illing colou o #i.
plo ill l #i : Change he line ype o he illing lines o #i.
plo ill lw #i : Change he line weigh o he illing lines o #i.
plo ill s yle #i : Change he s yle o he illing lines o he alue #i. He e #i has alues be ween 1–4,
wi h he ollowing meaning: 1 = solid illing (de aul ), 2 = ou line, 3 = ha ched, 4 = c oss-ha ched.
plo ill angle # : Se he angle o he illing lines o ha ched illing. De aul is 45 deg ees.
plo ill sep # : Se he dis ance be ween he illing lines o ha ched illing. The uni spacing is 1 % o he
smalle o he heigh o wid h o he iewing su ace. This should no be ze o.
plo ill phase # : The phase be ween he ha ch lines ha ill he a ea.
plo da a disp #l : I #l is ue, display he da a.
plo da a e x #l : I #l is ue, display he e o ba s in he x-di ec ion.
plo da a e y #l : I #l is ue, display he e o ba s in he y-di ec ion.
plo da a col #i : Gi e he da a colou index #i.
plo da a l #i : Gi e he da a line s yle #i.
plo da a lw #i : Gi e he da a line weigh #i.
plo da a h # : Gi e he symbols o he da a on heigh # .
plo da a symbol #i : Plo he da a wi h symbol numbe #i. Fo symbol numbe s, see Plo symbols
(page 162).
plo adum #a [o e w i e] [append] : Dump he da a and model in he plo in an ascii ile wi h ilename
#a. The ex ension “.qdp” will au oma ically be appended. No e ha he da a will be w i en as hey a e, i.e. i you
ha e a loga i hmic x-axis o y-axis, he logs o he plo ed quan i ies will be w i en. I you wan o eplo you
da a la e wi h o example he qdp package, ake ca e ha you plo he da a in SPEX on a lin-lin ame be o e you
execu e he “plo adum” command. Also no e ha he da a will be w i en in he uni s ha we e speci ied in he
plo (ene gy, wa eleng h o wha e e is applicable). The ou pu o ma is desc ibed in Plo asciidump ile o ma
(page 166). I he op ional “append” keywo d is p esen , he da a will be appended o any exis ing ile wi h he
name #a; i he op ional “o e w i e” keywo d is p esen , any p e-exis ing ile wi h he name #a will be o e w i en
by he new da a.
plo ion new #i1 #i2 # : Plo he ansi ion iden i ie pe ion.
Speci y #i1 and #i2 o selec elemen and ioniza ion s a e, o ins ance, o plo Fe XXV, #i1 and #i2 a e se o 26
and 25. I is op ional o de ine he edshi o he ansi ions wi h espec o hei es ame ene gies by # . The cu -
en implemen a ion includes all isoelec onic sequences om H-like down o B-like ions. I only con ains K-shell
ansi ions in he Rydbe g se ies. | plo ion del : Dele e he las ansi ion iden i ie . | plo com #i : Plo
each addi i e model componen sepa a ely o all componen s in sec o #i. The command should be immedia ely
ollowed by a calc command o e-e alua e he model, and hen a plo command o display he indi idual com-
ponen s (shown in g een) in he cu en window. plo com wo ks unde bo h plo ype da a and plo ype
model modes. I mul iplica i e componen s a e p esen , hey a e applied o he addi i e componen s in he plo .
Use plo com 0 o disable he componen plo .
Wa ning: plo com canno be applied ye o he pion model.
Wa ning: plo com should be bes used o he inal plo . I is no ecommended o use plo com du ing a
spec al i ing.
3.1. Command syn ax 141
SPEX Help Cen e Documen a ion, Release 3.08.02
Examples
plo de ice xs : Open he g aphic de ice xs (xse e ).
plo de ice ps myplo .ps : Selec a pos sc ip de ice connec ed o he ile name myplo .ps
plo ype da a : Plo he da a on he selec ed g aphics de ice(s)
plo ux angs om : Se he x-axis plo uni s o Å
plo uy angs om : Se he y-axis plo uni s o Coun s/s/Å
plo ame new : Open a new ame in he selec ed g aphics de ice(s)
plo ame 2 : Go o he 2nd ame, all plo commands will now only a ec ame 2
plo ype chi : Plo he esiduals in ame 2
plo uy el : Se he y-axis plo uni s in ame 2 o (Obse ed - Model)/Model
plo iew de aul : Se he de aul iewpo keywo d o alse so ha new use iewpo alues can be
speci ied o ame 2
plo iew y 0.2:0.8 : Se he y iewpo limi s o ame 2 om 0.2 o 0.8 o he ull de ice window
plo cap id disp : Do no display he id cap ion o ame 2
plo cap u disp : Do no display he uppe op cap ion o ame 2
plo cap l disp : Do no display he lowe op cap ion o ame 2
plo ux a : Se he x-axis plo uni s o ame 2 o Å
plo ux 21.602 ang : Plo he x-axis as eloci y in km−1 ela i e o a wa eleng h o 21.602 Å.
plo y -1:1 : Se he y-axis plo ange o ame 2 o be ween a lowe limi o -1 and an uppe limi o 1
plo ame 1 : Go o ame 1
plo iew de aul : Se he de aul iewpo keywo d o alse so ha new use iewpo alues can be
speci ied o ame 1
plo iew x 0.25:0.75 : Se he x iewpo limi s o ame 1 om 0.25 o 0.75 o he ull de ice window
plo de cps ilename.ps : Open a colou pos sc ip g aphics de ice and w i e he ou pu ile o ilename.ps
plo ion new 26 25 0.1 : Plo he posi ions o he K-shell a omic ansi ions o Fe XXV wi h a edshi o
0.1 on he cu en de ice
plo ion del : Dele e he las ion om he plo
plo com 1 : Plo sepa a ely all addi i e componen s om sec o 1. This command
should be immedia ely ollowed by a calc and a plo command o execu e. | plo com 0 : Remo e he compo-
nen plo . | plo : Red aw he plo on all ames and de ices. | plo close 2 : Close de ice numbe 2, which is
he pos sc ip
de ice in his case
3.1.25 Qui : inish he p og am
The qui op ion exi s he execu ion o SPEX, closes he open plo -de ices and sc a ch iles (i any) and, i eques ed
ou pu s he cpu- ime s a is ics.
Syn ax
The ollowing syn ax ule applies:
qui : qui he p og am as desc ibed abo e.
142 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
3.1.26 Rbin: op imal ebinning o he da a and esponse, including sa ing
O e iew
This command ebins (a pa o ) he da a ( hus bo h he spec um and he esponse) o he op imal bin size gi en
he s a is ics o he sou ce as well as he ins umen al esolu ion. This is ecommended o do in all cases, in o de
o a oid o e sampling o he da a. The heo y and algo i hms used o his ebinning a e desc ibed in de ail in
Op imal de ini ion o espons ma ices (page 361).
I does essen ially he same as he obin command as a as binning o he da a channels is conce ned, bu in addi ion
i also op imally bins he model ene gy g id. All p esc ip ions o his a e gi en in he pape o Kaas a and Bleeke
(2016). In addi ion, i s o es he newly binned spec um and esponse, wi h a di e en name, in he same di ec o y
whe e he o iginal da a a e. I he o iginal da a ea named da a.spo and da a. es, he new names will be da abin0.spo
and da abin0. es.
I is highly ecommended o apply he binning o he ull da a se , and o do one ins umen a a ime, o educe
he use o memo y, especially in cases wi h e y la ge ma ices. In hose cases, he comp ession may ake se e al
minu es.
Fu he , i is bes p ac ice o qui spex a e he c ea ion o he educed da ase , and o load he educed da a in a new
session. I you wan o see he di e ence, you can load he o iginal and he binned da a as wo sepa a e ins umen s
in spex, apply a simple model and see he di e ences in a plo .
Syn ax
The ollowing syn ax ules apply:
bin #i1: : Simples command allowed. #i1: is he ange in da a channels o e which he binning needs o ake
place.
bin # 1: #i: uni #a : The same command as abo e, excep ha now he anges o e which he da a is
o be binned (# 1:) a e speci ied in uni s (#a) di e en om da a channels. These uni s can be eV, keV, Å, as well
as in uni s o Rydbe g ( yd), Joules (j), He z (hz) and nanome e s (nm).
bin [ins umen #i1:] [ egion #i2:] #i3: : He e #i3: is he same as #i1: in he i s command.
Howe e , he e one can speci y he ins umen ange #i1: and he egion ange #i2: as well, so ha he binning is
done only o one gi en da a se .
bin [ins umen #i1:] [ egion #i2:] # 1: [uni #a] : This command is he same as he abo e,
excep ha he e one can speci y he ange o e which he binning should occu in he uni s speci ied by #a. These
uni s can be eV, Å, keV, as well as in uni s o Rydbe g ( yd), Joules (j), He z (hz) and nanome e s (nm).
Examples
bin 1:10000 : Op imally bins he da a channels 1:10000.
3.1.27 Sec o : c ea ing, copying and dele ing o a sec o
O e iew
This allows one o c ea e, dele e, copy, and show he numbe o sec o s, used o he analysis o he da a. Sec o s
a e designed o allow modeling o di e en sou ces o adia ion wi h i s own spec al model. This way, common
componen s can be i simul aneously, while he obse ed spec a a e o a di e en o igin. One can c ea e a sec o
o ano he (un esol ed) sou ce in he spec um, o modeling pa icle backg ound, o o spec a ex ac ed in a di -
e en ime in e al o a ime a iable sou ce. See o mo e de ails abou sec o s and egions in he Sec ion Sec o s
and egions (page 357).
3.1. Command syn ax 143
SPEX Help Cen e Documen a ion, Release 3.08.02
Fo doing spec al i ing o da a se s, he sec o s need o be speci ied in he esponse ma ix o he da a: he esponse
ile should ell which sec o numbe co esponds o a gi en pa o he ma ix.
The sec o command ea u es also a spec al dump mode (adump) ha w i es he model spec um o an ascii ile,
o ma ed such ha i is sui ed o he SPEX ile model. The i s line o he ou pu ile is an in ege showing he
numbe o bins, and he ollowing lines show he ene gy bin cen oid and he luminosi y in 1044 ph/s/keV.
Syn ax
The ollowing syn ax ules apply:
sec o new : C ea es a new sec o , which can ha e i s own model.
sec o show : Gi es he numbe o sec o s ha a e cu en ly used.
sec o copy #i : Copies he model o sec o #i o a new sec o .
sec o dele e #i : Dele es sec o #i.
sec o adump #i #a o e w i e : W i es he model spec um o sec o numbe #i o an ASCII ile wi h name
#a.
Examples
sec o new : C ea es a new sec o .
sec o copy 2 : C ea es a new sec o , wi h he same spec al model as used in sec o 2. This can be use ul i
he spec a o he di e en sec o s a e e y simila in composi ion.
sec o dele e 3 : Dele es sec o numbe 3.
sec o adump 1 model. x : Dumps he spec um in sec o 1 o model. x
3.1.28 Shi plo : shi he plo ed spec um o display pu poses
O e iew
This command shi s he obse ed spec um as well as he model spec um by adding a cons an o by mul iplying
a cons an , as a as plo s a e conce ned. The ue da a iles do no change, so he shi is only o ep esen a ional
pu poses.
The e a e basically wo op ions, indica ed by he mode a iable plo shi : Fo plo shi =1, a cons an shi is added
o he plo ed spec um o a gi en pa o he da a, o plo shi =2 he plo ed spec um is mul iplied by he cons an
shi .
The mul iplica i e cons an shi (plo shi =2) is gene ally p e e ed o log-log plo s, while o linea plo s a con-
s an addi i e shi (plo shi =1) is p e e ed.
Wa ning: In he case o addi ion (plo shi =1), he addi ion cons an is gi en in coun s/s. This hus leads o a
di e en (ene gy-dependen ) cons an being added o he plo ed spec um i he uni s a e no in coun s/s. Fo
he mul iplica i e case his is o cou se no he case.
144 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Syn ax
The ollowing syn ax ules apply:
shi plo #i # : #i indica es whe he a cons an should be added (#i=1) o mul iplied (#i=2) o he spec um
and model. # is hen he cons an o be added o mul iplied by.
shi plo [ins umen #i1:] [ egion #i2:] #i3 # : Shi he plo using a ac o # . He e #i3 (=
plo shi ) de e mines whe he he cons an is added (plo shi =1) o mul iplied (plo shi =2). The op ional
ins umen ange #i1: can be used o selec a single ins umen o ange o ins umen s o which he shi needs
o be applied, and he op ional egion ange #i2: he egion o hese ins umen s.
Examples
shi plo 1 2.0 : Adds 2 coun s/s o he plo ed spec um. Since no ins umen o egion is speci ied, his
applies o all spec a.
shi plo 2 10.0 : Mul iplies he plo ed spec um by a ac o o 10.0
shi plo ins umen 1 egion 2 1 2 : Adds 2 coun s/s o he plo ed spec um o he da a om
ins umen 1 and egion 2.
shi plo egion 2:3 1 2 : Adds 2 coun s/s o he plo ed spec um o he da a o all ins umen s and
egions 2−3.
3.1.29 Simula e: Simula ion o da a
O e iew
This command is used o spec al simula ions. The use should s a wi h a spec al model and a spec al da a se
(bo h ma ix and spec um). A e gi ing he “simula e” command, he obse ed spec um will be eplaced by he
simula ed spec um in SPEX. No e ha he o iginal spec um ile (wi h he .spo ex ension) is no o e w i en by
his command, so no ea o des oy you inpu da a!
Di e en op ions exis and se e al pa ame e s can be se :
•Ins umen , egion: he ins umen (s) and egion(s) o which he simula ion should be done (i.e., i you ha e
mo e ins umen s you can do he simula ion only o one o a ew ins umen s).
• ime: se he exposu e ime 𝑡(s) o he sou ce spec um as well as he backg ound e o scale ac o 𝑓𝑏. This
las op ion allows you o see wha happens i o example he backg ound would ha e a en imes highe
accu acy ( o 𝑓𝑏= 0.1).
•syse : add a sys ema ic e o o bo h he sou ce and backg ound spec um. An al e na i e way o in oduce
sys ema ic e o s is o cou se o use he syse command (Syse : sys ema ic e o s (page 148)). Take ca e no
o se he sys ema ic e o s wice, and emembe ha ebinning you spec um la e will educe he sys ema ic
e o s, as hese will be added in quad a u e o he s a is ical e o s. So i s ebin and hen add sys ema ics!
•noise: ei he andomize you da a o jus calcula e he expec ed alues.
•bnoise: andomize you backg ound model (gene ally no ecommended o do).
•seed: se he andom seed ei he o a speci ic numbe o gene a e i om he sys em clock. By de aul , SPEX
ini ializes he andom numbe gene a o based on he sys em clock, bu h ough his command a speci ic
seed can be se . The command will show he seeds used o he maximum numbe o expec ed h eads.
Please no e ha by de aul , only he i s ins umen and egion a e being simula ed. I you wan o simula e all
ins umen s and egions, hen his can be a anged by he commands:
SPEX>simula e ins umen 1:2
SPEX>simula e egion 1:2
3.1. Command syn ax 145

SPEX Help Cen e Documen a ion, Release 3.08.02
Wa ning: A esponse ma ix and spec um o he egion and he ins umen you wan o simula e a e necessa y,
because SPEX needs he esponse ma ix as well as he backg ound o be sub ac ed o he simula ions.
Wa ning: When you include sys ema ic e o s in he simula ion (by pu ing he “syse ” o non-ze o alues),
you canno use anymo e Poissonian s a is ics hence he C-s a o i ing, bu you ha e o use he “ i me h chi”
o use Gaussian e o s and 𝜒2- i ing, wi h all h disad an ages o ha .
Wa ning: When you use bnoise= ue, you sub ac ed backg ound ( he scaled backg ound om he back-
g ound egion) will be andomized, and he pu e C-s a canno be used; he W-s a can be used as al e na i e
bu has se ious d awbacks and is no ecommended o be used).
Wa ning: (obsole e) I you backg ound is aken om he same obse a ion as you sou ce, and you mul iply
he o iginal exposu e ime wi h a ac o o 𝑆, you should pu 𝑓𝑏 o 𝑆−0.5, e lec ing he ac ha wi h inc easing
sou ce s a is ics he backg ound s a is ics also imp o es. This is he case o an imaging obse a ion whe ea pa
o he image is used o de e mine he backg ound. I ins ead you use a deep ield o sub ac he backg ound,
hen he exposu e ime o you backg ound will p obably no change and you can sa ely pu 𝑓𝑏= 1 o any
exposu e ime 𝑡.
Wa ning: (obsole e) I you sub ac ed backg ound (one o he columns in he .spo ile) is de i ed om a low
s a is ics Poissonian a iable ( o example a measu ed coun a e wi h ew coun s pe channel), hen scaling he
backg ound is sligh ly inaccu a e as i akes he obse ed ins ead o expec ed numbe o backg ound coun s as
he s a ing poin o he simula ion.
Syn ax
No e ha only he “simula e” keywo d ollowed by a numbe ( he exposu e ime will do he ac ual simula ion. All
o he syn ax ules jus se some pa ame e s. The ollowing syn ax ules apply:
simula e # : Does he simula ion, wi h # he exposu e ime 𝑡in seconds.
simula e ins umen #i1 : Speci y he ins umen ( ange) o be used in he simula ion. De aul alues a e 1
(jus he i s ins umen ).
simula e egion #i1 : Speci y he egion ( ange) o be used in he simula ion. De aul alues a e 1 (jus he
i s egion). Fo simula ing e e y hing you ha e, you can pu his ange o a la ge alue: he simula ion will
simply igno e non-exis en egions. I you use complex se ings, like only egion 3 o ins umen 1 and egion 2
o ins umen 2, you may ha e o un he simula ion sepa a ely o each en i y.
simula e syse # 1 # 2 : Speci y he sys ema ic e o s as a ac ion o he sou ce and backg ound
spec um, espec i ely; bo h should be speci ied oge he . De aul alues a e 0.
simula e noise #l : I #l is ue, Poissonian noise will be added ( his is he de aul ).
simula e bnoise #l : I #l is alse, no Poissonian noise will be added o he model backg ound ( his is he
de aul ).
simula e seed #i : Se andom seed o a pa icula numbe .
simula e seed andom : Se andom seed andomly based on sys em clock.
146 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Examples
simula e 10000. : This simula es a new spec um/da ase wi h 10 000 s exposu e ime.
simula e noise : Se simula ion lag o simula e wi hou Poissonian noise. The nominal e o ba s will s ill
plo ed.
simula e syse 0.1 0.2 : Se simula ion o a sys ema ic e o o 10 % o he sou ce spec um and 20 % o
he sub ac ed backg ound spec um added in quad a u e.
simula e ins umen 2:4 : Se simula ion o a spec um o ins umen s 2–4 only
simula e egion 2 : Se simula ion o only egion 2 (o e e y ins umen in ol ed
simula e seed 2 : Se andom numbe seed o 2.
3.1.30 S ep: G id sea ch o spec al i s
O e iew
A g id sea ch can be pe o med o 𝜒2 e sus 1, 2, 3 o 4 pa ame e s. The minimum, maximum and numbe o s eps
o each pa ame e may be adjus ed. S eps may be linea o loga i hmic. Fo each se o pa ame e s, a spec al i is
made, using he las spec al i execu ed be o e his command as he s a ing poin . Fo each s ep, he pa ame e s
and 𝜒2a e displayed. This op ion is use ul in case o doub abou he posi ion o he bes i in he pa ame e space,
o in cases whe e he usual e o sea ch is complica ed. Fu he i can be use ul incases o complica ed co ela ions
be ween pa ame e s.
Wa ning: Take ca e o do a spec al i i s !
Wa ning: Bewa e o he cpu- ime i you ha e a ine g id o many dimensions!
Because he s ep e minal ou pu can be qui e long and cause issues in some cases, we supp ess he e minal ou pu
when an ou pu ile is eques ed. I you wan o ollow he p og ess o he s eps, you can open a new e minal and
use he ail - command.
In you SPEX e minal, you gi e he s ep ile command:
SPEX>s ep ile pa g id
While his is unning, open a new e minal window and change o you wo king di ec o y. Now you can gi e he
ail - command and ollow he p og ess:
unix:~> ail - pa g id.s p
Syn ax
The ollowing syn ax ules apply:
s ep dimension #i : De ine he numbe o axes o he sea ch (be ween 1–4).
s ep axis #i1 pa ame e [[#i2] #i3] #a ange # 1:# 2 n #i4 : Se o axis #i1, op ional sec o
#i2, op ional componen #i3 and pa ame e wi h name #a he ange o he numbe speci ied by # 1 and # 2, wi h a
numbe o s eps 𝑛gi en by #i4. I 𝑛 > 0, a linea mesh be ween # 1 and # 2 will be aken, o 𝑛 < 0, a
loga i hmic g id will be aken.
s ep : Do he s ep sea ch. Take ca e o do i s he “s ep dimension” command, ollowed by as many “s ep axis”
commands as you en e ed he numbe o dimensions.
3.1. Command syn ax 147
SPEX Help Cen e Documen a ion, Release 3.08.02
s ep ile example : Do he s ep sea ch and also w i e he esul s o an .s p ile used by he s epcon ou
p og am (see S epcon ou (page 250)).
Wa ning: The s ep ile command will o e w i e exis ing .s p iles wi h he same name by de aul .
Examples
Below we gi e a wo ked ou example o a CIE model whe e we ook as ee pa ame e s he no maliza ion “no m”,
empe a u e “ ”, Si abundance “14” and Fe abundance “26”. To do a 3-dimensional g id sea ch on he empe a u e
(loga i hmic be ween 0.1 and 10 keV wi h 21 s eps), Fe abundace (linea be ween 0.0 and 1.0 wi h 11 s eps) and
Si abundance (linea be ween 0.0 and 2.0 wi h 5 s eps, i.e. alues 0.0, 0.4, 0.8, 1.2, 1.6 and 2.0) he ollowing
commands should be issued:
i : Do no o ge o do i s a i .
s ep dimension 3 : We will do a h ee-dimensional g id sea ch
s ep axis 1 pa ame e 1 1 ange 0.1:10.0 n -21 : The loga i hmic g id o he i s axis,
empe a u e; no e he −be o e he 21!
s ep axis 2 pa 26 ange 0:1 n 11 : The g id o axis 2, Fe abundance.
s ep axis 3 pa 14 ange 0:2 n 5 : Idem o he 3 d axis, Silicon.
s ep : Now do he g id sea ch. Ou pu is in he o m o ascii da a on you sc een (and/o ou pu ile i you opened
one).
s ep ile example : G id sea ch wi h ou pu o you sc een and .s p ou pu ile o use wi h he s epcon ou
ask.
3.1.31 Syse : sys ema ic e o s
O e iew
This command calcula es a new e o , adding he sys ema ic e o o he sou ce and he backg ound o he Poisso-
nian e o in quad a u e. One mus speci y bo h he sys ema ic e o as a ac ion o he sou ce spec um as well
as o he sub ac ed backg ound spec um. The o al o hese ac ions can ei he be less o g ea e han 1.
Wa ning: This command mixes wo undamen ally di e en ypes o e o s: s a is ical ( andom luc ua ions)
and sys ema ic (o se ). The esul ing unce ain ies a e unjus ly ea ed as being s a is ical, which can lead o
w ong esul s when he sys ema ic o se s a e subs an ial. Syse should he e o e be used wi h ex eme cau ion.
Wa ning: One should i s ebin he da a, be o e unning syse . Run syse howe e be o e i ing he da a o
inding e o s on he i .
Wa ning: Running syse mul iple imes will inc ease he e o e e y ime. I he inpu o syse is w ong one
should es a SPEX and e un syse wi h he co ec alues o calcula e he o al e o co ec ly.
148 Chap e 3. Command o e iew
SPEX Help Cen e Documen a ion, Release 3.08.02
Syn ax
The ollowing syn ax ules apply:
syse #i: # 1 # 2 : The sho es e sion o his command. #i: is he ange in da a channels o which he
sys ema ic e o is o be calcula ed and added (in quad a u e) o he Poissonian e o . # 1 is hen he he ela i e
sys ema ic e o due o he sou ce and # 2 he ela i e sys ema ic e o due o he backg ound.
syse [ins umen #i1:] [ egion #i2:] #i3: # 1 # 2 : In his syn ax one can also speci y he
ins umen and he egion one wan s o calcula e he combined e o o . Bo h can be anges as well. #i3: has he
same ole as #i: in he abo e command, and # 1 and # 2 a e he same as abo e.
syse [ins umen #i1:] [ egion #i2:] #i3: # 1 # 2 [uni #a] : Exac same command as
abo e, excep ha now he da a ange (#i3:) o which he e o s a e o be calcula ed a e gi en in uni s di e en
han da a channels. These uni s can be Å (ang), eV (e ), keV (ke ), Rydbe gs ( yd), Joules (j), He z (hz) and
nanome e s (nm). This is he mos gene al command.
Examples
syse 1:100000 0.3 0.5 : Calcula es he combined Poissonian and sys ema ic e o o da a channels
1:100000, whe e he ac ion o he sys ema ic e o o he sou ce is 0.3 and he backg ound is 0.5.
syse 0:2000 0.3 0.5 uni e : The same as he abo e command, expec ha now he e o calcula ion is
pe o med be ween 0 and 2000 eV ins ead o da a channels.
syse ins umen 2 egion 1 0:2000 0.3 0.5 uni e : The same as he abo e command, bu now
he e o calcula ion is only pe o med o he da a se om he second ins umen and he i s egion he eo .
3.1.32 Sys em: call sys em execu ables
O e iew
Some imes i can be handy i SPEX in e ac s wi h he compu e sys em, o example i you un i in command
mode. You migh wan o check he exis ence o ce ain ile, o un o he p og ams o p oduce ou pu o you, and
depending on ha ou pu you wan o con inue SPEX.
The e o e he e is an op ion o execu e any shell ype commands on you machine, using he o an “call sys em”
sub ou ine.
Ano he use ul goody is he possibili y o s op SPEX au oma ically i you ind some condi ion o occu ; his migh
be use ul o example i you ha e a p og am unning ha calls SPEX, and depending on he ou come o SPEX you
migh wan o e mina e he execu ion. This is achie ed in SPEX by es ing o he exis ence o a ile wi h a
gi en ilename; i he ile exis s, SPEX s ops immedia ely execu ion and e mina es; i he ile does no exis ,
SPEX con inues no mally.
Syn ax
The ollowing syn ax ules apply:
sys em exe #a : execu e he command #a on you UNIX/linux shell.
sys em s op #a : s op SPEX i he ile #a exis s.
3.1. Command syn ax 149
SPEX Help Cen e Documen a ion, Release 3.08.02
Finally, ou uns wi h Cloudy a e done using he ollowing de aul se ings (apa om he SED and abundances
ha a e en e ed by he use ):
•Hyd ogen densi y small, i.e. 1014 m−3(108cm−3)
•Column densi y small, i.e. 1020 m−2(1016 cm−2)
•Use he “i e a e o con e gence” command o Cloudy
•Values o log 𝜉be ween −8.5and +6.5wi h s eps o 0.1
No e ha , depending on he compu e used, his p og am may un o se e al hou s. Du ing execu ion i should
display he p esen alue o log 𝜉and he elec on empe a u e in eV o each s ep o log 𝜉be ween −8.5and +6.5.
This numbe should upda e egula ly. I i does no , hen i is possible ha he calcula ion is s uck. This usually
happens i he used model canno calcula e he lowes alues o 𝜉. I so, you may wan o change he log 𝜉 ange.
This can be done by p o iding he lag - a he command line when xabsinpu is s a ed. I you do ha , make su e
ha when you use he xabs model in SPEX, you adjus he lowe and uppe limi o he xil pa ame e as well o
he limi s gi en o xabsinpu . This way one can a oid possible p oblems when xil is ou o he calcula ed ange.
Wa ning: We no e ha up o and including e sion 13.03 o Cloudy, 𝐿i𝑜𝑛 in he de ini ion o 𝜉was ac ually
he o al bolome ic ionising luminosi y. Howe e , om he upcoming e sion 13.04 o Cloudy his is co ec ed
in he Cloudy code o be consis en wi h he commonly used de ini ion, whe e 𝐿i𝑜𝑛 anges be ween 1 o 1000
Ryd. Thus, we ecommend using he xabsinpu p og am wi h Cloudy e sion 13.04.
5.4 Hyd o d i e
Some use s un complex and compu a ionally expensi e hyd odynamical simula ions, and wan o be able o cal-
cula e he co esponding X- ay spec um. Wi hou ha ing o implemen hese hyd o-codes in o i is now possible
o do his.
Fo ha pu pose we o e he Fo an90 sub ou ine hyd o_d i e . 90. Basically, i does he ollowing:
1. I eads he needed pa ame e s as sub ou ine a gumen s.
2. I does a ew sani y checks (ion concen a ions should be non-nega i e, and he o al H+H column densi y
mus be 1.
3. I hen c ea es a ile called “spexicon.da ” con aining he ion concen a ions.
4. I also c ea es a ile called “spexg id.eg ” con aining he ene gy g id.
5. I hen c ea es a ile called “spexd i e .com” ha con ains he commands o un in ba ch mode.
6. This ile is execu ed, and c ea es a ile “spexou pu .asc” con aining he emi ed spec um.
7. SPEX e mina es.
8. The sub ou ine eads he ile “spexou pu .asc” and pu s he spec um in he app op ia e ou pu a ay o he
sub ou ine.
The inpu a gumen s o he sub ou ine a e as ollows:
hden : The Hyd ogen densi y in uni s o 1020 m−3. Real numbe .
: The elec on empe a u e in keV. Real numbe .
i : The ion empe a u e in keV, used o line b oadening. Real numbe .
mic : The mic o u bulence eloci y, in km s−1, used o line b oadening. Real numbe .
olume : The emi ing olume, in uni s o 1024 m3. Real numbe .
con(31,30) : A ay wi h ion concen a ions ela i e o hyd ogen (numbe densi ies). The abundances o he
me als should be aken in o accoun in his; hus, o example, o cosmic abundances, oxygen has a numbe
densi y o abou 0.001 pe hyd ogen a om, hence he sum o all oxygen ion concen a ions should hen be 0.001.
The a ay con(jz,iz) con ains o each elemen (labeled wi h a omic numbe 𝑖𝑧, H=1, He=2 e c.) he
252 Chap e 5. Addi ional ools

SPEX Help Cen e Documen a ion, Release 3.08.02
concen a ion; 𝑗𝑧 indica es he ionisa ion s age (1=I=neu al, 2=II=singly ionized, e c.; do no o ge o include
he ba e nucleus as he las one. A ay elemen s wi h 𝑗𝑧 > 𝑖𝑧 + 1 will be igno ed. No e ha as hings a e
no malised o hyd ogen, 𝑐𝑜𝑛(1,1) + 𝑐𝑜𝑛(2,1) = 1 is obliga o y! Real a ay.
neg : Numbe o ene gy bins. In ege numbe .
eg(0:neg) : Ene gy bin bounda ies in keV; he bounda ies o he i s bin a e s o ed in eg(0) and eg(1); he
second bin in eg(1) and eg(2); e c. Real a ay.
The ou pu a gumen s o he sub ou ine a e as ollows:
spec(neg) : The emi ed spec um in uni s o 1044 pho ons/s/keV. Di ide his numbe by 4𝜋𝑑2wi h 𝑑 he sou ce
dis ance o ge he lux a Ea h. Real a ay.
5.5 Rgs p o
In SPEX, he lp o componen (see Lp o: spa ial b oadening model (page 210)) can be used o old he spec um
wi h a use de ined b oadening p o ile. This is pa icula ly use ul o he analysis o ex ended sou ces wi h g a -
ing spec ome e s, like RGS aboa d XMM-New on. The gs p o p og am c ea es an inpu ile (usually called
p o .da ) o he lp o componen om a MOS1 de ec o image.
The p og am will ask o he ollowing inpu :
•MOS1 de ec o image. In o de o ob ain a p o ile along he dispe sion di ec ion o RGS wi hin he same ield
o iew, he p og am asks o a MOS1 image o he sou ce in de ec o coo dina es (DETX,DETY) c ea ed by,
o example, he XMM-New on SAS ask e selec . Rgs p o does no equi e a pa icula esolu ion o he
image, bu a esolu ion o abou 1/3 o he XMM-New on PSF, i.e. 4′′, is ecommended. I is ecommended
o ex ac an image using e en s wi h ene gies alling in he RGS band: ∼0.3-2.0 keV.
•C oss-dispe sion selec ion egion. I he RGS spec um is ex ac ed om a ce ain a ea in he c oss-dispe sion
di ec ion, hen p o ide he lowe and uppe bounda y he e in a cminu es wi h espec o he cen e o he
ield o iew. The ull RGS s ip co esponds o a ange be ween -2.5 and 2.5 a cminu es.
•Sou ce wid h in he dispe sion di ec ion. This pa ame e de e mines he bounda ies o he esul ing p o ile in
wa eleng h space. Rgs p o asks o he wid h o he sou ce in a cmin cen ed on he peak o he emission.
Choose his wid h o be somewha la ge han he ac ual wid h o he sou ce o be su e ha he b igh es pa s
a e included in he p o ile. A wid h o >10 a cmin is ypically enough, bu a la ge wid h will inc ease he
size o he p o .da ile and inc ease p ocessing imes.
•Ou pu ile name. The name o he ou pu ile (usually p o .da ). No e ha gs p o does no o e w i e iles
ha al eady exis .
Rgs p o c ea es an ASCII ile wi h wo columns. The le column consis s o he g id o wa eleng hs ha he
p o ile is based upon and he igh column gi es he no malised cumula i e p o ile o e his ange s a ing wi h 0
and ending a 1. The p o ile will be cen ed on he peak o he emission.
No e: The c oss-dispe sion axis in RGS is pa allel o he DETX coo dina e axis in MOS1 and has he same di ec-
ion. This is pa icula ly help ul when one ex ac s spa ial egions in he c oss-dispe sion di ec ion o RGS.
Wa ning: This p og am wo ks bes o b igh ex ended sou ces, whe e he backg ound con ibu ion is negli-
gible. Fo sou ces wi h a low su ace b igh ness, in p inciple a backg ound sub ac ed image should be used.
This p og am, howe e , canno deal wi h nega i e alues in he MOS1 image.
5.5. Rgs p o 253
SPEX Help Cen e Documen a ion, Release 3.08.02
Wa ning: This p og am does no ake in o accoun igne ing and chip gaps. Fo o se obse a ions o e y
ex ended sou ces, his may s a o play a ole.
5.5.1 Theo y
The wa eleng h scale co esponding o he angula wid h o he sou ce in RGS can be calcula ed using he dispe -
sion equa ion de ined in e.g. Pe e son e al. (2004):
𝑚𝜆 =𝑑(cos𝛽−cos𝛼),
whe e 𝑚is he spec al o de , 𝜆 he wa eleng h, 𝑑 he g a ing spacing, 𝛼 he incidence angle o a pho on, and
𝛽 he di ac ed angle. The wa eleng h shi ∆𝜆due o an o se angle ∆𝜃 ela i e o he elescope bo esigh
can be de i ed by di e en ia ing he equa ion abo e wi h espec o 𝜃=𝐹
𝐿(𝛼−𝛼0), whe e 𝐹is he dis ance
be ween he g a ings (RGA) and he came a (RFC), 𝐿 he ocal leng h o he elescope, and 𝛼0 he incidence angle
co esponding o he elescope bo esigh . The esul ing ela ion o ∆𝜆is:
∆𝜆=𝑑𝐿
𝑚𝐹 sin(𝛼0)∆𝜃.
We hen use he ollowing numbe s om den He de e al. (2001):𝑑is 1/645.6 mm, 𝐿is 7.5 m, 𝐹is 6.7 m, and
𝛼0is 1.5762∘ o calcula e he ypical con e sion ac o om ∆𝜃in a cmin:
∆𝜆= 0.1387 ∆𝜃
No e ha he alue in Pe e son e al. (2004) is no co ec , because he ac o 𝐿
𝐹was no applied. The alue in he
abo e equa ion is used in gs p o o con e he spa ial p o ile om a cminu e scales o wa eleng h scales.
5.6 RGS_ luxcombine
P og am RGS_ luxcombine combines luxed spec a, c ea ed by he XMM-New on SAS ask gs luxe . I has wo
op ions:
1. Op ion 1: combine RGS spec a o he same de ec o and spec al o de .
2. Op ion 2: combine spec a o RGS1, RGS2 and i s and second o de o bo h (4 spec a) in o one spec um.
This is no a i ial ask, due o he p esence o bad pixels, CCD gaps e c, ha o each indi idual spec um can be
sligh ly di e en , o ins ance because o he use o he mul i-poin ing mode (MPM) o he RGS, so ha he same
bad pixel alls a a di e en wa eleng h o each indi idual spec um, o due o he ansien na u e o some bad
pixels/columns.
We discuss bo h op ions sepa a ely. In gene al, i you ha e RGS da a o mul iple epochs o a sou ce, you may ha e
o un his p og am i s ou imes wi h op ion 1 (RGS1 and 2, o de s 1 and 2), and hen un i ones wi h op ion 2
o ge a single s acked RGS spec um.
Wa ning: You mus un he SAS ask gs luxe wi h 3600 wa eleng h bins be ween 4–40 Å. Thus, do no use
he o me 𝛽-bins! Also, do no change hese wa eleng h limi s o numbe o bins.
The p og am needs an inpu ile, basically elling i how many spec a should be combined, ollowed by one line
o each spec um ( ixed o ma , in o an (F9.2,1X,A) o op ion 1), con aining he exposu e ime in s (un o -
una ely no con ained in he ou pu o gs luxe , bu you can ge i om he spec al iles) and he name o he
ele an ou pu ile o gs luxe . Fo op ion 2 he e a e wo addi ional numbe s, namely he RGS (1 o 2 o RGS1
and RGS2), and he spec al o de (1 o 2 o i s and second spec al o de ), in such a way ha he o ma is
(I1,1X,I1,1X,F11.2,1X,A).
254 Chap e 5. Addi ional ools
SPEX Help Cen e Documen a ion, Release 3.08.02
5.6.1 Op ion 1: combining RGS spec a o he same de ec o and spec al o de
I is impo an o ealise ha when da a o a ime- a iable sou ce a e combined, a i ac s due o missing da a (bad
pixels) will a ise. This can be simply illus a ed by an example. Suppose ha sou ce X is obse ed wice wi h
RGS, wi h exac ly he same exposu e ime, he i s ime wi h 100 coun s/bin, he second ime wi h 20 coun s/bin.
Suppose ha a wa eleng h bin 𝑗 he i s obse a ion has a bad pixel, hence no coun s, while he second obse a ion
has no bad pixel a bin 𝑗. The a e aged spec um will ha e (100+20)/2=60 coun s pe bin, excep o bin 𝑗whe e
he a e age alue is (0+20)/2=10. Now since bo h exposu e imes a e he same, he model will p edic 60 coun s
o all bins (as equi ed), excep o bin 𝑗whe e i will p edic 30 coun s ( he pixel is dead o hal o he exposu e).
Thus, he model has 30 coun s while he da a ha e only 10 coun s. An innocen obse ee migh he e o e hink
he e is an abso p ion line a bin 𝑗 aking awa 20 coun s, bu i is ob ious ha ha is no ue.
Fo his eason, when we combine spec a, we will weigh wi h he exposu e ime o all “no mal” bins, bu when
in some o he da ase s he e is a bad pixel 𝑗, we will use a di e en p ocedu e. In ha case, we look o he
neighbou ing pixels, and assume ha he spec al shape in his local neighbou houd emains he same. F om he
neighbou s wi h comple e da a we can es ima e how much lux he spec a wi h good da a con ibu e o he o al
lux, and we use his ac ion o es ima e wi h wha ac o we should scale he lux measu ed a pixel 𝑗in hese
good da a se s, o ob ain he bes es ima e o he lux a pixel 𝑗 o he o al spec um.
This p ocedu e gi es eliable esul s as long as he spec al shape does no change locally; as he e is less exposu e
a pixel 𝑗, only he e o ba on he lux will be la ge .
When he e is eason o suspec ha he bad pixel is a he loca ion o a spec al line ha changes in equi alen
wid h, his p ocedu e canno be applied!
To alle ia e his p oblem, he use has o en e a minimum exposu e ac ion. I his alue is ze o, o spec a wi h
cons an shape he bes esul is ob ained. On he o he hand, i his alue is 1, only bins will be included ha ha e
no bad pixel in any o he obse a ions ha a e combined. Ad an age in ha case is ha he e is no bias in he
s acked spec um, bu a disad an age may be ha a signi ican pa o he spec um may be los nea impo an
diagnos ic lines (in pa icula o he mul i-poin ing mode).
Due o he binning and andomisa ion p ocedu es wi hin he SAS ask gs luxe , i is s ill possible ha despi e
ca e ul sc eening on bad pixels, a ew bad pixels emain in he luxed spec um, o en adjacen o close o disca ded
pixels. Fo his eason, he p esen p og am checks o any bins ha a e mo e han 3𝜎below hei igh o le
neighbou ing bin ( aking he s a is ical e o s in bo h in o accoun ). Typically, he algo i hm inds a ew addi ional
bad pixels in an indi idual obse a ion ha is disca ded o combina ion.
The p og am u he allows o apply wo o he co ec ions (bo h a e done in he same s ep). The i s co ec ion
is an e ec i e a ea co ec ion. In e y high signal o noise da a, he e a e b oadband lux di e ences be ween
RGS1 and RGS2 and i s and second o de spec a, in some pa s o he spec um, a he ew pe cen le el. A
simpel model has been p oduced o co ec o his, in he sense ha when RGS1 and RGS2 a e combined, he ue
spec um is assumed o be he a e age o bo h. The co ec ion is based on he moni o ing campaign on M k 509,
aken in 2009, and is ound o be consis en wi h a la ge da a se o M k 421 spec a ha a e p esen in he a chi e.
Local con inuum i s o spec al bands ha a e poo o lines yield in gene al 𝜒2 alues ha a e oo low. This is an
a i ac o he SAS p ocedu es ela ed o he ebinning o he da a. Da a ha e o be binned om he de ec o pixel
g id o he ixed wa eleng h g id ha we use in ou analysis. The bin bounda ies o bo h g ids do no ma ch. As a
consequence o his p ocess, he na u al Poissonian luc ua ions on he spec um as a unc ion o de ec o pixel a e
dis ibu ed o e he wa eleng h bin coinciding mos wi h he de ec o pixel and i s neighbou s. In addi ion, he e
is a small smoo hing e ec caused by poin ing luc ua ions o he sa elli e. Due o his empe ing o he Poissonian
luc ua ions, 𝑐ℎ𝑖2 alues will be lowe o a “pe ec ” spec al i .
We ha e quan i ied he e ec by i ing a linea model 𝐹𝜆=𝑎+𝑏𝜆 o luxed spec a in ela i ely line-poo spec al
egions, in 1 Å wide bins in he 7–10, 17–18 and 35–38 Å anges. The median educed 𝜒2is 0.72, wi h a 67 %
con idence ange be ween 0.65 and 0.79.
The ebinning p ocess conse es he numbe o coun s, hence he nominal e o ba s (squa e oo o he numbe o
coun s) a e p ope ly de e mined. The lowe educed 𝜒2is caused by he smoo hing e ec on he da a. Fo co ec
in e ences abou he spec um, such a bias in 𝜒2is no app op ia e. As we canno change he obse ed lux alues,
we op o mul iply he nominal e o s on he luxes by √︀(0.72) = 0.85, in o de o ge ge accep able i s o ideal
da a and models.
5.6. RGS_ luxcombine 255
SPEX Help Cen e Documen a ion, Release 3.08.02
5.6.2 Op ion 2: combine spec a o RGS1, RGS2 and i s and second o de o
bo h (4 spec a) in o one spec um
This p ocedu e is simila o op ion 1, bu wi h some di e ences.
No co ec ions o e ec i e a ea o binning bias a e allowed he e, as his should be aken in o accoun in he s eps
ha use op ion 1. In case he e is only one obse a ion, he p esen p og am can also be un wi h only one spec um
o op ion 1, o ge he e ec i e a ea and binning co ec ions in.
Fu he , he spec a a e no combined acco ding o exposu e ime ( ha should be in gene al almos he same o
RGS1 and RGS2), bu acco ding o signal o noise a io a each bin. Reason is ha o eh he second o de spec a
ha e poo e s a is ics han he i s o de spec a, hence hey should be weigh ed less in he combined spec a.
Spec a c ea ed wi h gs luxcombine can only be i ed using 𝜒2s a is ics. C-s a is ics will p oduce w ong alues.
5.7 RGS_ ma
P og am RGS_ ma p oduces a esponse ma ix o a luxed spec um c ea ed by he XMM-New on SAS ask
gs luxe .
The use should p o ide an FITS ile ha is he ou pu o he gs luxe p og am. Tha p og am mus be un wi h
3600 equidis an wa eleng h bins be ween 4 and 40 Å. The p og am akes his luxed spec um, and c ea es a
esponse ma ix wi h e ec i e a ea 1 m2 o each wa eleng h, and a edis ibu ion unc ion no malised o uni y o
each wa eleng h.
This edis ibu ion unc ion is sligh ly di e en o RGS1 and RGS2, and also di e en o he second o de spec a.
Hence, he use mus p o ide RGS_ ma he in o ma ion abou which RGS and spec al o de is used.
In addi ion, i is also possible o make a single esponse ma ix o combined RGS1 and RGS2 da a, i s and
second o de . In his case, i s he p og am RGS_ luxcombine mus ha e been un wi h op ion=2. Tha p og am
hen c ea es he gs luxe -compa ible ile, wi h he addi ion o ou ex a columns, con aining o each wa eleng h
he ela i e weigh o he di e en ins umen /o de o he o al spec um. These weigh s a e used o weigh he
edis ibu ion unc ions in he combined spec a.
The edis ibu ion unc ion has been pa ame ised as he sum o h ee ( i s o de ) o 4 (second o de ) Gaussians,
wi h wa eleng h-dependen wid h and ela i e no malisa ions. These pa ame isa ions ha e been ob ained by i ing
he “ ue” edis ibu ion unc ion as i is in SAS in 2014 a e ha ing e-in es iga ed he RGS line-sp ead- unc ion
by he RGS conso ium.
The model ene gy g id used o he ma ix has a uni o m spacing o 1/9 h o he ins umen al FWHM, app oxin-
ma ed he e simply by 0.06/|𝑚|, whe e 𝑚is he spec al o de . The ma ix is ully -compa ible, in he sense ha i
also uses he de i a i es o he ma ix wi h espec o ene gy o ge he mos accu a e esul s. The e is no way back
om his o OGIP- yps spec a!
Wa ning: The edis ibu ion unc ion is limi ed o ±1 Å a ound he cen al wa eleng h. Fo mos con inuum
and abso p ion line spec a his is su icien . In a ew a e cases o e y b igh emission line sou ces, he use is
ad ised o compa e he esul ing i wi h a di ec i using he o iginal SAS esponse ma ices and spec al iles.
The ma ix is much smalle : he combined RGS ma ix has a size o 8.2 Mby e. This should be compa ed o he
o al size o he ou ma ices in OGIP o ma , which is o e 200 Mby e.
256 Chap e 5. Addi ional ools
SPEX Help Cen e Documen a ion, Release 3.08.02
5.8 U ospex
Many op ical/UV spec a a e deli e ed wi hou a esponse ma ix. Hubble COS spec a, o example, a e deli e ed
as da a/e o poin s on a wa eleng h g id. To include hese spec a in a SPEX i , a esponse ma ix wi h a gi en
spec al esolu ion should be c ea ed. U ospex is a ool o ans o m such op ical spec a in o SPEX o ma .
No e: Some UV/op ical ins umen s do p o ide esponse ma ices, o example XMM-New on OM and Swi
UVOT. Please see his h ead o impo Impo UV/Op ical da a (page 47).
To c ea e a spec um in SPEX o ma om UV/Op ical g a ing da a, he spec um needs o be s o ed in a ex ile
wi h h ee columns. The u ospex p og am shows he o ma when opening:
You inpu spec al ile should ha e 3 columns:
Column 1: wa eleng h in Angs om
Column 2: lux in e gs/cm^2/s/Angs om
Column 3: lux e o in same uni s
En e inpu ile name spec um: cos. x
The p og am i s asks o he ascii ile name con aining he spec um. Then he ou pu ile name o he spo ile
needs o be p o ided:
En e ile name ou pu spec um (wi h .spo): cos.spo
To be able o c ea e a esponse ma ix o he spec um, he spec al esolu ion o he ins umen needs o be known.
U ospex asks o he esolu ion in uni s o km/s (FWHM):
En e spec al esolu ion (km/s):
I is assumed ha his esolu ion in km/s is cons an o e he en i e spec al ange. Finally, he name o he ou pu
esponse ile should be en e ed:
En e ile name ou pu esponse (wi h . es):
The esul should be a . es and .spo ile con aining he UV spec um ha can be ead in o SPEX.
5.9 Calling SPEX om Fo an
5.9.1 Goal
Some imes you may wan o combine SPEX wi h some o you own code. Fo ins ance, you may ha e a hyd o-
dynamical code calcula ing he e olu ion o a clus e o galaxies o a supe no a emnan , and you wan SPEX o
calcula e he co esponding spec um. O you need o make ealis ic simula ions o a la ge sample o sou ces o
a b oad ange o pa ame e s. In ha case i can be use ul o call SPEX om a o an p og am.
5.8. U ospex 257

SPEX Help Cen e Documen a ion, Release 3.08.02
5.9.2 Solu ion
The basic low o he solu ion is as ollows:
•S a you o an p og am and calcula e wha e e is needed
•c ea e a command ile o SPEX
•call SPEX h ough a sys em call
• ead he ou pu o SPEX
•con inue wi h you p og am
To explain how you can do his, we gi e below a sample Fo an 90 p og am. The p og am i s c ea es a
command ile called spex.com ha con ains he inpu o he un wi h SPEX. In you case, you can eplace he
“/op /spex/bin/spex” o wha e e pa h is app op ia e o you o call SPEX. The “<<STOP” is essen ial o linux
o ell when he inpu s eam is inished.
In he command ile, i ells how o ead he pn spec um o a clus e o galaxies wi h oughly me allici y 0.3,
empe a u e 2 keV, edshi 0.01 and Galac ic o eg ound abso p ion o 1024 m−2. I igno es da a a he lowes
and highes ene gies, se s he ini ial model and pa ame e s o SPEX. I will hen pe o m a i wi h SPEX. Nex
we ell SPEX o open an ou pu ile named “spex.ou ”, ha will con ain he esul s o he nex pa o he SPEX
un, an e o sea ch on he empe a u e. No e also ha we ha e se -up he plo ing de ice o “null”, o speed up
he calcula ion (bu implying ha you do no ge o see he i i sel , so use wi h ca e). A e he e o un, we s op
SPEX, i s by w i ing he “qui ” command o SPEX and hen he end o inpu signal “STOP” o linux. Nex we
simply close he command ile spex.com.
The o an p og am hen con inues by making spex.com execu able, and hen by execu ing ha ile, he eby doing
he un wi h SPEX. When SPEX is inished, o an akes o e con ol again and eads he spex.ou ile c ea ed by
SPEX. The p og am g abs any in o i needs om ha ile (he e he e o s on he empe a u e) and hen closes he
ile.
As a las s ep, he in e media e ou pu ile “spex.ou ” is dele ed, as we do no need i longe .
eal nh,z,
cha ac e *128 s
z = 0.01 ! edshi 0.01
nh = 1e-4 !1E20 cm**-2 abso p ion column densi y (SPEX uses uni s o 1E28 m**-2)
= 2 ! empe a u e 2 keV
open(uni =12, ile='spex.com',s a us=' eplace') !open a spex command ile called␣
˓→spex.com
w i e (12,'("/us /local/bin/spex <<STOP")') !call spex
w i e (12,'("abu lodde s")') !se abunances o Lodde s scale
w i e (s,'("dis ", 6.4," z")') z
w i e (12,'(a)') im(s) !w i e he dis ance
w i e (12,'("da a pn pn)') ! ead some spex da a se : pn. es &␣
˓→pn.spo
w i e (12,'("ign in 1 1 1:60")') !igno e i s 60 channels
w i e (12,'("ign in 1 12:10000 u ke ")') !igno e E>12 keV egion
w i e (12,'("com cie")') !de ine a CIE componen
w i e (12,'("com eds")') !de ine a edshi componen
w i e (12,'("com abs")') !de ine galac ic abso p ion
w i e (12,'("com el 1 2,3")') !couple he componen s
w i e (s,'("pa 1 2 z ", 6.4)') z
w i e (12,'(a)') im(s) !se he edshi
w i e (s,'("pa 1 3 nh ",1pe12.3)') nh
w i e (12,'(a)') im(s) !se he galac ic abso p ion
w i e (12,'("pa 1 3 nh s ")') ! eeze NH
w i e (12,'("pa 1 1 06:28 0.3")') !se abundances o C o Ni o 0.3␣
(con inues on nex page)
258 Chap e 5. Addi ional ools
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
˓→ ime sola
w i e (s,'("pa 1 1 ", 5.2)')
w i e (12,'(a)') im(s) !se he empe a u e
w i e (12,'(" i me h cs a ")') !use C-s a is ics o i ing
w i e (12,'("plo de null")') !no isible plo s
w i e (12,'("plo ype da a")') !plo ype da a
w i e (12,'(" i p in 1")') !show each i ing s ep
w i e (12,'(" i ")') !do a i
w i e (12,'("e dchi 1.")') ! o e o sea ch, do Del a chi**2␣
˓→= 1
w i e (12,'("log ou spex o")') !open a ile o he SPEX ou pu
! ile will be called "spex.ou "
! he op ion "o" means o e w i e
w i e (12,'("e 1 1 ")') !do an e o sea ch on T
w i e (12,'("qui ")') !done wi h he spex un, so qui
w i e (12,'("STOP")') !las command needed o close he␣
˓→command ile
close (12) !close he ile spex.com and sa e
call sys em("chmod +x spex.com") !make ile spex.com execu able
call sys em("spex.com") !execu e he ile spex.com
open (uni =12, ile='spex.ou ',s a us='old') !open he ou pu ile spex.ou
do k = 1,100000 !loop o e all he lines in his␣
˓→ ile
ead (12,'(a)',end=20) s ! ead he ex o he line; pu i ␣
˓→in s ing s
i (s(2:11).eq."Pa ame e :") hen !sea ch o he line wi h ex ␣
˓→Pa ame e :
ead (s(34:),*) e1,e2 ! ead om his line he e o s on T
e = 0.5 * (-e1 + e2) !calcula e a e age pos and neg e o
!..... do u he all you wish
endi
enddo !close loop o e lines ile spex.ou
20 close(12) !close spex.ou
call sys em(" m spex.ou ") ! emo e he ile spex.ou
end
5.10 Linid
Linid is a u ili y o displaying spec al line lis s wi hou s a ing a ull SPEX session. I can ope a e in wo modes. In
he i s mode, i e u ns de ailed in o ma ion on he s onges ansi ions o a use -speci ied elemen and ioniza ion
s age. In he second mode, i lis s all ansi ions wi hin a use -de ined ene gy in e al.
Fo each ansi ion, he ool p o ides he elemen , cha ge s a e, Rydbe g s a e, empi ical iden i ie , ene gy, wa e-
leng h, and ansi ion p obabili y.
No e: The cu en implemen a ion includes all isoelec onic sequences om H-like down o B-like ions. I only
con ains K-shell ansi ions in he Rydbe g se ies. Fo a comple e lis , please un a SPEX session.
5.10. Linid 259
SPEX Help Cen e Documen a ion, Release 3.08.02
5.10.1 Example
The i s example is o lis he Ne X Rydbe g lines:
A omic numbe and spec oscopic cha ge (e.g., 8 8 o O VIII), o E and dE in keV (1.
˓→0 0.1):
10 10
Nex , o display all he eco ded ansi ions in he 0.1 keV ange a ound a cen al ene gy o 6.6 keV:
A omic numbe and spec oscopic cha ge (e.g., 8 8 o O VIII), o E and dE in keV (1.
˓→0 0.1):
6.6 0.1
260 Chap e 5. Addi ional ools
CHAPTER
SIX
PYTHON INTERFACE
Welcome o he documen a ion o PYSPEX, he Py hon in e ace o SPEX. Since e sion 3.06.00 we p o ide a
Py hon in e ace laye o he SPEX p og am. This documen a ion sec ion explains how o use his in e ace, which
is an al e na i e o he s anda d command-line in e ace o SPEX.
No e: As an al e na i e o some auxillia y p og ams o SPEX (e.g. a o), we o e a sepa a e Py hon package
called pyspex ools. Please see he Pyspex ools documen a ion o mo e in o ma ion.
6.1 Basic commands
6.1.1 Basic usage o PYSPEX
The PYSPEX py hon module o e s a py hon in e ace o he SPEX p og am. This means ha you can use SPEX
di ec ly ei he in in e ac i e py hon mode and in py hon sc ip s. In his sho u o ial, we assume you a e using
PYSPEX in in e ac i e mode.
The s uc u e o PYSPEX is chosen such ha o many SPEX commands, he e is an equi alen class in PYSPEX.
These classes con ain he unc ions ha copy he unc ionali y o he SPEX command, and i applicable, he classes
con ain also he ou pu pa ame e s o he SPEX command. This makes i easy o inco po a e he SPEX esul s inside
you own p og am.
In addi ion o he classes, you can also simply send a SPEX command-line command using he command unc ion
(see Sec ion below).
S a a PYSPEX session
Fo his example PYSPEX session in py hon, we use he in e ac i e mode o py hon. We simply s a py hon om
he Linux command line (making su e ha he en i onmen is se using a spexdis sc ip loca ed in he SPEX ins all
di ec o y):
linux:~> sou ce spex/spexdis .sh
linux:~> py hon
Py hon 2.7.13
Type "help","copy igh ","c edi s" o "license" o mo e in o ma ion.
>>>
I he PYTHONPATH a iable is co ec ly se , we should now be able o impo spex om pyspex:
>>> om pyspex impo spex
F om he e, we can s a a SPEX session easily:
261
SPEX Help Cen e Documen a ion, Release 3.08.02
>>> s.simula e(1E+5, ins ='1:3', bnoise=T ue, seed=42)
Model ela ed commands
A SPEX model is o ganised in sec o s and componen s. Sec o s a e g oups o componen s ha model a pa icula
sou ce o adia ion. Below, he basic commands o building he model and change i s pa ame e s a e lis ed.
Abundance
The sola abundance able used is se in SPEX using he abundance command. In PYSPEX, his is abb e ia ed
o abun. The desi ed abundance able should be loaded by p o iding he abb e ia ion o he able (abunse ):
Session.abun(abunse )
Se he abundance able in SPEX. The abunse pa ame e is one o ‘ ese ’, ‘ag’, ‘allen’, ‘asplund’,
‘ a’, ‘g e esse’, ‘gs’, ‘lodde s’, and ‘sola ’.
Pa ame e s
abunse (s ) – S ing ep esen ing he abundance se used in SPEX.
Re u ns
Objec con aining he abundance class.
Re u n ype
pyspex.model.Abundance (page 314)
The possible abundance ables a e:
• ese : Lodde s e al. (2009)
•allen: Allen (1973)
• a: Ross & Alle (1976)
•g e esse: G e esse e al. (1992)
•gs: G e esse & Sau al (1998)
•lodde s: Lodde s p o o-Sola (2003)
•sola : Lodde s Sola Pho osphe ic (2003)
•ag: Ande s & G e esse (1989)
•asplund: Asplund e al. (2009)
The abun command e u ns an objec wi h he abundance in o ma ion, which can op ionally be assigned o a
pa ame e and be accessed h ough Py hon. See he ad anced class desc ip ions o de ails.
Fo example:
>>> a=s.abun('asplund')
>>> di (a)
['__doc__','__ini __','__module__','ge ','index','lis ',' e ','se ','upda e']
268 Chap e 6. Py hon In e ace

SPEX Help Cen e Documen a ion, Release 3.08.02
Abundance show
To show he cu en abundance able, use he abun_show me hod:
Session.abun_show()
Show he cu en ionisa ion balance.
Re u ns
Re e ence o he used ionisa ion balance.
Re u n ype
s
The me hod e u ns he e e ence as a ex s ing:
>>> ab =s.abun_show()
Lodde s e al. (2009)
>>> p in (ab)
Lodde s e al. (2009)
Ae o
Calcula e he unce ain ies o se e al pa ame e s o a model componen due o he unce ain ies in he a omic da a.
Session.ae o (isec ,icomp,name,shell=0)
Command o calcula e he unce ain y in a model pa ame e due o he unce ain ies in he a omic
da a.
Pa ame e s
•isec (in ) – Sec o numbe o he componen .
•icomp (in ) – Componen numbe .
•name (s ) – Pa ame e name.
•shell (in ) – Shell numbe o calcula ion (L-shell = 1, K-shell = 2)
Re u ns
The a omic unce ain y o he selec ed pa ame e .
Re u n ype
loa
Example:
>>> ae =s.ae o (1,1,'no m')
>>> ae =s.ae o (1,1,'26',shell=1)
Calcula e
Once he model sec o s and componen s a e se -up and he pa ame e s a e se , he model spec um can be calcula ed
using he SPEX calcula e command. Fo con enience, his command has been abb e ia ed o calc in PYSPEX.
Session.calc()
Calcula e he cu en model.
Example:
>>> s.calc()
6.1. Basic commands 269
SPEX Help Cen e Documen a ion, Release 3.08.02
Componen s
Spec al componen s, like powe laws, he mal and abso p ion models a e loaded using he SPEX comp command.
Since he command is o en yped simply as com in p ac ice, he PYSPEX command is also com:
Session.com(name,isec =1)
Add model componen .
Pa ame e s
•name (s ) – Name o he model componen , o example ‘ eds’, ‘ho ’, ‘cie’, e c.
•isec (in ) – Sec o numbe o add componen o (de aul is sec o 1).
The command adds a componen by de aul o sec o 1. I he componen should be added o a di e en sec o ,
hen please use he op ional isec pa ame e o speci y he a ge sec o .
Fo example:
>>> s.com('cie')
>>> s.com('po', isec =2)
See he SPEX e e ence manual o a lis o spec al componen s.
Componen dele e
Dele ing a componen om he model is done using he sec o and componen numbe o he componen .
Session.com_del(isec ,icomp)
Dele e componen om model.
Pa ame e s
•isec (in ) – Sec o numbe o he componen o dele e.
•icomp (in ) – Componen numbe o dele e.
Fo example:
>>> s.com_del(1,1)
The command abo e dele es he i s componen in sec o numbe 1.
Componen ela e
The ela ion be ween he addi i e and mul iplica i e componen s is se wi h a com el command in SPEX. In
PYSPEX his is:
Session.com_ el(isec ,icomp, el)
Rela e model componen s.
Pa ame e s
•isec (in ) – Sec o numbe o he componen o ela e.
•icomp (in ) – Componen numbe o ela e.
• el (numpy.nda ay) – A ay con aining he mul iplica i e componen num-
be s coun ed om he sou ce o he obse e .
The ela ions a e se pe componen (so no anges, un o una ely) and he ela ed mul iplica i e models should be
en e ed (in he igh o de ) using a numpy a ay. Fo example:
270 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
>>> s.com(' eds')
>>> s.com('ho ')
>>> s.com('cie')
>>> s.com_ el(1,3, numpy.a ay([1,2]))
Dis ance
To calcula e luxes and luminosi ies, SPEX needs an assumed dis ance o he sou ce. In SPEX his is done wi h
he dis ance command. In PYSPEX his is abb e ia ed o dis o con enience.
The dis ance can be se wi h he dis command:
Session.dis (isec ,dis ,uni )
Se he dis ance in SPEX.
Pa ame e s
•isec (in ) – Sec o numbe .
•dis ( loa ) – Dis ance alue.
•uni (s ) – The uni o he dis ance alue, o example: ‘m’, ‘au’, ‘ly’, ‘pc’,
‘kpc’, ‘mpc’, ‘z’, ‘cz’
whe e isec is he sec o numbe , dis he dis ance ( loa ) and uni he uni o he dis ance ha is pu in. The
unc ion e u ns an objec con aining he dis ance in all a ailable uni s.
Examples:
>>> d=s.dis (1,0.5,'z')# Redshi o z=0.5
>>> d=s.dis (1,2.0,'kpc')# Dis ance o 2 kilopa sec
>>> di (d)
['__doc__','__ini __','__module__','age','au','cz','ge ','h0','kpc','ly','m
˓→','mpc','omega_l','omega_m','omega_ ','pc','se ','se _cosmo','z']
I you do no wan o se he dis ance, bu jus ge he cu en pa ame e s, he dis _ge command can be used:
Session.dis _ge (isec )
Ge he cu en dis ances in SPEX.
Pa ame e s
isec (in ) – Sec o numbe .
Like he dis command, his me hod e u ns an objec wi h he dis ances in all a ailable uni s.
Cosmology
Nex o he dis ance, he cosmology used by SPEX can also be speci ied. In SPEX all pa ame e s should be p o ided
h ough sepe a e lines, bu in PYSPEX his has been combined in one command:
Session.dis _cosmo(h0,omega_m,omega_l,omega_ )
Se he cosmology o he dis ance calcula ion.
Pa ame e s
•h0 ( loa ) – Hubble cons an (km/s/Mpc).
•omega_m ( loa ) – Omega ma e .
•omega_l ( loa ) – Omega lambda.
•omega_ ( loa ) – Omega R.
6.1. Basic commands 271
SPEX Help Cen e Documen a ion, Release 3.08.02
The commands needs alues o he Hubble cons an h0 (70 km/s/Mpc), Omega Ma e omega_m (0.3), Omega
Lambda omega_l (0.7) and Omega R omega_ (0.0). Fo example:
>>> s.dis _cosmo(75,0.33,0.67,0.0)
(The command will w i e he dis ances 4 imes o he e minal since in he backg ound all SPEX commands a e
execu ed sepa a ely...)
Ene gy g id
The model ene gy g id can be manipula ed wi h he SPEX eg id command. In PYSPEX, his command has been
spli ed in o wo a ie ies:
Session.eg id(elow,ehigh,nbins,uni ,log)
Eg id command when he numbe o desi ed bins is known.
Pa ame e s
•elow ( loa ) – Lowes ene gy/wa eleng h o ene gy g id.
•ehigh ( loa ) – Highes ene gy/wa eleng h o ene gy g id.
•nbins (in ) – Numbe o bins o ene gy g id.
•uni (s ) – Uni o he ene gy/wa eleng h ange, o example: ‘ke ’, ‘e ’,
‘ yd’, ‘j’, ‘hz’, ‘ang’, ‘nm’
•log (bool) – Make he ene gy g id loga i hmic (T ue o False)
Session.eg id_s ep(elow,ehigh,s ep,uni ,log)
Eg id command when he s epsize o he g id is known.
Pa ame e s
•elow ( loa ) – Lowes ene gy/wa eleng h o ene gy g id.
•ehigh ( loa ) – Highes ene gy/wa eleng h o ene gy g id.
•s ep ( loa ) – S ep size o he ene gy g id.
•uni (s ) – Uni o he ene gy/wa eleng h ange, o example: ‘ke ’, ‘e ’,
‘ yd’, ‘j’, ‘hz’, ‘ang’, ‘nm’
•log (bool) – Make he ene gy g id loga i hmic (T ue o False)
Fo he i s me hod, eg id, he numbe o spec al bins nbins is known, while o eg id_s ep he s ep size
(s ep) is an inpu alue. The lowes and highes ene gy o he g id needs o be p o ided using he elow and ehigh
inpu alues. The uni is a ex s ing and he g id can be loga i hmic i he log pa ame e is se o T ue.
Examples:
>>> s.eg id(0.1,10.,9990,'ke ',T ue)
>>> s.eg id_s ep(0.1,10.,0.01,'ke ',False)
272 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
Reading & sa ing g ids
G ids can also be sa e and ead om a ex ile. The wo me hods below sa e and ead a .eg ile, espec i ely:
Session.eg id_sa e(sa e ile)
Sa e ene gy g id o ile.
Pa ame e s
sa e ile (s ) – Filename o sa e he ene gy g id o (including .eg ex ension)
Session.eg id_ ead( ead ile)
Read ene gy g id om ile.
Pa ame e s
ead ile (s ) – Filename o ead he ene gy g id om (including .eg ex ension)
The sa e ile o ead ile pa ame e should p o ide he me hod wi h he ilename o sa e o ead, including he
.eg ex ension! I necessa y, he ull pa h o he ile can be included.
Examples:
>>> s.eg id_sa e('myg id.eg ')
>>> s.eg id_ ead('myg id.eg ')
Ge & se cus om g ids
I he g id needs o be ans e ed om o o Py hon memo y, hen he ge and se me hods can be used:
Session.eg id_ge ()
Ge he ene gy g id and e u n he g id as an objec .
Re u ns
An Eg id objec om pyspex.
Re u n ype
pyspex.model.Eg id (page 315)
Session.eg id_se (ebounds)
P o ide a g id o SPEX by p o iding a numpy a ay wi h he bin bounda ies. Please no e ha
he leng h o his a ay is he numbe o bins + 1!
Pa ame e s
ebounds (numpy.nda ay) – A ay con aining he ene gy bounda ies o he new
ene gy g id.
The ge ou ine e u ns a Py hon objec wi h he eg id a ays. The se ou ine equi es an ebounds numpy a ay
con aining he ene gies o he bin bounda ies. No e ha he numbe o elemen s o his a ay would be o leng h n
+ 1, whe e n is he numbe o bins in he a ay.
Examples:
>>> g id =s.eg id_ge ()
>>> ebounds =0.1 +0.01 *numpy.a ange(9991, d ype= loa )
>>> s.eg id_se (ebounds)
6.1. Basic commands 273

SPEX Help Cen e Documen a ion, Release 3.08.02
Flux & Luminosi y
Fo each componen , he luxes and luminosi ies a e calcula ed using he se dis ance and ene gy bounda ies. These
ene gy limi s o he lux and luminosi y can be se using he elim command:
Session.elim(elow,ehigh,uni )
Se he ene gy limi s o lux ou pu .
Pa ame e s
•elow ( loa ) – Lowes ene gy/wa eleng h o ene gy in e al.
•ehigh ( loa ) – Highes ene gy/wa eleng h o ene gy in e al.
•uni (s ) – Uni o he ene gy/wa eleng h in e al, o example: ‘ke ’, ‘e ’,
‘ yd’, ‘j’, ‘hz’, ‘ang’, ‘nm’.
whe e elow is he lowe bounda y o he lux and ehigh he highe bounda y. The uni de e mines he uni s o
he inpu alues, o example ‘ke ’ o keV.
Examples:
>>> s.elim(13.6E-3,13.6,'ke ')
Ge lux
The luxes and luminosi ies calcula ed in SPEX can be ex ac ed using he lux_ge me hod.
Session. lux_ge (isec ,icomp)
Ge he luxes and luminosi ies o componen icomp in sec o isec .
Pa ame e s
•isec (in ) – Sec o numbe o he componen o ob ain he lux om.
•icomp (in ) – Componen numbe o ob ain he lux om.
Re u n lux
A Flux objec om pyspex.
R ype lux
pyspex.model.Flux
The alues a e e u ned in a py hon objec so ha hey can be accessed easily:
>>> lx =s. lux_ge (1,1)
>>> p in lx.ene lux
1.51011622912e-18
Fo he de ails abou he con en s o he objec , see he ad anced class desc ip ion o he Fluxes class.
Ionisa ion balance
The e a e se e al ionisa ion balances a ailable in SPEX. The U dampille a ionisa ion balance is he cu en de aul
se .
The ionisa ion balance can be se using he ibal me hod:
Session.ibal( e )
Se he ionisa ion balance.
Pa ame e s
e (s ) – Abb e ia ion o he e e ence o he ionisa ion balance.
274 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
The e is he sho ex s ing desc ibing he pape e e ence o he ionisa ion balance:
•a 92: A naud & Raymond (1992) o Fe, A naud & Ro hen lug (1985) o o he elemen s.
•a 85: A naud & Ro hen lug (1985).
•oldb yans: Old B yans e al. da a (NOT ecommended).
•b yans09: B yans e al. (2009).
•u17: U dampille a e al. (2017).
Examples:
>>> s.ibal('u17')
Show
To show he cu en ionisa ion balance, he ibal_show me hod can be used:
Session.ibal_show()
Show he cu en ionisa ion balance.
Re u ns
Re e ence o he used ionisa ion balance.
Re u n ype
s
This me hod e u ns he e e ence o he ionisa ion balance as a s ing.
Example:
>>> ib =s.ibal_show()
U dampille a e al. (2017)
Ion selec ion
In o iginal SPEX models ha use he SPEX a omic da a, ions can be u ned on o o , o can be calcula ed using
he old SPEX e sion 2 o he new SPEX e sion 3. In addi ion, he maximum p inciple quan um numbe (nmax)
and he maximum angula momen um (lmax) can be se .
The unc ions ha e been c ea ed such ha each unc ion selec s he ions ei he by a omic numbe , iso-elec onic
sequence o ion.
Session.ions_all(pa , alue)
Se pa ame e o all alues.
Pa ame e s
•pa (s ) – Pa ame e name o se , e.g.: ‘use’, ‘new’, ‘nmax’, ‘lmax’.
• alue (bool o in ) – Value o se .
Session.ions_iso(iso,pa , alue)
Se pa ame e o an iso-elec onic sequence.
Pa ame e s
•iso (in ) – Iso-elec onic sequence numbe
•pa (s ) – Pa ame e name o se , e.g.: ‘use’, ‘new’, ‘nmax’, ‘lmax’.
• alue (bool o in ) – Value o se .
6.1. Basic commands 275
SPEX Help Cen e Documen a ion, Release 3.08.02
Session.ions_z(z,pa , alue)
Se pa ame e o an a om.
Pa ame e s
•z(in ) – A omic numbe o he elemen .
•pa (s ) – Pa ame e name o se , e.g.: ‘use’, ‘new’, ‘nmax’, ‘lmax’.
• alue (bool o in ) – Value o se .
Session.ions_ion(z,i,pa , alue)
Se pa ame e o a speci ic ion.
Pa ame e s
•z(in ) – A omic numbe o he elemen .
•i(in ) – Ionisa ion s age (in as ophysical no a ion, e.g. 1, 2, 3, e c.)
•pa (s ) – Pa ame e name o se , e.g.: ‘use’, ‘new’, ‘nmax’, ‘lmax’.
• alue (bool o in ) – Value o se .
Show
The ion selec ions can be shown by calling he ions_show unc ion below:
Session.ions_show()
Show he ions in use and wi h which pa ame e s.
Line selec ion
Up o 10 speci ic lines can be ‘mu ed’ using he ions_line unc ion below:
Session.ions_line(z,i,lid,add)
Mu es o unmu es a spec al line om an emission spec um.
Pa ame e s
•z(in ) – A omic numbe o he elemen .
•i(in ) – Ionisa ion s age (in as ophysical no a ion, e.g. 1, 2, 3, e c.)
•lid – Line ID numbe (see ascdump_line o he line ID numbe ).
•add – I False, he line is no added o he spec um. T ue will add he line o he spec um
again.
Se ing pa ame e s
Model pa ame e s in SPEX a e se using he pa command. Since his command has subcommands, he e a e a
numbe o me hods o co e mos o he unc ionali y in PYSPEX. The mos basic unc ion is o se a pa ame e
alue and de e mine whe he i should be ee in he i o hawn. These unc ions ha e been combined in o one:
Session.pa (isec ,icomp,name, alue, hawn=False)
Se pa ame e alue and s a us.
Pa ame e s
•isec (in ) – Sec o numbe o he pa ame e .
•icomp (in ) – Componen numbe o he pa ame e .
•name (s ) – Pa ame e name.
276 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
• alue ( loa ) – New alue o he pa ame e .
• hawn (bool) – (Op ional) Should he pa ame e be ee (T ue) o ozen (False).
Session.pa _ ex (isec ,icomp,name, alue)
Se ex ype pa ame e alue.
Pa ame e s
•isec (in ) – Sec o numbe o he pa ame e .
•icomp (in ) – Componen numbe o he pa ame e .
•name (s ) – Pa ame e name.
• alue (s ) – New alue o he pa ame e .
The pa me hod is used o se ing nume ical alues. I needs he sec o numbe (isec ), componen numbe (icomp)
and he name o he pa ame e (name) o se . Op ionally, he pa ame e can be se ee by se ing hawn o T ue.
Fo ex alues, like ilenames o model inpu iles, he pa _ ex me hod is used. The usage is e y simila o he
pa me hod, bu jus wi h he di e ence a ex s ing is passed ins ead o a alue. Tex pa ame e s canno be ee
pa ame e s as well.
Examples:
>>> s.pa (1,1,'no m',1E+8, hawn=T ue)
>>> s.pa _ ex (1,1,' ile','dis .da ')
Fix & F ee pa ame e s
Many imes, we wan o ix and ee pa ame e s wi hou changing he alues. Fo his pu pose, wo con enience
unc ions ha e been c ea ed:
Session.pa _ ix(isec ,icomp,name)
Fix a model pa ame e du ing he i .
Pa ame e s
•isec (in ) – Sec o numbe o he pa ame e .
•icomp (in ) – Componen numbe o he pa ame e .
•name (s ) – Pa ame e name.
Session.pa _ ee(isec ,icomp,name)
F ee a model pa ame e du ing he i .
Pa ame e s
•isec (in ) – Sec o numbe o he pa ame e .
•icomp (in ) – Componen numbe o he pa ame e .
•name (s ) – Pa ame e name.
pa _ ix and pa _ ee ix and ee he pa ame e wi h name (name) in sec o (isec ) and componen (icomp).
Examples:
>>> s.pa _ ee(1,1,'26')
>>> s.pa _ ix(1,1,' ')
6.1. Basic commands 277
SPEX Help Cen e Documen a ion, Release 3.08.02
Gene ic algo i hm
Session.dem_gene(pop,gen)
Do DEM analysis using he gene ic algo i hm, using a popula ion size gi en by pop (maximum
alue 1024) and gen is he numbe o gene a ions (no limi , in p ac ice a e abou 100 gene a-
ions no much change in he solu ion. Expe imen wi h hese numbe s o you p ac ical case).
Pa ame e s
•pop (in ) – Popula ion size
•gen (in ) – Numbe o gene a ions
Re u n mul _ able
Table con aining he bes empe a u e componen s and hei emission measu e.
R ype mul _ able
as opy. able.QTable
Re u n chisq
Bes i 𝜒2.
R ype chisq
loa
Fo example:
>>> (chisq, penal y) =s.dem_gene(512,80)
DEM smoo h
Session.dem_smoo h(wid h)
Smoo hes a DEM p e iously de e mined by any DEM me hod using a block il e / He e wid h
is he ull wid h o he il e exp essed in 10 log 𝑇. No e ha his smoo hing will in p inciple
wo sen he 𝜒2o he solu ion, bu i is some imes use ul o “wash ou ” some esidual noise in
he DEM dis ibu ion, p ese ing o al emission measu e.
Pa ame e s
wid h ( loa ) – The ull wid h o he il e exp essed in 10 log 𝑇.
Fo example:
>>> s.dem_smoo h(0.5)
Ge he DEM dis ibu ion in py hon
Session.dem_ge ()
Ge he bes - i DEM dis ibu ion.
Re u n able
Table wi h he DEM dis ibu ion
R ype able
as opy. able.QTable
Fo example:
>>> able =s.dem_ge ()
>>> p in ( able)
The ou pu able has he columns empe a u e (kT), di e en ial emission measu e (DY) and he e o on he emis-
sion measu e (DY_E ), i a ailable.
284 Chap e 6. Py hon In e ace

SPEX Help Cen e Documen a ion, Release 3.08.02
Plo he DEM dis ibu ion
Session.dem_plo (xlog=False,ylog=False)
Plo he DEM dis ibu ion.
Pa ame e s
•xlog (bool) – Make he X-axis loga i hmic.
•ylog (bool) – Make he Y-axis loga i hmic.
Fo example:
>>> s.dem_plo ()
Reading he DEM dis ibu ion om ile
Session.dem_ ead( ile)
Read a DEM dis ibu ion om a ile named #a which au oma ically ge s he ex ension .dem. I is
an ascii ile wi h a leas wo columns, he i s column is he empe a u e in keV and he second
column he di e en ial emission measu e, in uni s o 1064𝑚−3𝑘𝑒𝑉 −1. The maximum numbe
o da a poin s in his ile is 8192. Tempe a u e should be in inc easing o de . The da a will be
in e pola ed o ma ch he empe a u e g id de ined in he dem model (which is se by he use ).
Pa ame e s
ile (s ) – Filename wi hou .dem ex ension.
Fo example:
>>> s.dem_ ead('mydem')
W i ing he DEM dis ibu ion o ile
Session.dem_w i e( ile)
Sa e he DEM o a ile ile wi h ex ension “.dem”. The same o ma as abo e is used o he
ile. A hi d column has he co esponding e o ba s on he DEM as de e mined by he DEM
me hod used (no always ele an o well de ined, exep o he egula iza ion me hod).
Pa ame e s
ile (s ) – Filename wi hou .dem ex ension.
Fo example:
>>> s.dem_w i e('mydem')
Plasma model pa ame e s
The e a e a numbe o se ings o he SPEX plasma models ha can be changed by he use . In SPEX hese a e
done using he a command. The a commands ha e been implemen ed in pyspex h ough he me hods below.
The cu en se ings can be ob ained using he Va class (page 321) which is e e enced in he SPEX session as
s.mod_ a .
6.1. Basic commands 285
SPEX Help Cen e Documen a ion, Release 3.08.02
F ee-bound accu acy
Session. a _gacc( alue)
Se he ee-bound emission accu acy.
Pa ame e s
alue ( loa ) – F ee-bound emission accu acy.
Example:
>>> s. a _gacc(1.0E-2)
Line emission con ibu ions
Session. a _line(l ype,s a us)
Se a line emission con ibu ion on o o .
Pa ame e s
•l ype (s ) – Line emission con ibu ion (‘ex’, ‘px’, ‘ ’, ‘d ’, ‘ds’, ‘ii’, ‘ ese ’)
•s a us (bool) – Boolean indica o whe he con ibu ion is on (T ue) o o
(False).
Example:
>>> s. a _line('ex',False)
Dopple b oadening
Session. a _dopple ( alue)
Dopple b oadening.
Pa ame e s
alue (in ) – Dopple b oadening ype.
Example:
>>> s. a _dopple (1)
SPEXACT e sion 3 calcula ions
Session. a _calc(s a us)
Pe o m SPEXACT 3 line calcula ions.
Pa ame e s
s a us (in ) – Use SPEXACT 2 (0), Quick SPEXACT 3 (1), o SPEXACT 3 (2)
Example:
>>> s. a _calc(T ue)
286 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
Occupa ion numbe s s a ing alues
Session. a _occs a (o ype)
A which occupa ion le el o s a .
Pa ame e s
o ype (s ) – Occupa ion le el (‘g ound’, ‘bol z’, ‘las ’)
Example:
>>> s. a _occs a ('g ound')
SPEXACT e sion 2 se ings (MEKAL)
Session. a _mekal(u ype,s a us)
Swi ch old Mekal upda es on/o .
Pa ame e s
•u ype (s ) – Upda e ype (‘wa ’, ‘ e17’, ‘upda e’, ‘all’)
•s a us (bool) – On (T ue) o o (False)
Examples:
>>> s. a _mekal('wa ',False)
>>> s. a _mekal(' e17',False)
Mul i-Maxwellians o he ionisa ion balance
Session. a _ibalmaxw(s a us)
Swi ch he Mul i-Maxwellians o he ionisa ion balance on/o (T ue/False).
Pa ame e s
s a us (bool) – On (T ue) o o (False)
Example:
>>> s. a _ibalmaxw(False)
SPEXACT e sion 3 cooling
Session. a _newcoolexc(s a us)
Cooling by collisional exci a ion by S o ano a (SPEXACT 3) on/o (T ue/False).
Pa ame e s
s a us (bool) – On (T ue) o o (False)
Example:
>>> s. a _newcoolexc(False)
And o he cooling by di-elec onic ecombina ion:
Session. a _newcoold (s a us)
Cooling by dielec onic ecombina ion (SPEXACT 3) on/o (T ue/False).
Pa ame e s
s a us (bool) – On (T ue) o o (False)
6.1. Basic commands 287
SPEX Help Cen e Documen a ion, Release 3.08.02
Example:
>>> s. a _newcoold (False)
Cha ge exchange ecombina ion and ioniza ion
Se he o igin o he cha ge exchange ecombina ion and ioniza ion a es.
Session. a _cxcon( alue)
Se cha ge exchange ecombina ion and ioniza ion a es acco ding o ei he 1 = A naud & Ro hen-
lug (1985) o 2 = Kingdon & Fe land (1996). De aul is 2.
Pa ame e s
alue (in ) – Recombina ion and ionisa ion a ese . 1 = A naud & Ro hen lug, 2
= Kingdon & Fe land.
Example:
>>> s. a _cxcon(1)
Ascdump commands
The SPEX ascdump command is designed o e u n in e nal model pa ame e s in SPEX h ough e minal ou pu ,
an ASCII ile o a FITS ile. Wi h pyspex we can e u n hese numbe s in a py hon objec , making hem di ec ly
a ailable in you sc ip as an As opy able.
An o e iew o he di e en ascdump ou pu s and an explana ion abou he ac onyms in he ou pu able can be
ound in he sec ion Ascdump: ascii ou pu o plasma and spec al p ope ies (page 91).
The ascdump command
Session.ascdump(isec ,icomp,a ype)
Gene ic ascdump me hod o ob ain he a ious nume ic ou pu s o he spec al models. (see h ps:
//spex-x ay.gi hub.io/spex-help/ e e ence/commands/ascdump.h ml o mo e in o ma ion).
Pa ame e s
•isec (in ) – Sec o numbe o he componen .
•icomp (in ) – Componen numbe .
•a ype (s ) – Ascdump ype
Example:
>>> s.com('cie')
>>> asc =s.ascdump(1,1,'plas')
numbe o laye lines : 4156 0
No selec ion ile used
>>> p in (asc. able)
e ion iba mic cs eden ␣
˓→hden eide ho ed eid denm epla
keV keV keV km / s km / s 1 / m3 1 /␣
˓→m3 1 / m3 kg / m3 keV
------------ ------------ ------------ ------------ ------------ ------------ --------
˓→---- ------------ ------------ ------------ ------------ ------------ ------------
1.000000E+00 1.000000E+00 1.000000E+00 0.000000E+00 5.072631E+02 1.204480E+06 1.
˓→000000E+06 2.302763E+06 2.389693E-21 1.204480E+00 2.302763E+00 1.428711E+00 4.
˓→075277E-14
288 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
Op imiza ion commands
Once he da a ha e been ead in and he model has been se , he model pa ame e s can be op imized o i he da a.
The me hods in his sec ion a e used o he op imiza ion and de e mina ion o he unce ain ies in he i .
Fi
The SPEX command o i is simply i and his has been implemen ed as i in PYSPEX as well:
Session. i (ni e =100)
Fi command.
Pa ame e s
ni e (in ) – (Op ional) Maximum numbe o i e a ions.
This me hod can be called wi hou any a gumen s. Op ionally, he numbe o i e a ion s eps can be gi en, bu his
is only use ul in some pa icula cases. When done i ing, he alues o he i s a is ics can be ound in he objec
s.op _ i . See he Fi () class o de ails.
Examples:
>>> s. i ()
>>> s. i (ni e =50)
Fi esul s
The esul ing C-s a is ics/Chi-squa e alue and deg ees o eedom can be ob ained wi h sepa a e commands:
Session. i _cs a ()
Ge he cu en C-s a is ics om he model.
Re u ns
Tuple con aining he C-s a alue and he deg ees o eedom.
Re u n ype
uple
Session. i _chisq()
Ge he cu en Chi2-s a is ics om he model.
Re u ns
Tuple con aining he 𝜒2 alue and he deg ees o eedom.
Re u n ype
uple
These commands e u n a uple wi h he la es s a is ics alue and he deg ees o eedom.
Examples:
>>> cs a =s. i _cs a ()
>>> p in (cs a )
(2979.7792968, 3000)
>>> chisq =s. i _chisq()
>>> p in (chisq)
(2997.3247823, 3000)
6.1. Basic commands 289

SPEX Help Cen e Documen a ion, Release 3.08.02
Fi s a is ics
Al hough C-s a is ics is ecommended o Poisson dis ibu ed da a like X- ay spec a, some imes i may be be e
o swi ch o chi^2 s a is ics. This can be done using he i _s a me hod:
Session. i _s a (s a )
Se he i s a is ics.
Pa ame e s
s a (s ) – Fi s a is ics, o example: ‘cs a’, ‘chi2’, ‘ws a’
The s a is ics (s a ) can be ei he cs a (C-s a is ics), chi2 (Chi-squa e s a is ics), o ws a (W-s a is ics). The
W-s a is ics is added o SPEX o e e ence, bu is no ecommended o use in analysis.
Example:
>>> s. i _s a ('chi2')
I you ha e mo e ins umen s o egions which equi e a di e en i s a is ic (op ical o UV spec a o example),
hen i is possible o se a di e en s a is ic o speci ic egions wi h he i _s a _ins command:
Session. i _s a _ins (s a ,ins , eg)
Se he i s a is ics o a pa icula ins umen and egion.
Pa ame e s
•s a (s ) – Fi s a is ics, o example: ‘cs a’, ‘chi2’, ‘ws a’
•ins (in ) – Ins umen numbe .
• eg (in ) – Region numbe .
One needs o speci y he ins umen and egion numbe o which he new s a is ics apply.
Example:
>>> s. i _s a _ins ('chi2',2,1)
Fi me hod
Nex o he de aul Le enbe g-Ma qua d algo i hm, SPEX also o e s Simplex and Simula ed annealing me hods
(see Fi : spec al i ing (page 120)). The me hod can be selec ed using he ollowing command:
Session. i _me hod(me hod)
Se he i s a is ics o a pa icula ins umen and egion.
Pa ame e s
me hod – Fi me hod: classical, simplex o anneal
The simula ed annealing me hod has a numbe o pa ame e s ha can be al e ed. This can be done using he
i _se _ann me hod:
Session. i _se _ann(pa am, alue)
Se he simula ing annealing me hod pa ame e s.
Pa ame e s
•pa am (s ) – Type o annealing pa ame e ( , , eps, m, ns, max, o p in ).
• alue ( loa ) – Value o he pa ame e (will be con e ed o he nea es in i
necessa y).
The cu en pa ame e s can also be ound in he s.op _ i objec . See Fi ing spec a (page 323) o mo e
in o ma ion.
Examples:
290 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
>>> s. i _me hod('ann')
>>> s. i _se _ann(' ',0.85)
Fi e bosi y
The in e media e esul s om he i i e a ions can be shown in he e minal (and in a pgplo window). In PYSPEX,
his ea u e is on by de aul . I you wan o u n i o , hen call
Session. i _p in (s a us)
Se he i ou pu e bosi y. De aul is ue.
Pa ame e s
s a us (bool) – Fi ou pu e bosi y se ing.
wi h False as s a us. The in e media e s eps will no be p in ed anymo e.
Example:
>>> s. i _p in (False)
E o
The command o calcula ing e o s on i ed pa ame e s is e o and has a di ec equi alen in PYSPEX:
Session.e o (isec ,icomp,name,dchi=None)
Calcula e he e o o a pa ame e (name) in sec o (isec ) and componen (icomp).
Pa ame e s
•isec (in ) – Sec o numbe o he componen o calcula e he e o o .
•icomp (in ) – Componen numbe o calcula e he e o o .
•name (s ) – Pa ame e name o calcula e he e o o .
•dchi ( loa ) – (Op ional) ∆𝜒2 alue o op imize o (De aul : 1.0, 68% e o s)
Re u ns
An E o objec om pyspex.
Re u n ype
pyspex.op imize.E o (page 324)
The me hod calcula es he lowe and uppe e o alue o he pa ame e wi h name name in sec o isec and
componen icomp. Op ionally, he a ge del a-c-s a alue can be se . By de aul , dchi is se o 1.0, which esul s
in 68% (1 sigma) e o s.
The e o command e u ns an objec wi h he esul s o he e o calcula ion. See he E o () class de ini ion
elsewhe e in his manual.
Examples:
>>> e _si =s.e o (1,1,'14')
>>> e _ e =s.e o (1,1,'26',dchi=2.71)
>>> p in (e _ e. alue, e _ e.le , e _ e.ue )
1.023902 -0.119324 0.109223
6.1. Basic commands 291
SPEX Help Cen e Documen a ion, Release 3.08.02
Plo commands
Nex o he PGPLOT plo ing sys em o SPEX, he py hon in e ace can also be used o plo ing. In his sec ion, we
p o ide a lis o commands o plo ing spec al models, he e ec i e a ea and spec al da a (including esiduals).
Plo spec al model
The SPEX plo ype ‘model’ plo s he model spec um as a unc ion o ene gy o wa eleng h. In PYSPEX he e is
a unc ion o ob ain he same plo using ma plo lib:
Session.plo _model(xlog=False,ylog=False,wa e=False, i le='SPEX Model Spec um',
show=T ue)
Plo he spec al model.
Pa ame e s
•xlog (bool) – (Op ional) Se he X-axis o be loga i hmic.
•ylog (bool) – (Op ional) Se he Y-axis o be loga i hmic.
•wa e (bool) – (Op ional) Plo in wa eleng h (Angs om)
• i le (s ) – (Op ional) Se he i le o he plo .
•show (bool) – (Op ional) Show he plo (T ue) o e u n he plo objec (False).
Re u ns
Plo objec and op ionally he ma plo lib pl objec .
Re u n ype
pyspex.plo .Plo Model (page 325), ma plo lib.pyplo
This unc ion plo s he model spec um as a unc ion o ene gy (keV) by de aul . I he wa e=T ue pa ame e is
se , hen he spec um will be plo ed as a unc ion o wa eleng h (). The axis can be made loga i hmic by se ing
xlog=T ue and ylog=T ue o he x and y axis, espec i ely.
Wa ning: Due o a bug in pyspex 3.06.01, he uni on he y axis is no pho ons/s/m**2/keV, bu
pho ons/s/m**2. So i shows he spec a wi hou di iding by he bin wid h. This issue will be ixed
in pyspex 3.07.00.
Examples:
>>> s.plo _model()
>>> s.plo _model(xlog=T ue, ylog=T ue)
>>> s.plo _model(wa e=T ue)
Ob ain he aw plo da a
I is possible o ge he aw plo da a h ough he pyspex in e ace. The plo _model command can e u n an objec
con aining he plo da a o ganised by model sec o . Pe sec o , he da a is a ailable in wo o ma s: an As opy
QTable and indi idual numpy a ays.
The da a objec pl can be e u ned as ollows:
>>> pl =s.plo _model()
>>> da a =pl.sec o [0]. abmodel
Please be eminded ha Py hon s a s coun ing a 0, while SPEX s a s coun ing a 1, so sec o [0] in Py hon
co esponds o sec o 1 in SPEX.
The able abmodel con ains he ollowing columns:
292 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
•X_c : The cen al alue o he X-axis bin (in ene gy o wa eleng h)
•X_upp: The alue o he uppe bin edge o he X-axis bin (in ene gy o wa eleng h)
•Model: The model alue o ha bin.
Since abmodel is an As opy QTable he uni s o he alues a e included in he able da a and all he ea u es o
a QTable can be used.
Some examples o y:
>>> pl =s.plo _model()
>>> da a =pl.sec o [0]. abmodel
>>> x=da a['X_c ']# ex ac a column om he able
>>> p in (da a['Model'].uni ) # see he uni o he Model column
>>> p in (da a) # P in he able nicely o ma ed
See Model spec um plo s (page 325) o a desc ip ion o he indi idual numpy a ays a ailable wi hin he sec o
objec .
Plo da a
The SPEX da a plo ype plo s he obse ed spec um, he olded model and backg ound spec um. In PYSPEX,
his is done wi h one command called plo _da a:
Session.plo _da a(xlog=False,ylog=False,wa e=False, i le='SPEX',show=T ue)
Plo he obse ed spec um wi h he con ol ed model o all ins umen s.
Pa ame e s
•xlog (bool) – (Op ional) Se he X-axis o be loga i hmic.
•ylog (bool) – (Op ional) Se he Y-axis o be loga i hmic.
• i le (s ) – (Op ional) Se he i le o he plo .
•show (bool) – (Op ional) Show he plo (T ue) o e u n he plo objec (False).
Re u ns
Plo objec and op ionally he ma plo lib pl objec .
Re u n ype
pyspex.plo .Plo Da a (page 326), ma plo lib.pyplo
This unc ion plo s he obse ed spec a in black, he con ol ed model in ed, and he backg ound spec um as a
dashed blue line. The axis can be made loga i hmic by se ing xlog=T ue and ylog=T ue o he x and y axis,
espec i ely.
Wi h he pa ame e wa e=T ue, he da a and model will be plo ed e sus wa eleng h ().
Wa ning: Due o a bug in pyspex 3.06.01, he uni on he y axis is no coun s/s/keV, bu coun s/s.
So i shows he spec a wi hou di iding by he bin wid h. This issue will be ixed in pyspex 3.07.00.
Examples:
>>> s.plo _da a()
>>> s.plo _da a(xlog=T ue, ylog=T ue)
>>> s.plo _da a(wa e=T ue)
6.1. Basic commands 293
SPEX Help Cen e Documen a ion, Release 3.08.02
Ge ing numbe s om a Quan i y objec
I we only wan he numbe i sel , hen i can be ob ained by adding . alue a e he pa ame e like his:
>>> p in ( lx.ene lum. alue)
1.8976663101053723e+27
We can also ge he uni om he objec in a simila way:
>>> p in ( lx.ene lum.uni )
W
Con e ing he uni s
One o he easons o using As opy Quan i ies is ha hey a e easily con e ed o o he uni s. Fo example, many
as onome s would like o know he luminosi y in e g/s ins ead o W, because hey a e used o he CGS sys em. To
ge ou luminosi y in CGS uni s, he only hing we need o do is:
>>> p in ( lx.ene lum.cgs)
1.8976663101053722e+34 e g / s
Jus appending .cgs a he end o he a iable name is enough o e u n a con e ed numbe . As we can see, he
uni is e g/s now, which we would expec .
Mo e examples abou how o use As opy uni s and how o use hem in calcula ions can be ound in he As opy
uni s documen a ion.
As opy Tables
When we con inue ou example o he p e ious sec ion, we can ge he plo da a o a plo o he CIE model as
ollows om PYSPEX:
>>> (pl, pl ) =s.plo _model(show=False)
>>> p in (pl.sec o [0]. abmodel)
X_c X_upp Model
keV keV ph / (keV m2 s)
--------------------- --------------------- ------------------
0.0010007031872137865 0.0010014063744275728 149.9039074938181
0.0010021105505858743 0.001002814726744176 149.66520271469315
... ... ...
99.78943871942874 99.85956006837118 0.0
99.9297800341856 100.0 0.0
Leng h = 8192 ows
Because he spec al models a e o ganised by sec o , we need o ge he da a o he i s sec o . In Py hon indices
s a a 0, so we selec sec o [0] o ge he abmodel able o sec o 1. When we p in he able, i clea ly consis s
o h ee columns wi h he names X_c ,X_upp and Model. Each column also has a uni associa ed o i , so hese
columns a e e ec i ely As opy Quan i ies.
Suppose ha we a e in e es ed in he Model column, hen we can ex ac ha om he able qui e easily. Fo
con enience, we i s make a e e ence o he able in a sepa a e a iable:
>>> able =pl.sec o [0]. abmodel
>>> p in ( able['Model'])
[149.90390749 149.66520271 149.42688589 ... 0. 0.
0. ] ph / (keV m2 s)
300 Chap e 6. Py hon In e ace

SPEX Help Cen e Documen a ion, Release 3.08.02
The able['Model']a ay has he same p ope ies as a well known numpy a ay and can be manipula ed using
he same unc ions.
Mo e examples and in o ma ion abou As opy QTables can be ound in he As opy Tables documen a ion.
Plo ing Quan i ies and QTables
Since As opy Quan i ies and QTables ha e a sligh ly di e en s uc u e han egula numpy a ays, ma plo lib
canno handle hese a ays by de aul . Luckily, he compa ibili y can be added easily by impo ing and unning he
ollowing a he s a o you py hon session o sc ip :
om as opy. isualiza ion impo quan i y_suppo
quan i y_suppo ()
I you do no wan o ha e Quan i y suppo h oughou you sc ip , you can also add i locally be o e he plo
commands:
wi h quan i y_suppo ():
pl .plo ( able['X_c '], able['Model'], '- ')
6.2.3 Mul ip ocessing wi h PYSPEX
As desc ibed in Session class s uc u e (page 304), a PYSPEX session can only be s a ed once, a leas pe p ocess
o h ead. This can be an annoying limi a ion i you wan o un se e al SPEX sessions a once. This p oblem can
be pa ly ci cum en ed by using he mul ip ocessing module o Py hon. This module is able o un unc ions
in pa allel wi h di e en inpu pa ame e s.
So, i you ha e a p oblem ha equi es you o un SPEX mul iple imes wi h a e y simila se up, bu di e en
inpu pa ame e s, hen his h ead may be help ul o you.
The ollowing sc ip calcula es he spec um emi ed by a CIE plasma o ou di e en empe a u es. This is jus
a simple example. This pa icula p oblem can be calcula ed mo e e icien ly in a di e en way, bu his shows he
po en ial o he mul ip ocessing module i you need o do mo e complica ed calcula ions.
Fi s , we show he ull sc ip :
#!/us /bin/en py hon
om mul ip ocessing impo Pool
om pyspex.spex impo Session
# De ine he unc ion ha calls pyspex
# and does he calcula ion and/o
# analysis ha you wan
de ciecalc(k ):
# S a he SPEX session
s=Session()
# Load a CIE model and choose
# he SPEXACT e sion 3 da abase
s.com('cie')
s. a _calc(T ue)
# Se he empe a u e o he plasma
s.pa (1,1,' ',k [0])
# Calcula e he model
(con inues on nex page)
6.2. Analysis h eads & o he icks 301
SPEX Help Cen e Documen a ion, Release 3.08.02
(con inued om p e ious page)
s.calc()
# Sa e he ou pu spec al model
# o a FITS ile
(pl, pl ) =s.plo _model(show=False)
pl.sec o [0]. abmodel.w i e('cie_{0}. i s'. o ma (k [0]),
o ma =' i s', o e w i e=T ue)
# Close his SPEX session gen ly
s.__del__()
# The unc ion below is execu ed when his
# sc ip is execu ed om he e minal:
i __name__ == "__main__":
# Maximum numbe o p ocesses o
# c ea e a once
np oc =2
# The empe a u es o which o
# calcula e he CIE spec um
k =(0.5,1.0,2.0,4.0)
# Pack he inpu pa ame e s in o one
# i e able a iable
a g =zip(k )
# C ea e a new pool o p ocesses (np oc)
pool =Pool(p ocesses=np oc, max askspe child=1)
# Call he ciecalc unc ion wi h each a gumen
pool.map(ciecalc, a g)
# Close he pool
pool.close()
pool.join()
Nex , we will discuss he de ails o each pa o his sc ip .
Needed Py hon modules
Fo his sc ip , PYSPEX is ob iously needed and is impo ed as usual. The o he module is mul ip ocessing.
Pool, which will handle he mul ip ocessing o us (see also Py hon mul ip ocessing):
om mul ip ocessing impo Pool
om pyspex.spex impo Session
302 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
The ciecalc unc ion
The unc ion ciecalc is ou wo ke unc ion he e. This means ha his unc ion will s a a PYSPEX session,
execu es a numbe o SPEX commands (based on he inpu a gumen s), and p oduces a esul . In his case, we add
one CIE componen , se a empe a u e ead om he unc ion inpu a gumen s, and calcula e he spec um. In he
las s ep, we ge he calcula ed spec um om a model plo and sa e i o FITS o ma . The empe a u e alue is
included in he ou pu ilename.
I is impo an he e o ha e he s a o he PYSPEX session s=Session() inside he unc ion. Remembe ha
you can only ha e one Session pe p ocess, so his needs o be de ined in each p ocess sepa a ely o make PYSPEX
un in pa allel.
In his example, we jus a y he empe a u e in each calcula ion, bu his can be expanded o mo e a iables o
op ions. The e a e mul iple ways o app oaching his:
1. You c ea e a wo ke unc ion wi h mul iple a gumen s (see s a map).
2. You pack he a iables in an objec such ha you can pass ha objec o he unc ion. This objec could be a
Py hon lis o dic iona y, o a cus om objec ha you de ine. The unc ion should be able o ead he a iables
and ins uc ions om he inpu objec .
3. You pass a ilename o a SPEX .com ile o o he con igu a ion ile a each i e a ion.
Make su e o call he s.__del__() a he e y end o you unc ion o close SPEX gen ly a he end. This will
dele e all he *.dum iles as well.
Se up mul ip ocessing
The np oc a iable speci ies he numbe o p ocesses o un a he same ime. Choose his pa ame e wisely based
on he numbe o p ocesso s and amoun o RAM memo y in you compu e . Also keep in mind ha one PYSPEX
session may also use mul iple p ocesso s a he same ime.
Wa ning: Please ake ca e ha you do no se np oc oo high. A PYSPEX un can use be ween
1 and 4 GB o RAM memo y. I you do no ha e a lo o RAM, hen hese p ocesses can make
you sys em ex emely slow o e en c ash.
I may be help ul o limi he numbe o co es used o each p ocess. This can be done by se ing he en i onmen
a iable OMP_NUM_THREADS. Fo example, i you ha e a compu e wi h 16 co es and 32 GB o RAM memo y,
he op imal se ing would be np oc=4 and expo OMP_NUM_THREADS=4. O :
impo os
os.en i on["OMP_NUM_THREADS"]="4"
Ha ing 4 p ocesses which can use 4 co es each gi es you 16 co es a maximum, which is exac ly he p ocesso
speci ica ion. Assuming ha each o he 4 p ocesses uses 4 GB o memo y a maximum, he o al memo y usage
o 16GB should i easily on he a ailable RAM memo y chips.
The line ha c ea es he pool o p ocesses (pool = Pool(p ocesses=np oc, max askspe child=1)) needs
a e y impo an op ion. The max askspe child=1 op ion ells he pool ha each unc ion needs o be pe o med
in a sepa a e p ocess. This ensu es ha he s = Session() command is only gi en once in each p ocess.
The pool.map(ciecalc, a g) line di ides he asks o e he di e en p ocesses and passes he a gumen s (a g)
o he ciecalc unc ion. The a g a iable needs o con ain an i e able lis o a ay. The zip unc ion can help o
c ea e a mul i-dimensional a ay wi h inpu a gumen s i necessa y. See also he s a map unc ion o pass mul iple
a gumen s o he wo ke unc ion.
The pool.close() and pool.join() unc ions make su e ha he p ocesses a e p ope ly closed and ha hei
ou pu is me ged (i applicable).
The sc ip abo e can be sa ed as pyspexmp.py and execu ed om he command line:
6.2. Analysis h eads & o he icks 303
SPEX Help Cen e Documen a ion, Release 3.08.02
py hon pyspexmp.py
You should see mul iple welcome messages om SPEX on you sc een indica ing ha mul iple ins ances o SPEX
a e unning.
Final hough s
The me hod abo e is especially sui able o epea ing long and mo e complica ed PYSPEX sessions. Since he
SPEX is es a ed each ime a p ocess s a s, you will lose a couple o seconds. The e o e, his is only e icien i
he un ime o one i e a ion is much longe han a couple o seconds.
The mul ip ocessing module has many mo e op ions which may se e you needs. As long as you ha e only
one SPEX session pe p ocess, e e y hing should un well.
6.3 Ad anced class desc ip ions
6.3.1 Session class s uc u e
The PYSPEX session class is he op-le el class o PYSPEX and he mos impo an class managing use in e ac-
ion. When he class is ini ialized, a SPEX session is s a ed o he du a ion o he Py hon session. All subsequen
commands communica e wi h his SPEX session in he backg ound.
The s a o a SPEX session is managed by he __ini __ me hod. A he same ime, objec s a e c ea ed o con ain
much o he in e nal SPEX da a ha pyspex can access. These objec s a e ins ances o he Da a, Model, Op imiza-
ion, Ascdump and Log classes ha a e explained la e in his Chap e .
class pyspex.spex.Session(*a gs,**kwa gs)
This class con ains all he classes and commands ha a e a ailable in a pySPEX session.
__ini __()
Func ion o ini ialize he PYSPEX session. I s a s an ins ance o SPEX in he backg ound.
Fu he mo e, i ini ializes a se o objec s con aining in o ma ion abou he loaded da a,
model alues, op imiza ion and logs.
Va iables
• e sion (s ) – The SPEX e sion numbe
•da ase (da a.Da a (page 305)) – Class con aining he da a in o ma ion
•mod_abundance (model.Abundance (page 314)) – Model class o he abun-
dance se ing
•mod_dis ance (model.Dis ance (page 315)) – Model class con aining dis-
ance ools
•mod_eg id (model.Eg id (page 315)) – Model class o he de ini ion o
ene gy g ids
•mod_ lux (model.Fluxes (page 316)) – Model class con aining lux and
luminosi y in o ma ion
•mod_ibal (model.Ibal (page 317)) – Model class o he ionisa ion balance
se ing
•mod_ions (model.Ions (page 318)) – Model class o se ing he used ions
•mod_ a (model.Va (page 321)) – Model class o plasma model se ings
•mod_dem (model.Dem (page 321)) – Model class o DEM modeling
•mod_spec um (model.Spec um (page 320)) – Model class con aining
commands o ex ac model esul s om SPEX
•mod (model.Model (page 309)) – Model class con aining sec o s, componen s
and pa ame e s.
•op _ i (op imize.Fi (page 323)) – Ini ialize he Fi class o spec al
i ing
•asc (ascdump.Ascdump (page 329)) – Class o he Ascdump ou pu
304 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
•logs (log.Log (page 329)) – Class o Log sa ing and execu ion
Du ing he SPEX session, he objec a iables can be used o ob ain alues om he SPEX session in he back-
g ound. Please no e ha o mos o hese he e a e exis ing PYSPEX commands o e ie e he in o ma ion sa ely.
Desc ip ions o he classes behind he objec a iables in __ini __ can be ound by clicking he link behind he
a iable.
Wa ning: You can only s a one PYSPEX session du ing a py hon session. Un o una ely, he Fo an o
Py hon in e ace ha we use canno handle mul iple sessions p ope ly.
Session class commands
The Session class also con ains he main PYSPEX commands lis ed in Basic PYSPEX commands (page 262).
6.3.2 Da a class s uc u e
Spec al & esponse da a
class pyspex.da a.Da a
Main da a class used o se and ge obse ed da a.
Va iables
•nins (in ) – Numbe o ins umen s loaded.
•ins (lis o objec s) – Py hon lis o ins umen objec s.
dele e(ins)
Dele e ins umen wi h numbe ins.
Pa ame e s
ins (in ) – Ins umen numbe o dele e.
load( es ile,spo ile)
Add a new se o spec um and esponse ile o he da ase . P o ide he ull ilename includ-
ing ex ension!
Pa ame e s
• es ile (s ) – SPEX esponse ile name (including . es ex ension).
•spo ile (s ) – SPEX spec um ile name (including .spo ex ension).
Re u n ype
in
sa e(ins,spo ile,o e w i e=False)
Sa e a spec um o a .spo ile.
Pa ame e s
•ins (in ) – Ins umen numbe o sa e.
•spo ile (s ) – Ou pu ilename o SPEX ou pu ile (including .spo ex en-
sion).
•o e w i e (bool) – (Op ional) O e w i e an exis ing .spo ile wi h he same
name.
upda e()
Upda e he numbe o ins umen s.
class pyspex.da a.Ins umen
P ope ies o an ins umen .
Va iables
•nsec o (in ) – Numbe o sec o s in ins umen .
6.3. Ad anced class desc ip ions 305

SPEX Help Cen e Documen a ion, Release 3.08.02
•n egion – Numbe o da a egions in esponse.
•n eg (in ) – Numbe o egions in da a.
•ncomp (in ) – Numbe o esponse componen s.
•index (in ) – Index numbe o his ins umen .
•sponame (s ) – Filename o .spo ile.
• esname (s ) – Filename o . es ile
• eg (lis o objec s) – Lis o egions o his ins umen .
upda e(iins)
Upda e he ins umen in o ma ion.
Pa ame e s
iins (in ) – Ins umen numbe o upda e.
class pyspex.da a.Region
P ope ies o one egion.
Va iables
•index (in ) – Region numbe .
•emin ( loa ) – Min da a ene gy ange (keV).
•emax ( loa ) – Max da a ene gy ange (keV).
•s ccoun ( loa ) – Ne sou ce coun s.
•s cce ( loa ) – Ne sou ce coun e o .
•bkgcoun ( loa ) – Sub ac ed backg ound coun s.
•bkgce ( loa ) – E o sub ac ed backg ound coun s.
•s c a e ( loa ) – Ne sou ce coun a e (coun s/s).
•s c e ( loa ) – Ne sou ce coun a e e o (coun s/s).
•bkg a e ( loa ) – Backg ound coun a e sub ac ed.
•bkg e ( loa ) – E o backg ound coun a e sub ac ed.
•mbkg a e ( loa ) – Model backg ound coun a e.
• in min ( loa ) – Minimum in eg a ion ime pe channel.
• in max ( loa ) – Maximum in eg a ion ime pe channel.
• in a e ( loa ) – A e age in eg a ion ime pe channel.
upda e(iins,i eg)
Upda e he egion p ope ies.
Pa ame e s
•iins (in ) – Ins umen numbe .
•i eg (in ) – Region numbe o upda e.
306 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
Spec al binning and da a selec ion
class pyspex.da a.Bins
Class con aining he binning me hods.
bin(ins , eg,elow,ehigh, ac o ,uni =None)
Bin he spec um using a ixed ac o .
Pa ame e s
•ins (in ) – Ins umen numbe .
• eg (in ) – Region numbe .
•elow ( loa ) – S a poin o ene gy/channel in e al.
•ehigh ( loa ) – End poin o ene gy/channel in e al.
• ac o (in ) – Binning ac o
•uni (s ) – Uni o he ene gy/channel ange, o example: ‘ke ’, ‘e ’, ‘ yd’,
‘j’, ‘hz’, ‘ang’, ‘nm’
igno e(ins , eg,elow,ehigh,uni =None)
Igno e he bins gi en by he ene gy/channel ange.
Pa ame e s
•ins (in ) – Ins umen numbe .
• eg (in ) – Region numbe .
•elow ( loa ) – S a poin o ene gy/channel in e al.
•ehigh ( loa ) – End poin o ene gy/channel in e al.
•uni (s ) – Uni o he ene gy/channel ange, o example: ‘ke ’, ‘e ’, ‘ yd’,
‘j’, ‘hz’, ‘ang’, ‘nm’
obin(ins , eg,elow,ehigh,uni =None)
Bin he spec um op imally gi en he ins umen esolu ion and s a is ics.
Pa ame e s
•ins (in ) – Ins umen numbe .
• eg (in ) – Region numbe .
•elow ( loa ) – S a poin o ene gy/channel in e al.
•ehigh ( loa ) – End poin o ene gy/channel in e al.
•uni (s ) – Uni o he ene gy/channel ange, o example: ‘ke ’, ‘e ’, ‘ yd’,
‘j’, ‘hz’, ‘ang’, ‘nm’
bin(ins , eg,elow,ehigh,uni =None)
Bin he spec um and he esponse op imally gi en he ins umen esolu ion and s a is ics.
Pa ame e s
•ins (in ) – Ins umen numbe .
• eg (in ) – Region numbe .
•elow ( loa ) – S a poin o ene gy/channel in e al.
•ehigh ( loa ) – End poin o ene gy/channel in e al.
•uni (s ) – Uni o he ene gy/channel ange, o example: ‘ke ’, ‘e ’, ‘ yd’,
‘j’, ‘hz’, ‘ang’, ‘nm’
ese (ins , eg)
Rese he binning and use s a us o use all wi h he o iginal binning.
Pa ame e s
•ins (in ) – Ins umen numbe .
• eg (in ) – Region numbe .
syse (ins , eg,elow,ehigh,s c,bkg,uni =None)
Add an addi ional e o o he sou ce and backg ound spec um.
Pa ame e s
•ins (in ) – Ins umen numbe .
• eg (in ) – Region numbe .
•elow ( loa ) – S a poin o ene gy/channel in e al.
•ehigh ( loa ) – End poin o ene gy/channel in e al.
6.3. Ad anced class desc ip ions 307
SPEX Help Cen e Documen a ion, Release 3.08.02
•s c ( loa ) – E o alue o be quad a ically added o he cu en e o ba
o he sou ce spec um.
•bkg ( loa ) – E o alue o be quad a ically added o he cu en e o ba
o he backg ound spec um.
•uni (s ) – Uni o he ene gy/channel ange, o example: ‘ke ’, ‘e ’, ‘ yd’,
‘j’, ‘hz’, ‘ang’, ‘nm’
use(ins , eg,elow,ehigh,uni =None)
Use he bins gi en by he ene gy/channel ange.
Pa ame e s
•ins (in ) – Ins umen numbe .
• eg (in ) – Region numbe .
•elow ( loa ) – S a poin o ene gy/channel in e al.
•ehigh ( loa ) – End poin o ene gy/channel in e al.
•uni (s ) – Uni o he ene gy/channel ange, o example: ‘ke ’, ‘e ’, ‘ yd’,
‘j’, ‘hz’, ‘ang’, ‘nm’
bin(ins , eg,elow,ehigh, ac o ,sn ,uni =None)
Bin he spec um using a a iable bin size, gi en a minimum bin ac o and a minimum
signal o noise a io.
Pa ame e s
•ins (in ) – Ins umen numbe .
• eg (in ) – Region numbe .
•elow ( loa ) – S a poin o ene gy/channel in e al.
•ehigh ( loa ) – End poin o ene gy/channel in e al.
• ac o (in ) – Minimal binning ac o
•sn ( loa ) – Minimal signal o noise o a da a poin a e binning.
•uni (s ) – Uni o he ene gy/channel ange, o example: ‘ke ’, ‘e ’, ‘ yd’,
‘j’, ‘hz’, ‘ang’, ‘nm’
Simula e spec a
class pyspex.da a.Simula e
Class o simula e spec a.
se _bnoise(s a us)
Add Poisson noise o he backg ound spec um (s a us is T ue o False).
Pa ame e s
s a us (bool) – Add Poisson noise o he simula ed backg ound spec um.
se _ins umen (i ange)
De ine he ange o ins umen s o simula e.
Pa ame e s
i ange (s ) – Ins umen ange o simula e (de aul all)
se _noise(s a us)
Add Poisson noise o he sou ce spec um (s a us is T ue o False).
Pa ame e s
s a us (bool) – Add Poisson noise o he simula ed sou ce spec um.
se _ andom()
Se he andom seed o a andom numbe (de aul ).
se _ andom_seed(seed)
Se he andom seed o an in ege alue.
Pa ame e s
seed (in ) – Se he andom seed o he simula ion.
308 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
se _ egion( ange)
De ine he ange o egions o simula e.
Pa ame e s
ange (s ) – Region ange o simula e (de aul all)
se _syse (s c,bkg)
Add a sys ema ic e o o he sou ce spec um (s c) and o he backg ound spec um (bkg).
Pa ame e s
•s c ( loa ) – Add a sys ema ic e o o he sou ce spec um.
•bkg ( loa ) – Add a sys ema ic e o o he backg ound spec um.
simula e(ex ime,ins =None, eg=None,ssys=None,bsys=None,noise=None,bnoise=None,
seed=None)
Simula e a spec um o exposu e ime ex ime and op ionally wi h a numbe o op ions.
Pa ame e s
•ex ime ( loa ) – Exposu e ime o simula e.
•ins (s ) – (Op ional) Ins umen ange o simula e (de aul all)
• eg (s ) – (Op ional) Region ange o simula e (de aul all)
•ssys ( loa ) – (Op ional) Add a sys ema ic e o o he sou ce spec um (De-
aul 0).
•bsys ( loa ) – (Op ional) Add a sys ema ic e o o he backg ound spec um
(De aul 0).
•noise (bool) – (Op ional) Add Poisson noise o he simula ed sou ce spec-
um (De aul T ue).
•bnoise (bool) – (Op ional) Add Poisson noise o he simula ed backg ound
spec um (De aul False).
•seed (in ) – (Op ional) Se he andom seed o he simula ion (De aul : sys-
em clock).
simula e_exposu e(ex ime)
Simula e he spec um o he p o ided exposu e ime.
Pa ame e s
ex ime ( loa ) – Exposu e ime o simula e.
6.3.3 Model class s uc u es
Model
class pyspex.model.Model
Top class con aining he en i e model, con aining all sec o s and componen s.
Va iables
•nsec o (in ) – Numbe o sec o s in his model
•sec (lis ) – Lis o sec o objec s
comp_dele e(isec ,icomp)
Dele e componen om sec o .
Pa ame e s
•isec (in ) – Sec o numbe o he componen o dele e.
•icomp (in ) – Componen numbe o dele e.
comp_new(name,isec =1)
Add new componen o he model. By de aul in sec o 1.
Pa ame e s
•name (s ) – Name o he model componen , o example ‘ eds’, ‘ho ’, ‘cie’,
e c.
•isec (in ) – Sec o numbe o add componen o (de aul is sec o 1).
6.3. Ad anced class desc ip ions 309
SPEX Help Cen e Documen a ion, Release 3.08.02
•ene gy_uppe (as opy.uni s.quan i y.Quan i y) – Uppe bounda ies
o bins (Ene gy, keV)
•ene gy_wid h (as opy.uni s.quan i y.Quan i y) – Wid hs o bins
(Ene gy, keV)
ge ()
Ge he cu en ene gy g id om SPEX.
g id(ebounds)
P o ide a g id o SPEX by p o iding a numpy a ay wi h he bin bounda ies. Please no e
ha he leng h o his a ay is he numbe o bins + 1!
Pa ame e s
ebounds (numpy.nda ay) – A ay con aining he ene gy bounda ies o he
new ene gy g id (keV).
ead( ead ile)
Read he ene gy g id om a ile named ead ile (ex ension: .eg ).
Pa ame e s
ead ile (s ) – Filename o ead he ene gy g id om (including .eg ex en-
sion)
sa e(sa e ile)
Sa e he ene gy g id o a ile named sa e ile (ex ension: .eg ).
Pa ame e s
sa e ile (s ) – Filename o sa e he ene gy g id o (including .eg ex ension)
se (elow,ehigh,nbins,uni ,log)
Se eg id using limi s and numbe o bins.
Pa ame e s
•elow ( loa ) – Lowes ene gy/wa eleng h o ene gy g id.
•ehigh ( loa ) – Highes ene gy/wa eleng h o ene gy g id.
•nbins (in ) – Numbe o bins o ene gy g id.
•uni (s ) – Uni o he ene gy/wa eleng h ange, o example: ‘ke ’, ‘e ’,
‘ yd’, ‘j’, ‘hz’, ‘ang’, ‘nm’
•log (bool) – Make he ene gy g id loga i hmic (T ue o False)
se _s ep(elow,ehigh,s ep,uni ,log)
Se eg id using limi s and s ep size.
Pa ame e s
•elow ( loa ) – Lowes ene gy/wa eleng h o ene gy g id.
•ehigh ( loa ) – Highes ene gy/wa eleng h o ene gy g id.
•s ep ( loa ) – S ep size o he ene gy g id.
•uni (s ) – Uni o he ene gy/wa eleng h ange, o example: ‘ke ’, ‘e ’,
‘ yd’, ‘j’, ‘hz’, ‘ang’, ‘nm’
•log (bool) – Make he ene gy g id loga i hmic (T ue o False)
Fluxes and luminosi ies
class pyspex.model.Fluxes
This class is used o calcula e luxes and luminosi ies o spec a in a spec al band.
Va iables
•sec o (in ) – Sec o numbe o lux calcula ion
•componen (in ) – Componen numbe o lux calcula ion
•pho lux (as opy.uni s.quan i y.Quan i y) – Pho on lux
(pho /m**2/s)
•ene lux (as opy.uni s.quan i y.Quan i y) – Ene gy lux (W/m**2)
316 Chap e 6. Py hon In e ace

SPEX Help Cen e Documen a ion, Release 3.08.02
•pho lum (as opy.uni s.quan i y.Quan i y) – Pho on luminosi y (pho-
ons/s)
•ene lum (as opy.uni s.quan i y.Quan i y) – Ene gy luminosi y (W)
•elim lux (as opy.uni s.quan i y.Quan i y) – Flux ene gy limi s
(keV)
calc(isec ,icomp)
Calcula e and ge lux and luminosi y om SPEX o a gi en sec o and componen numbe .
Pa ame e s
•isec (in ) – Sec o numbe o he componen o calcula e.
•icomp (in ) – Componen numbe o calcula e.
elim(elow,ehigh,uni )
Se he ene gy limi s o he lux and luminosi y calcula ion.
Pa ame e s
•elow ( loa ) – Lowes ene gy/wa eleng h o ene gy in e al.
•ehigh ( loa ) – Highes ene gy/wa eleng h o ene gy in e al.
•uni (s ) – Uni o he ene gy/wa eleng h in e al, o example: ‘ke ’, ‘e ’,
‘ yd’, ‘j’, ‘hz’, ‘ang’, ‘nm’.
elim lux
Flux ene gy limi s (keV)
ge (isec ,icomp)
Ge he lux and luminosi y om SPEX o a gi en sec o and componen numbe .
Pa ame e s
•isec (in ) – Sec o numbe o he componen o ob ain he lux om.
•icomp (in ) – Componen numbe o ob ain he lux om.
Ionisa ion balance
class pyspex.model.Ibal
This class manages he SPEX ionisa ion balance se ing.
Va iables
•index (in ) – Index numbe o lis o ionisa ion balance se s.
• e (s ) – Re e ence o he cu en ionisa ion balance.
•lis ( uple) – Lis o a ailable ionisa ion balance da a.
ge ()
Ge he cu en Abundance se ing ( e e ence).
se (ibal)
Se he abundance in SPEX o ano he se .
Pa ame e s
ibal (s ) – Abb e ia ion o he e e ence o he ionisa ion balance.
upda e()
Upda e he abundance se ing in pyspex.
6.3. Ad anced class desc ip ions 317
SPEX Help Cen e Documen a ion, Release 3.08.02
Ion selec ion
class pyspex.model.Ions
Class o manage he ions aken in o accoun in he model calcula ion.
Va iables
•nz (in ) – To al numbe o a oms conside ed.
•a oms (lis ) – Lis o a oms (wi h in o ma ion abou each ion).
igno e_all()
Igno e all ions.
igno e_ion(z,i)
Igno e his ion.
Pa ame e s
•z(in ) – A omic numbe
•i(in ) – Ion numbe
igno e_iso(iso)
Igno e his iso-elec onic sequence.
Pa ame e s
iso (in ) – Iso-elec onic sequence.
igno e_z(z)
Igno e all ions o his elemen .
Pa ame e s
z(in ) – A omic numbe
lmax_all(lmax)
Se all ions o maximum angula momen um lmax.
Pa ame e s
lmax (in ) – Maximum angula momen um o use.
lmax_ion(z,i,lmax)
Se his ion o maximum angula momen um lmax.
Pa ame e s
•z(in ) – A omic numbe
•i(in ) – Ion numbe
•lmax (in ) – Maximum angula momen um o use.
lmax_iso(iso,lmax)
Se his iso-elec onic sequence o maximum angula momen um lmax.
Pa ame e s
•iso (in ) – Iso-elec onic sequence.
•lmax (in ) – Maximum angula momen um o use.
lmax_z(z,lmax)
Se all ions o his elemen o maximum angula momen um lmax.
Pa ame e s
•z(in ) – A omic numbe
•lmax (in ) – Maximum angula momen um o use.
new_all()
Use new calcula ions o all ions.
new_ion(z,i)
Use new calcula ions o his ion.
Pa ame e s
•z(in ) – A omic numbe
•i(in ) – Ion numbe
318 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
new_iso(iso)
Use new calcula ions o his iso-elec onic sequence.
Pa ame e s
iso (in ) – Iso-elec onic sequence.
new_z(z)
Use new calcula ions o all ions o his elemen .
Pa ame e s
z(in ) – A omic numbe
nmax_all(nmax)
Se all ions o maximum quan um numbe nmax.
Pa ame e s
nmax (in ) – Maximum p inciple quan um numbe o use.
nmax_ion(z,i,nmax)
Se his ion o maximum quan um numbe nmax.
Pa ame e s
•z(in ) – A omic numbe
•i(in ) – Ion numbe
•nmax (in ) – Maximum p inciple quan um numbe o use.
nmax_iso(iso,nmax)
Se his iso-elec onic sequence o maximum quan um numbe nmax.
Pa ame e s
•iso (in ) – Iso-elec onic sequence.
•nmax (in ) – Maximum p inciple quan um numbe o use.
nmax_z(z,nmax)
Se all ions o his elemen o maximum quan um numbe nmax.
Pa ame e s
•z(in ) – A omic numbe
•nmax (in ) – Maximum p inciple quan um numbe o use.
old_all()
Use old calcula ions o all ions.
old_ion(z,i)
Use old calcula ions o his ion.
Pa ame e s
•z(in ) – A omic numbe
•i(in ) – Ion numbe
old_iso(iso)
Use old calcula ions o his iso-elec onic sequence.
Pa ame e s
iso (in ) – Iso-elec onic sequence.
old_z(z)
Use old calcula ions o all ions o his elemen .
Pa ame e s
z(in ) – A omic numbe
qc_all()
Use qc calcula ions o all ions.
qc_ion(z,i)
Use qc calcula ions o his ion.
Pa ame e s
•z(in ) – A omic numbe
•i(in ) – Ion numbe
6.3. Ad anced class desc ip ions 319
SPEX Help Cen e Documen a ion, Release 3.08.02
qc_iso(iso)
Use qc calcula ions o his iso-elec onic sequence.
Pa ame e s
iso (in ) – Iso-elec onic sequence.
qc_z(z)
Use qc calcula ions o all ions o his elemen .
Pa ame e s
z(in ) – A omic numbe
show()
Show he se ings o he ions.
upda e()
Upda e he p ope ies o all a oms.
use_all()
Use all ions.
use_ion(z,i)
Use his ion.
Pa ame e s
•z(in ) – A omic numbe
•i(in ) – Ion numbe
use_iso(iso)
Use his iso-elec onic sequence.
Pa ame e s
iso (in ) – Iso-elec onic sequence.
use_z(z)
Use all ions o his elemen .
Pa ame e s
z(in ) – A omic numbe
Model spec a
class pyspex.model.Spec um
This class ob ains and s o es he model spec um om SPEX.
Va iables
•nbins (in ) – Numbe o bins
•ene gy (as opy.uni s.quan i y.Quan i y) – Cen oids o bins (Ene gy,
keV)
•ene gy_uppe (as opy.uni s.quan i y.Quan i y) – Uppe bounda ies
o bins (Ene gy, keV)
•ene gy_wid h (as opy.uni s.quan i y.Quan i y) – Wid hs o bins
(Ene gy, keV)
•spec um (as opy.uni s.quan i y.Quan i y) – Spec um o bins (in
ph/s/m**2/bin a obse a o y)
•luminosi y (as opy.uni s.quan i y.Quan i y) – Spec um o bins (in
10^44 ph/s/keV a sou ce dis ance)
• able (as opy. able.QTable) – As opy QTable con aining spec um.
ge (isec )
Ge he model spec a om SPEX o sec o numbe isec .
320 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
DEM Modeling
class pyspex.model.Dem
SPEX DEM modeling in e ace.
Va iables
•n (in ) – Numbe o empe a u e bins.
• w (as opy.quan i y.Quan i y) – Tempe a u e bins in keV.
•yw (as opy.quan i y.Quan i y) – Di e en ial emission measu e as a unc-
ion o empe a u e (in 10^64 m**3 / keV).
•ywe (as opy.quan i y.Quan i y) – E o on he di e en ial emission
measu e as a unc ion o empe a u e (in 10^64 m**3 / keV).
•chisq ( loa ) – Chi^2 alue o he DEM i .
•dempen ( loa ) – Dem penal y, numbe o bins ha a e less o equal o 0.
• able (as opy. able.QTable) – As opy QTable con aining DEM model.
Plasma pa ame e s
class pyspex.model.Va
Va ious se ings o he plasma models.
Va iables
•gacc ( loa ) – F ee-bound accu acy
•line_ex (bool) – Elec on exci a ion included
•line_px (bool) – P o on exci a ion included
•line_ (bool) – Radia i e ecombina ion included
•line_d (bool) – Di-elec onic ecombina ion included
•line_ds (bool) – Di-elec onic sa elli es included
•line_ii (bool) – Inne shell ionisa ion included
•dopple (in ) – Dopple b oadening
•newcalc (bool) – SPEXACT 3 calcula ions (False: SPEXACT 2)
•occs a (in ) – Occupa ion calcula ions
•mekal_wa (bool) – Wa eleng h co ec ions acco ding o he wo k o Phillips
e al. (1999)
•mekal_ e17 (bool) – The s onges Fe XVII lines by Do on & Beha (2002).
•mekal_upda e (book) – Se e al mino co ec ions
•ibalmaxw (bool) – Mul i-Maxwellians o he ionisa ion balance
•newcoolexc (bool) – Cooling by collisional exci a ion by S o ano a (SPEX-
ACT 3)
•newcoold (bool) – Cooling by dielec onic ecombina ion (SPEXACT 3)
ese _gacc()
Rese he ee-bound emission accu acy.
6.3. Ad anced class desc ip ions 321

SPEX Help Cen e Documen a ion, Release 3.08.02
se _calc(s a us)
Pe o m SPEXACT 3 line calcula ions.
Pa ame e s
s a us (in ) – Use SPEXACT 2 (0), Quick SPEXACT 3 (1), o SPEXACT 3
(1)
se _cxcon( alue)
Se cha ge exchange ecombina ion and ioniza ion a es acco ding o ei he 1 = A naud &
Ro hen lug (1985) o 2 = Kingdon & Fe land (1996). De aul is 2.
Pa ame e s
alue (in ) – Recombina ion and ionisa ion a ese . 1 = A naud & Ro hen lug,
2 = Kingdon & Fe land.
se _dopple ( alue)
Dopple b oadening.
Pa ame e s
alue (in ) – Dopple b oadening ype.
se _gacc( alue)
Se he ee-bound emission accu acy.
Pa ame e s
alue ( loa ) – F ee-bound emission accu acy.
se _ibalmaxw(s a us)
Swi ch he Mul i-Maxwellians o he ionisa ion balance on/o (T ue/False).
Pa ame e s
s a us (bool) – On (T ue) o o (False)
se _line(l ype,s a us)
Se a line emission con ibu ion on o o .
Pa ame e s
•l ype (s ) – Line emission con ibu ion (‘ex’, ‘px’, ‘ ’, ‘d ’, ‘ds’, ‘ii’, ‘ e-
se ’)
•s a us (bool) – Boolean indica o whe he con ibu ion is on (T ue) o o
(False).
se _mekal(u ype,s a us)
Swi ch old Mekal upda es on/o .
Pa ame e s
•u ype (s ) – Upda e ype (‘wa ’, ‘ e17’, ‘upda e’, ‘all’)
•s a us (bool) – On (T ue) o o (False)
se _newcoold (s a us)
Cooling by dielec onic ecombina ion (SPEXACT 3) on/o (T ue/False).
Pa ame e s
s a us (bool) – On (T ue) o o (False)
se _newcoolexc(s a us)
Cooling by collisional exci a ion by S o ano a (SPEXACT 3) on/o (T ue/False).
Pa ame e s
s a us (bool) – On (T ue) o o (False)
se _occs a (o ype)
A which occupa ion le el o s a .
Pa ame e s
o ype (s ) – Occupa ion le el (‘g ound’, ‘bol z’, ‘las ’)
upda e()
Ob ain he cu en plasma model se ings om SPEX.
322 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
6.3.4 Op imiza ion unc ions
Fi ing spec a
class pyspex.op imize.Fi
This is he pa en class o all i ela ed commands.
Va iables
•s a (bases ing) – Fi s a is ics.
•cs a ( loa ) – C-s a is ics alue.
•chisq ( loa ) – Chi-squa ed alue.
•ws a ( loa ) – W-s a is ics alue (no ecommended).
•n ee (in ) – Deg ees o eedom.
•cs a exp ( loa ) – Expec ed C-s a is ics alue (C-s a only).
•cs a ms ( loa ) – RMS unce ain y on expec ed C-s a alue.
•ann_ ( loa ) – Simula ed annealing:
•ann_eps ( loa ) – Simula ed annealing: eps
•ann_ ( loa ) – Simula ed annealing:
•ann_ m ( loa ) – Simula ed annealing: m
•ann_ns (in ) – Simula ed annealing: ns
•ann_max (in ) – Simula ed annealing: max e alua ions
•ann_p in (in ) – Simula ed annealing: p in lag
i (ni e =100)
Execu e he SPEX i command. The maximum numbe o i e a ions (ni e ) can be op ion-
ally se .
Pa ame e s
ni e (in ) – Numbe o i i e a ions.
ge _me hod()
Ge he cu en ype o s a is ics being used in he i , o example chi2, cs a o ws a .
ge _s a is ic()
Ge he cu en ype o s a is ics being used in he i , o example chi2, cs a o ws a .
p in (s a us)
P in each i i e a ion o he console (de aul is T ue). The s a us a iable can be ei he T ue
o False, which means p in ing is on o o , espec i ely.
Pa ame e s
s a us (bool) – Se i o high e bosi y (T ue is yes, False is no).
se _ann(pa am, alue)
Se he simula ing annealing me hod pa ame e s.
Pa ame e s
•pa am (s ) – Type o annealing pa ame e ( , , eps, m, ns, max, o p in ).
• alue ( loa ) – Value o he pa ame e (will be con e ed o he nea es in
i necessa y).
se _me hod(me h)
Se he desi ed i s a is ics.
Pa ame e s
s a (s ) – Abb e ia ion o he i s a is ics o be used. Fo example: ‘cs a’,
‘chi2’, ‘ws a’.
6.3. Ad anced class desc ip ions 323
SPEX Help Cen e Documen a ion, Release 3.08.02
se _s a is ic(s a )
Se he desi ed i s a is ics.
Pa ame e s
s a (s ) – Abb e ia ion o he i s a is ics o be used. Fo example: ‘cs a’,
‘chi2’, ‘ws a’.
se _s a is ic_ins (s a ,ins , eg)
Se he desi ed i s a is ics pe ins umen and egion.
Pa ame e s
•s a (s ) – Abb e ia ion o he i s a is ics o be used. Fo example: ‘cs a’,
‘chi2’, ‘ws a’.
•ins (in ) – Ins umen numbe .
• eg (in ) – Region numbe .
show()
P in he i s a is ics o he e minal.
upda e()
Ge he mos ecen s a is ics alues om SPEX.
E o calcula ion
class pyspex.op imize.E o
Class o calcula e e o s o ee i pa ame e s.
Va iables
•sec o (in ) – Sec o numbe o pa ame e
•componen (in ) – Componen numbe o pa ame e
•pa ame e (s ) – Pa ame e name
• alue ( loa ) – Pa ame e alue
•le ( loa ) – Lowe e o bounda y
•ue ( loa ) – Uppe e o bounda y
•lc (bool) – Is he e a lowe C-s a o chi**2 alue ound?
•cmin ( loa ) – Lowes C-s a o chi**2 alue
•pmin ( loa ) – Pa ame e alue o which a be e C-s a o Chi**2 was ound
•dchi ( loa ) – Del a C-s a o chi**2 o op imize o
•calcula ed (bool) – Is he e o calcula ed?
e o (isec ,icomp,name,dchi=None)
Calcula e he e o alue o a pa icula pa ame e .
Pa ame e s
•isec (in ) – Sec o numbe o he pa ame e .
•icomp (in ) – Componen numbe o he pa ame e .
•name (s ) – Pa ame e name.
•dchi ( loa ) – (Op ional) ∆𝜒2 alue o op imize o (De aul : 1.0, 68%
e o s)
ge _ alue()
Con enience unc ion o e u n he pa ame e alue and he e o s.
Re u ns
A uple wi h he pa ame e alue, lowe e o and uppe e o .
Re u n ype
uple
324 Chap e 6. Py hon In e ace
SPEX Help Cen e Documen a ion, Release 3.08.02
se _dchi(dchi)
Se he del a c-s a o del a chi**2 alue ha he e o sea ch should op imize o . The de aul
alue is 1.0.
Pa ame e s
dchi ( loa ) – ∆𝜒2 alue o op imize o (De aul : 1.0, 68% e o s)
6.3.5 Plo unc ions
Model spec um plo s
class pyspex.plo .Plo Model
Class con aining he model spec a o plo ing pu poses.
Va iables
•nsec o (in ) – Numbe o sec o s a ailable.
•sec o (lis o objec s) – Lis o plo objec s o each sec o .
adum_xspec_qdp(isec ,qdp ile,o e w i e=False)
W i e he model o a QDP ile in Xspec ou pu o ma . This is use ul o use SPEX models
as inpu o a ious simula ion p og ams, like SIMX, SIXTE and HEASIM.
Pa ame e s
•isec (in ) – Sec o numbe o w i e (Usually 1).
•qdp ile (s ) – File name o he QDP ile o w i e.
•o e w i e (bool) – O e w i e exis ing iles (de aul =False).
plo (xlog=False,ylog=False,wa e=False, i le='SPEX Model Spec um',show=T ue)
Plo he model spec um o all sec o s.
Pa ame e s
•xlog (bool) – (Op ional) Se he X-axis o be loga i hmic.
•ylog (bool) – (Op ional) Se he Y-axis o be loga i hmic.
•wa e (bool) – (Op ional) Plo in wa eleng h (Angs om)
• i le (s ) – (Op ional) Se he i le o he plo .
•show (bool) – (Op ional) Show he plo (T ue) o e u n he plo objec (False).
Re u ns
Ma plo lib pl objec .
Re u n ype
ma plo lib.pyplo
upda e(wa e=False)
Upda e he model spec um in o ma ion o all sec o s.
class pyspex.plo .Plo ModelSec o
Class con aining he spec al model o a pa icula sec o o plo ing pu poses.
Va iables
•xc (as opy.uni s.quan i y.Quan i y) – Cen al bin ene gy (keV).
•xb (as opy.uni s.quan i y.Quan i y) – Uppe bounda y o bin ene gy
(keV).
•m(as opy.uni s.quan i y.Quan i y) – Model spec um (Pho-
ons/m**2/s/keV).
•n(in ) – Numbe o bins.
• abmodel (as opy. able. able.QTable) – As opy QTable con aining he
model spec um
6.3. Ad anced class desc ip ions 325
SPEX Help Cen e Documen a ion, Release 3.08.02
7.1.2 P in help o command
When you know he command ha you need help o , jus ype help <command>, o example we show he help
o he abundance command below:
SPEX> help abundance
This command changes he used se o elemen al abundances.
Usage:
SPEX> abundance <se >
whe e <se > is he se o abundances used. Allowed se s:
ese - de aul se , cu en ly Lodde s e al. 2009
ag - Ande s & G e esse 1989
allen - Allen 1973
a - Ross & Alle 1976
g e esse - G e esse e al 1992
gs - G e esse & Sau al 1998
lodde s - Lodde s p o o-Sola 2003
sola - Lodde s Sola pho osphe ic 2003
To show he cu en abundance se in use:
SPEX> abun show
7.2 Sol ing SPEX p oblems
In case you encoun e a p oblem wi h SPEX, like a command does no do wha you wan , you ge unexpec ed
esul s o in he wo s case he p og am c ashes, hen you a i ed a he igh page. He e we p o ide a checklis
which may ei he allow you o sol e he p oblem you sel o p o ide us wi h enough in o ma ion o help you.
1. Does SPEX gi e you an e o message? Al hough no all e o messages clea ly iden i y he p oblem, hey
do con ain in o ma ion abou wha is w ong. I he e o message is no ob ious, hen en e ing he e o
message in Google o any o he sea ch engine may e eal solu ions o you p oblem ound by o he people.
2. I he e is no clea e o message, hen i is impo an o know a which s ep in he p ocess he p oblem
appea s o occu . A e you unable o s a a p og am, o does he p og am qui a e eading in iles? The
exac momen can gi e impo an hin s abou wha may go w ong. I he p oblem occu s in SPEX, you could
c ea e a .com ile wi h he commands ha cause he issue and see a which command he e o occu s.
SPEX can also p o ide in o ma ion abou which sub ou ine SPEX is unning. Wi h he command wa ch sub
ue, SPEX will p in ou he sub ou ines o all ollowing commands. Pu ing his line in he op o you
.com ile will make i easie o iden i y whe e he p og am ails.
3. Check he Find known issues (page 334) page how o sea ch ou Gi hub page o simila p oblems. The e
may be e y ecen p oblems epo ed ha a e no indexed by sea ch machines ye .
4. When he poin s abo e do no lead you o a solu ion, please submi an issue o ou issue acke on Gi hub.
The Repo issues (page 334) page con ains ins uc ions on how o do ha .
332 Chap e 7. Help & oubleshoo ing

SPEX Help Cen e Documen a ion, Release 3.08.02
7.2.1 Ad anced debugging
I SPEX c ashes wi h a segmen a ion aul , hen i may help o un a debugge on he SPEX p og am. We do no
expec you o do his o each p oblem, bu we may ask you o un SPEX ough a debugge i you submi ed an
issue.
A e y gene al debugge is he GDB p og am, which is a ailable on mos pla o ms. On he command line, you
can en e :
linux:~/spex> gdb $SPEX90/bin/spex
GNU gdb (Debian 7.12-6) 7.12.0.20161007-gi
Copy igh (C) 2016 F ee So wa e Founda ion, Inc.
License GPL 3+: GNU GPL e sion 3 o la e <h p://gnu.o g/licenses/gpl.h ml>
This is ee so wa e: you a e ee o change and edis ibu e i .
The e is NO WARRANTY, o he ex en pe mi ed by law. Type "show copying"
and "show wa an y" o de ails.
This GDB was con igu ed as "x86_64-linux-gnu".
Type "show con igu a ion" o con igu a ion de ails.
Fo bug epo ing ins uc ions, please see:
<h p://www.gnu.o g/so wa e/gdb/bugs/>.
Find he GDB manual and o he documen a ion esou ces online a :
<h p://www.gnu.o g/so wa e/gdb/documen a ion/>.
Fo help, ype "help".
Type "ap opos wo d" o sea ch o commands ela ed o "wo d"...
Reading symbols om /spex/bin/spex...done.
(gdb)
When GDB is s a ed, you can ype un o s a SPEX:
(gdb) un
S a ing p og am: /spex/bin/spex
[Th ead debugging using lib h ead_db enabled]
Using hos lib h ead_db lib a y "/lib/x86_64-linux-gnu/lib h ead_db.so.1".
Welcome use o SPEX e sion 3.05.00
NEW in his e sion o SPEX:
11-06-2018 Added Ex _Ra e column o new spo iles
18-12-2018 SPEX is now using he GPL license
Cu en ly using SPEXACT e sion 2.07.00. Type `help a calc` o de ails.
SPEX>
In he nex s ep, you can en e he SPEX commands ha lead o he p oblem. Ha ing he commands in a .com ile
would be mos p ac ical:
SPEX>log exe bug
The GDB p og am will un slowe han usual. When he e o occu s, GDB will show mo e de ailed e o messages
ela ed o he c ash. I you wan e en mo e in o ma ion, you can gi e he b command o back ace whe e he e o
occu s:
(gdb) b
This ou pu can be a bi in imida ing, bu i should show in which line o he code hings go w ong. This kind o
in o ma ion is e y help ul o us in sol ing p og amming e o s.
7.2. Sol ing SPEX p oblems 333
SPEX Help Cen e Documen a ion, Release 3.08.02
7.3 Find known issues
I you encoun e a p oblem wi h SPEX, i is good o check whe he he p oblem is al eady known. One way o
check his is, o example, en e ing he e o message in a sea ch engine (like Google). This may yield a icles
abou he SPEX p oblem ha you ha e, which may poin o a solu ion.
I is also good o check ou Gi hub issue acke . The p oblem ha you ha e may ha e been epo ed be o e (and
did no end up in a sea ch engine ye ).
I you canno ind in o ma ion abou you issue wi h SPEX, hen please see he Repo issues (page 334) page o
submi an issue o us. We will y o help you as quickly as possible.
7.4 Repo issues
I you ha e a p oblem wi h SPEX ha you a e unable o sol e using ou Sol ing SPEX p oblems (page 332) page
and he p oblem does no appea when you ollow Find known issues (page 334), hen you can submi an issue o
ou Gi hub issue acke . Please ead he ex below be o e clicking he link on he bo om o his page.
Also ea u e eques s and ques ions abou how o use he so wa e a e welcome. Howe e , keep in mind ha we
ha e limi ed menpowe . We may no be able o implemen a new ea u e in a sho ime.
When you submi an issue, please p o ide he ollowing in o ma ion (whe e applicable):
•The name o he p og am causing he p oblem o ha you wan o discuss.
•The name o you ope a ing sys em (e.g. Ubun u Linux, Mac OSX, e c.).
•A ca e ul explana ion o he p oblem (e.g. Wha is w ong? A which poin does i occu ?, e c.)
•A copy o he e o message (i a ailable).
•I possible, a command ile o sc ip ha ( e)p oduces he p oblem.
•I necessa y, a link o spec um o esponse iles ha we could use o ep oduce he p oblem.
The mo e in o ma ion abou he p oblem we ha e, he be e we can help you. You can imagine ha jus elling
us “P og am X does no wo k!” (i eally happens) does no con ain enough in o ma ion o us o ind ou wha is
going on. So please y o explain he p oblem in as much de ail as possible in you i s pos .
Please keep in mind ha you issue is likely o appea online o e e ybody o ead. This way, people wi h simila
SPEX p oblems can bene i om he answe ha we gi e.
Go o ou Gi hub issue acke .
334 Chap e 7. Help & oubleshoo ing
CHAPTER
EIGHT
SPEX THEORY
8.1 SPEX A omic Code & Tables
8.1.1 The SPEX A omic Code & Tables (SPEXACT)
The SPEX package is a spec al i ing p og am wi h in eg a ed models ha a e mos ly based on one a omic da abase
and a se o ou ines o calcula e all he a omic p ocesses in he plasma. Al hough he de elopmen o he a omic
da abase and code is pe o med mos ly in pa allel wi h he o he SPEX de elopmen , i can some imes be con using
which e sion o he a omic da abase was ac ually used in an analysis. Especially a e he majo upda e o he
a omic da abase in SPEX 3.0 and he op ion o calcula e models using he ’old’ da abase and ou ines om SPEX
2.0, he e is a need o name and e sion he ’co e’ ou ines o SPEX sepa a ely. This has become SPEXACT (SPEX
A omic Code & Tables). In p inciple, models calcula ed using he same SPEXACT e sion should p oduce he
same esul s.
Please no e ha he SPEXACT da abase and ou ines a e an in eg a ed pa o SPEX and a e no dis ibu ed sepa-
a ely.
Main e sion numbe de ini ion
SPEXACT 1: Is essen ially he MEKAL model ha was de eloped in he 1980’s and is dis ibu ed wi h Xspec.
This model is no longe de eloped o suppo ed, bu can be ega ded as he i s e sion o SPEXACT. I is no
longe included in SPEX.
SPEXACT 2: In SPEX e sion 1 & 2, he o iginal MEKAL model was ex ended and upda ed in o SPEX. The
e sion numbe o his SPEXACT e sion is he same as he e sion numbe o SPEX when i was eleased. Fo
example, he SPEXACT e sion in SPEX e sion 2.04.00 is also 2.04.00. In SPEX e sion 3, hese ou ines a e
s ill he de aul and a e used in a calc old mode.
SPEXACT 3: These a e he newly de eloped a omic da abase and co esponding ou ines ha we e o icially
eleased wi h SPEX e sion 3.00.00. This da abase and i s ou ines a e no (ye ) he de aul in SPEX, bu can be
used when he a calc new command is gi en. The second numbe in he SPEXACT e sion is he same as
he SPEX e sion i was eleased in. The hi d numbe can in p inciple be di e en om he SPEX e sion and
indica es he mino e sion o he da abase.
8.1.2 Plasma model in SPEX 3.0
The co e o he plasma model
The old plasma code used by SPEX in e sion 2.0 and below is essen ially he same plasma code as de eloped
o iginally by Rol Mewe and colleagues, wi h ela i ely mino upda es o he a omic da a (like wa eleng h im-
p o emen s, co ec ions o a ew ypo’s, imp o emen s o Fe XVII).
I s basis we e p e-calcula ed and pa ame ized line emissi i ies o each spec al line, as a unc ion o empe a u e,
wi h o ele an lines empi ical densi y co ec ions. Fo some ansi ions, like he He-like iple s, he calcula ions
we e a he complex and equi ed se e al co ec ion ac o s o accoun o he ull densi y dependence.
335
SPEX Help Cen e Documen a ion, Release 3.08.02
In he new app oach p esen ed he e, he basic plasma p ocesses a e e alua ed o each indi idual le el, and hen
he occupa ion numbe s o he exci ed s a es a e calcula ed o he ull ion, sol ing a ma ix equa ion. This has he
g ea ad an age ha wi h he same e o a mul i ude o p ocesses can be aken in o accoun , including e ec s o
pho o-exci a ion and pho o-ionisa ion. F om he occupa ion numbe s and he adia i e ansi ion p obabili ies i is
hen s aigh o wa d o calcula e he emi ed spec um.
In o de o keep he code as and lexible, we ha e chosen o a p ocedu e o pa ame ise all ele an p ocesses,
and using simple analy ical o mulae wi h a limi ed numbe o pa ame e s o each p ocess. This is bene icial bo h
in e ms o compu a ion ime and s o age demands and o med he basis o he succes o Mewe’s o iginal wo k.
The p oduc ion o he ele an iles is no ye comple e, bu in he i s elease o e sion 3.0 we inco po a e he
da a o he H, He, and Li iso-elec onic sequences, and some da a o he o he sequences, including he Fe-L ions.
Fo an o e iew o wha is in he code see Sec ion Ions o which upda ed calcula ions a e a ailable (page 336)
below.
By de aul , he plasma code is he old e sion 2.0 code, bu by gi ing he command “ a calc new”, o he ions
o which new da a a e a ailable, he new code is used. This leads in p inciple o highe accu acy and many mo e
spec al lines. A disad an age is o cou se ha he compu a ions become somewha slowe . Fo spec al i ing,
one could en ision a p ocedu e whe e in a i s un he old code is used o ge close o he bes pa ame e s, and hen
o e ine using he new plasma co e.
I you wan o use he new plasma model, i is impo an o make su e he ionisa ion balance is he new u17 balance.
This new balance has imp o ed collisional ionisa ion a es and allows o calcula e p ope ly inne -shell ansi ions
ha a e needed o he new calcula ions. See U dampille a e al. (2017) o de ails.
Finally, i is ad ised ha he use s ha e a look o he a ious ascii-ou pu op ions ha a e a ailable o he plasma
models, allowing o ge deepe insigh in o he physical p ocess and pa ame e s ha a e being used.
Ions o which upda ed calcula ions a e a ailable
Below we lis o each iso-elec onic sequence wha da a is a ailable o he new plasma calcula ions. Each line
co esponds o one ion, wi h ii, iz and jz co esponding o he iso-elec onic sequence, nuclea cha ge and ionisa ion
s age, espec i ely. Then o a numbe o p ocess we lis wo quan i ies: 𝑁, he numbe o en ies we ha e (e.g.,
numbe o ene gy le els o ansi ion a es), and 𝑛m𝑎𝑥 he maximum p incipal quan um numbe o wich we use
da a o ha ion and p ocess. No e ha 𝑛m𝑎𝑥 e e s o he highes le el included o a ansi ion be ween wo le els.
The p ocesses inco po a ed and shown in he able a e:
1. le els – Ene gy le els
2. A ad – Radia i e ansi ion p obabili ies (Eins ein coe icien s)
3. A wo – Two-pho on p ocesses
4. El col – Elec on collisional exci a ion
5. P col – P o on collisional exci a ion
6. Aug – Auge a es (au o-ionisa ion, needed o dielec onic ecombina ion)
7. CX – Cha ge exchange ecombina ion
8. RR – Radia i e ecombina ion
9. II – Inne -shell p ocesses ( his is me ely he numbe o quan um s a es a e ionisa ion; he numbe o luo-
escen lines will be la ge )
336 Chap e 8. SPEX Theo y
SPEX Help Cen e Documen a ion, Release 3.08.02
Iso-elec onic sequence: 1
ii iz jz le els A ad A wo El Col P col Aug CX RR II
N n(max) N n(max) N n(max) N n(max) N n(max) N n(max) N n(max) N n(max) N n(max)
1 1 1 256 16 325 16 1 2 31 16 1 2 0 0 1 1 19 16 0 0
1 2 2 256 16 325 16 1 2 13 10 1 2 0 0 0 0 19 16 0 0
1 3 3 256 16 325 16 1 2 13 10 1 2 0 0 0 0 19 16 0 0
1 4 4 256 16 326 16 1 2 13 10 1 2 0 0 1 3 19 16 0 0
1 5 5 256 16 327 16 1 2 13 10 1 2 0 0 1 4 19 16 0 0
1 6 6 284 20 431 20 1 2 15 17 1 2 0 0 7 7 19 16 0 0
1 7 7 284 20 436 20 1 2 15 17 1 2 0 0 8 6 19 16 0 0
1 8 8 284 20 438 20 1 2 15 17 1 2 0 0 11 9 19 16 0 0
1 9 9 256 16 335 16 1 2 13 10 1 2 0 0 11 8 19 16 0 0
1 10 10 284 20 444 20 1 2 15 17 1 2 0 0 15 8 19 16 0 0
1 11 11 256 16 337 16 1 2 13 10 1 2 0 0 18 10 19 16 0 0
1 12 12 284 20 446 20 1 2 15 18 1 2 0 0 21 10 19 16 0 0
1 13 13 256 16 339 16 1 2 13 10 1 2 0 0 24 11 19 16 0 0
1 14 14 284 20 451 20 1 2 15 17 1 2 0 0 29 12 19 16 0 0
1 15 15 256 16 345 16 1 2 13 10 1 2 0 0 29 13 19 16 0 0
1 16 16 284 20 456 20 1 2 15 17 1 2 0 0 32 14 19 16 0 0
1 17 17 256 16 351 16 1 2 13 10 1 2 0 0 35 14 19 16 0 0
1 18 18 284 20 461 20 1 2 15 17 1 2 0 0 39 15 19 16 0 0
1 19 19 256 16 355 16 1 2 13 10 1 2 0 0 41 15 19 16 0 0
1 20 20 284 20 467 20 1 2 15 17 1 2 0 0 42 15 19 16 0 0
1 21 21 256 16 359 16 1 2 13 10 1 2 0 0 42 15 19 16 0 0
1 22 22 284 20 470 20 1 2 15 17 1 2 0 0 43 15 19 16 0 0
1 23 23 256 16 362 16 1 2 13 10 1 2 0 0 43 15 19 16 0 0
1 24 24 284 20 473 20 1 2 15 17 1 2 0 0 44 15 19 16 0 0
1 25 25 256 16 364 16 1 2 13 10 1 2 0 0 37 15 19 16 0 0
1 26 26 284 20 476 20 1 2 15 17 1 2 0 0 44 15 19 16 0 0
1 27 27 256 16 367 16 1 2 13 10 1 2 0 0 44 15 19 16 0 0
1 28 28 284 20 479 20 1 2 15 17 1 2 0 0 44 15 19 16 0 0
1 29 29 256 16 371 16 1 2 13 10 1 2 0 0 44 15 19 16 0 0
1 30 30 256 16 401 16 1 2 13 10 1 2 0 0 44 15 19 16 0 0
Iso-elec onic sequence: 2
ii iz jz le els A ad A wo El Col P col Aug CX RR II
N n(max) N n(max) N n(max) N n(max) N n(max) N n(max) N n(max) N n(max) N n(max)
2 2 1 511 16 794 16 1 2 3 6 1 2 0 0 0 0 10 8 0 0
2 3 2 558 16 878 16 1 2 5 7 1 2 11 3 0 0 10 8 2 2
2 4 3 558 16 892 16 1 2 27 7 1 2 11 3 0 0 10 8 2 2
2 5 4 558 16 903 16 1 2 27 7 1 2 11 3 1 2 10 8 2 2
2 6 5 678 16 1236 16 1 2 59 10 1 2 38 5 8 4 10 8 2 2
2 7 6 678 16 1251 16 1 2 59 10 1 2 38 5 12 7 10 8 2 2
2 8 7 678 16 1266 16 1 2 59 10 1 2 38 5 14 6 10 8 2 2
2 9 8 678 16 1229 16 1 2 56 7 1 2 38 5 2 5 10 8 2 2
2 10 9 678 16 1281 16 1 2 59 10 1 2 38 5 24 8 10 8 2 2
2 11 10 678 16 1261 16 1 2 55 7 1 2 38 5 28 9 10 8 2 2
2 12 11 678 16 1308 16 1 2 59 10 1 2 38 5 35 10 10 8 2 2
2 13 12 678 16 1300 16 1 2 55 7 1 2 38 5 42 10 10 8 2 2
2 14 13 678 16 1335 16 1 2 59 10 1 2 38 5 47 11 10 8 2 2
2 15 14 678 16 1329 16 1 2 56 7 1 2 38 5 0 0 10 8 2 2
con inues on nex page
8.1. SPEX A omic Code & Tables 337

[Document text truncated for crawler view.]