Skip to content

Commit f5e75b9

Browse files
committed
Fix examples for updates to sphin and docutils
1 parent fa249b2 commit f5e75b9

File tree

5 files changed

+46
-49
lines changed

5 files changed

+46
-49
lines changed

examples/fitting_NuSTAR_spectra-duncan2021.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
Fitting NuSTAR Spectra: Duncan *et al.* 2021 comparison
44
=========================================================
55
6-
This spectrum corresponds to the may1618 microflare in [Duncan2021]_.
6+
This spectrum corresponds to the may1618 microflare in `Duncan2021`_.
77
88
An example of fitting multiple spectra simultaneously with 2 models where each model is allowed to vary at different times
99
1010
We also allow the gain slope response parameter to vary.
11+
12+
.. _Duncan2021: https://iopscience.iop.org/article/10.3847/1538-4357/abca3d
1113
"""
1214

1315
import warnings
@@ -156,21 +158,17 @@
156158
# For the 2 thermal model fitting
157159
#
158160
# +----------------------------------------+-----------------------------------------------+------------------------------------------+
159-
# | Model Parameter | XSPEC (Duncan et al. 2021) [*]_ | This Work |
161+
# | Model Parameter | XSPEC (Duncan et al. 2021) | This Work |
160162
# +========================================+===============================================+==========================================+
161-
# | Temperature 1 [MK] | :math:`4.1^{+0.1}_{-0.1}` | 4.8\ |pm|\ 0.3 |
163+
# | Temperature 1 [MK] | :math:`4.1^{+0.1}_{-0.1}` | :math:`4.8 \pm 0.3` |
162164
# +----------------------------------------+-----------------------------------------------+------------------------------------------+
163-
# | Emission Measure 1 [cm\ :sup:`-3`] | :math:`1.4^{+0.6}_{-0.4}\times10^{47}` | 7.6 |pm| 2.4\ |x|\ 10 :sup:`46` |
165+
# | Emission Measure 1 [cm\ :sup:`-3`] | :math:`1.4^{+0.6}_{-0.4} \times 10^{47}` | :math:`7.6 \pm 2.4 \times 10^46 |
164166
# +----------------------------------------+-----------------------------------------------+------------------------------------------+
165-
# | Temperature 2 [MK] | :math:`10.00^{+0.03}_{-0.03}` | 10.4\ |pm|\ 0.1 |
167+
# | Temperature 2 [MK] | :math:`10.00^{+0.03}_{-0.03}` | :math:`10.4 \pm 0.1` |
166168
# +----------------------------------------+-----------------------------------------------+------------------------------------------+
167-
# | Emission Measure 2 [cm\ :sup:`-3`] | :math:`4.6^{+0.1}_{-0.2}\times10^{45}` | 4.3 |pm| 0.3\ |x|\ 10 :sup:`45` |
169+
# | Emission Measure 2 [cm\ :sup:`-3`] | :math:`4.6^{+0.1}_{-0.2} \times 10^{45}` | :math:`4.3 \pm 0.3 \times 10^45 |
168170
# +----------------------------------------+-----------------------------------------------+------------------------------------------+
169171
#
170-
# .. |pm| replace:: :math:`\pm`
171-
# .. |x| replace:: :math:`\times`
172-
# .. [*] Duncan *et al.* 2021's may1618 microflare
173-
# .. [Duncan2021] https://iopscience.iop.org/article/10.3847/1538-4357/abca3d
174172

175173
#####################################################
176174
#
@@ -179,8 +177,10 @@
179177
# +----------------------------------------+-----------------------------------------------+------------------------------------------+
180178
# | Model Parameter | XSPEC (Duncan et al. 2021) | This Work |
181179
# +========================================+===============================================+==========================================+
182-
# | Gain Slope | 0.977\ |pm|\ 0.002 | 0.978\ |pm|\ 0.001 |
180+
# | Gain Slope | :math:`0.977 \pm 0.002` | :math:`0.978 \pm 0.001` |
183181
# +----------------------------------------+-----------------------------------------------+------------------------------------------+
182+
#
183+
# .. _[Duncan2021]: https://iopscience.iop.org/article/10.3847/1538-4357/abca3d
184184

185185
#####################################################
186186
# Although these values are slightly different, it is important to note that XSPEC and sunkit-spex work from different atomic databases. We also note that for a similar isothermal fit the temperature can drop/rise if the emission measure rises/drops and so fitting not just one but two of these models allows for these to vary more. We do see that this work (for this microflare) produces higher temperatures but correspondingly lower emission measures.

examples/fitting_NuSTAR_spectra-glesener2020.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
Fitting NuSTAR Spectra: Glesener *et al.* 2020 comparison
44
=========================================================
55
6-
A real example from [Glesener2020]_ of fitting two NuSTAR spectra simultaneously with gain correction.
6+
A real example from `Glesener2020`_ of fitting two NuSTAR spectra simultaneously with gain correction.
7+
8+
.. _Glesener2020: https://iopscience.iop.org/article/10.3847/2041-8213/ab7341
79
"""
810

911
import warnings
@@ -198,23 +200,20 @@
198200
# For the thermal and cold thick target total model we compare
199201
#
200202
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
201-
# | Model Parameter | OSPEX (Glesener et al. 2020) [*]_ | This Work (just FPMB) | This Work (FPMA&B) |
203+
# | Model Parameter | OSPEX (Glesener et al. 2020) | This Work (just FPMB) | This Work (FPMA&B) |
202204
# +========================================+===============================================+==========================================+==========================================+
203-
# | Temperature [MK] | 10.3\ |pm|\ 0.7 | 11.3\ |pm|\ 0.7 | 11.2\ |pm|\ 0.4 |
205+
# | Temperature [MK] | :math:`10.3 \pm 0.7` | :math:`11.3 \pm 0.7` | :math:`11.2 \pm 0.4` |
204206
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
205-
# | Emission Measure [cm\ :sup:`-3`] | 5.0 |pm| 1.3\ |x|\ 10 :sup:`45` | 3.7 |pm| 0.9\ |x|\ 10 :sup:`45` | 3.7 |pm| 0.5\ |x|\ 10 :sup:`45` |
207+
# | Emission Measure [cm\ :sup:`-3`] | :math:`5.0 \pm 1.3 \times 10^45` | :math:`3.7 \pm 0.9 \times 10^45` | :math:`3.7 \pm 0.5 \times 10^45` |
206208
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
207-
# | Electron Flux [e$^{-}$ s$^{-1}$] | 2.1\ |pm|\ 1.1\ |x|\ 10 :sup:`35` | 2.2\ |pm|\ 1.1\ |x|\ 10 :sup:`35` | 1.6\ |pm|\ 0.5\ |x|\ 10 :sup:`35` |
209+
# | Electron Flux [e$^{-}$ s$^{-1}$] | :math:`2.1 \pm 1.1 \tiems 10^35` | :math:`2.2 \pm 1.1 \times 10^35` | :math:`1.6 \pm 0.5 \times 10^35` |
208210
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
209-
# | Index | 6.2\ |pm|\ 0.6 | 6.5\ |pm|\ 0.8 | 6.5\ |pm|\ 0.6 |
211+
# | Index | :math:`6.2 \pm 0.6` | :math:`6.5 \pm 0.8` | :math:`6.5 \pm 0.6` |
210212
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
211-
# | Low Energy Cut-off [keV] | 6.2\ |pm|\ 0.9 | 6.5\ |pm|\ 1.0 | 6.7\ |pm|\ 0.7 |
213+
# | Low Energy Cut-off [keV] | :math:`6.2 \pm 0.9` | :math:`6.5 \pm 1.0` | :math:`6.7 \pm 0.7` |
212214
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
213215
#
214-
# .. |pm| replace:: :math:`\pm`
215-
# .. |x| replace:: :math:`\times`
216-
# .. [*] Glesener *et al.* 2020
217-
# .. [Glesener2020] https://iopscience.iop.org/article/10.3847/2041-8213/ab7341
216+
# .. _Glesener2020: https://iopscience.iop.org/article/10.3847/2041-8213/ab7341
218217

219218

220219
#####################################################
@@ -344,15 +343,15 @@
344343
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
345344
# | Model Parameter | OSPEX (Glesener et al. 2020) | This Work (just FPMB) | This Work (FPMA&B) |
346345
# +========================================+===============================================+==========================================+==========================================+
347-
# | Temperature [MK] | 10.2\ |pm|\ 0.7 | 11.2\ |pm|\ 0.6 | 11.2\ |pm|\ 0.4 |
346+
# | Temperature [MK] | :math:`10.2 \pm 0.7` | :math:`11.2 \pm 0.6` | :math:`11.2 \pm 0.4` |
348347
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
349-
# | Plasma Density [cm\ :sup:`-3`] | 6.0 |pm| 2.0\ |x|\ 10 :sup:`9` | 5.0 |pm| 1.3\ |x|\ 10 :sup:`9` | 5.7 |pm| 1.1\ |x|\ 10 :sup:`9` |
348+
# | Plasma Density [cm\ :sup:`-3`] | :math:`6.0 \pm 2.0 \times 10^9` | :math:`5.0 \pm 1.3 \times 10^9` | :math:`5.7 \pm 1.1 \times 10^9` |
350349
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
351-
# | Electron Flux [e$^{-}$ s$^{-1}$] | 1.8\ |pm|\ 0.8\ |x|\ 10 :sup:`35` | 2.0\ |pm|\ 0.8\ |x|\ 10 :sup:`35` | 1.6\ |pm|\ 0.5\ |x|\ 10 :sup:`35` |
350+
# | Electron Flux [e$^{-}$ s$^{-1}$] | :math:`1.8 \pm 0.8\times 10^35` | :math:`2.0 \pm 0.8 \times 10^35` | :math:`1.6 \pm 0.5 \times 10^35` |
352351
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
353-
# | Index | 6.3\ |pm|\ 0.7 | 6.6\ |pm|\ 0.8 | 6.5\ |pm|\ 0.6 |
352+
# | Index | :math:`6.3 \pm 0.7` | :math:`6.6 \pm 0.8` | :math:`6.5 \pm 0.6` |
354353
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
355-
# | Low Energy Cut-off [keV] | 6.5\ |pm|\ 0.9 | 6.7\ |pm|\ 0.9 | 6.7\ |pm|\ 0.7 |
354+
# | Low Energy Cut-off [keV] | :math:`6.5 \pm 0.9` | :math:`6.7 \pm 0.9` | :math:`6.7 \pm 0.7` |
356355
# +----------------------------------------+-----------------------------------------------+------------------------------------------+------------------------------------------+
357356

358357
#####################################################

examples/fitting_NuSTAR_spectra-simultaneously.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
Fitting NuSTAR Spectra: Simultaneous Fitting
44
============================================
55
6-
A real example from [Cooper2021]_ of fitting two NuSTAR spectra simultaneously.
6+
A real example from `Cooper2021`_ of fitting two NuSTAR spectra simultaneously.
7+
8+
.. _Cooper2021: https://academic.oup.com/mnras/article/507/3/3936/6354806
79
"""
810

911
import warnings
@@ -120,21 +122,18 @@
120122
# Comparison
121123
#
122124
# +------------------------------------------+-----------------------------------------------+------------------------------------------+
123-
# | Model Parameter | XSPEC (Cooper et al. 2021) [*]_ | This Work |
125+
# | Model Parameter | XSPEC (Cooper et al. 2021) | This Work |
124126
# +==========================================+===============================================+==========================================+
125-
# | Temperature 1 [MK] | :math:`3.05^{+0.04}_{-0.35}` | 3.19\ |pm|\ 0.23 |
127+
# | Temperature 1 [MK] | :math:`3.05^{+0.04}_{-0.35}` | :math:`3.19 \pm 0.23` |
126128
# +------------------------------------------+-----------------------------------------------+------------------------------------------+
127-
# | Emission Measure 1 [cm\ :sup:`-3`] | :math:`1.70^{+1.99}_{-0.08}\times10^{47}` | 1.45 |pm| 0.72\ |x|\ 10 :sup:`46` |
129+
# | Emission Measure 1 [cm\ :sup:`-3`] | :math:`1.70^{+1.99}_{-0.08}\times10^{47}` | :math:`1.45 \pm 0.72 \times 10^46` |
128130
# +------------------------------------------+-----------------------------------------------+------------------------------------------+
129-
# | Temperature 2 [MK] | :math:`6.60^{+0.20}_{-0.61}` | 7.13\ |pm|\ 0.97 |
131+
# | Temperature 2 [MK] | :math:`6.60^{+0.20}_{-0.61}` | :math:`7.13 \pm 0.97` |
130132
# +------------------------------------------+-----------------------------------------------+------------------------------------------+
131-
# | Emission Measure 2 [cm\ :sup:`-3`] | :math:`3.8^{+4.0}_{-0.7}\times10^{43}` | 2.80 |pm| 2.80\ |x|\ 10 :sup:`43` |
133+
# | Emission Measure 2 [cm\ :sup:`-3`] | :math:`3.8^{+4.0}_{-0.7}\times10^{43}` | :math:`2.80 \pm 2.80 \times 10^43` |
132134
# +------------------------------------------+-----------------------------------------------+------------------------------------------+
133135
#
134-
# .. |pm| replace:: :math:`\pm`
135-
# .. |x| replace:: :math:`\times`
136-
# .. [*] Cooper *et al.* 2021's microflare 10, pre-flare.
137-
# .. [Cooper2021] https://academic.oup.com/mnras/article/507/3/3936/6354806
136+
# .. _Cooper2021: https://academic.oup.com/mnras/article/507/3/3936/6354806
138137

139138
#####################################################
140139
# Although these values are slightly different (almost or are within error margins), it is important to note that XSPEC and sunkit-spex work from different atomic databases. We also note that for a similar isothermal fit the temperature can drop/rise if the emission measure rises/drops and so fitting not just one but two of these models allows for these to vary more. We do see that this work (for this microflare time) produces slightly higher temperatures but correspondingly lower emission measures.

0 commit comments

Comments
 (0)