Skip to content

Commit 3a6b8a1

Browse files
committed
fix: markdown fixes for github + correct plot labels
1 parent c689846 commit 3a6b8a1

File tree

2 files changed

+97
-224
lines changed

2 files changed

+97
-224
lines changed

README.md

Lines changed: 37 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<img width="300px" src="assets/convolve-example.svg" alt=""/>
44
</p>
55

6-
# klineprofiles
6+
# klineprofiles
77

88
A [Zig](https://ziglang.org/) tool to help construct relativistic lineprofile models for use with [SpectralFitting.jl](https://github.com/fjebaker/SpectralFitting.jl), HEASoft's [XSPEC](https://heasarc.gsfc.nasa.gov/xanadu/xspec/), and beyond. This code integrates pre-computed Green's function / transfer functions with some arbitrary emissivity function for fitting purposes, solving
99

1010
$$
11-
F(E, \delta E) = \int_{r_0}^{R} \text{d} r \int_{E}^{E+\delta E} \text{d}g \, I_{\text{obs}}(r, g) \varepsilon(r),
11+
F(E, \delta E) = \int_{r_0}^{R} \text{d} r \int_{E}^{E+\delta E} \text{d}g I_{\text{obs}}(r, g) \varepsilon(r),
1212
$$
1313

14-
on energy grids $E$ with bin width $\delta E$.
14+
on energy grids $E$ with bin width $\delta E$.
1515

1616
The pre-computed transfer functions in $I_\text{obs}$ can be obtained using general relativistic ray-tracing software, such as [Gradus.jl](https://github.com/astro-group-bristol/Gradus.jl/). With every [release](https://github.com/fjebaker/lineprofiles/releases), an example table is provided for the Kerr spacetime, which interpolates over black hole spin $a$ and observer inclination $\theta$.
1717

@@ -23,173 +23,49 @@ A number of different models are included in the source code, and additional mod
2323

2424
- `kline`: lineprofiles with power-law emissivities of the form $\varepsilon(r) = r^{-\alpha}$.
2525

26-
<details>
27-
<summary>Parameter summary</summary>
28-
<table class="source-line" data-source-line="25">
29-
<thead>
30-
<tr>
31-
<th>Parameter</th>
32-
<th>Description</th>
33-
</tr>
34-
</thead>
35-
<tbody>
36-
<tr>
37-
<td><code>a</code></td>
38-
<td>Black hole spin (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>∈</mo><mo stretchy="false">[</mo><mo>−</mo><mn>0.998</mn><mo separator="true">,</mo><mn>0.998</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">a \in [-0.998, 0.998]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">[</span><span class="mord">−</span><span class="mord">0.998</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">0.998</span><span class="mclose">]</span></span></span></span>)</td>
39-
</tr>
40-
<tr>
41-
<td><code>incl</code></td>
42-
<td>Observer inclination <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> (degrees)</td>
43-
</tr>
44-
<tr>
45-
<td><code>eline</code></td>
46-
<td>Energy of the iron line (6.4 keV)</td>
47-
</tr>
48-
<tr>
49-
<td><code>alpha</code></td>
50-
<td>Emissivity powerlaw index</td>
51-
</tr>
52-
<tr>
53-
<td><code>rmin</code></td>
54-
<td>Inner radius of the accretion disc</td>
55-
</tr>
56-
<tr>
57-
<td><code>rmax</code></td>
58-
<td>Outer radius of the accretion disc</td>
59-
</tr>
60-
</tbody>
61-
</table>
62-
</details>
63-
64-
<p></p>
26+
| Parameter | Description |
27+
| --------- | -------------------------------------------------- |
28+
| `a` | Unitless black hole spin |
29+
| `incl` | Observer inclination $\theta$ (degrees) |
30+
| `eline` | Energy of central line (e.g. Fe K$\alpha$ 6.4 keV) |
31+
| `alpha` | Emissivity powerlaw index |
32+
| `rmin` | Inner radius of the accretion disc |
33+
| `rout` | Outer radius of the accretion disc |
6534

6635
- `kline5`: lineprofiles with emissivity given as an interpolated power-law between 5 knots.
6736

68-
<details>
69-
<summary>Parameter summary</summary>
70-
<table class="source-line" data-source-line="67">
71-
<thead>
72-
<tr>
73-
<th>Parameter</th>
74-
<th>Description</th>
75-
</tr>
76-
</thead>
77-
<tbody>
78-
<tr>
79-
<td><code>a</code></td>
80-
<td>Black hole spin (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>∈</mo><mo stretchy="false">[</mo><mo>−</mo><mn>0.998</mn><mo separator="true">,</mo><mn>0.998</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">a \in [-0.998, 0.998]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">[</span><span class="mord">−</span><span class="mord">0.998</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">0.998</span><span class="mclose">]</span></span></span></span>)</td>
81-
</tr>
82-
<tr>
83-
<td><code>incl</code></td>
84-
<td>Observer inclination <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> (degrees)</td>
85-
</tr>
86-
<tr>
87-
<td><code>eline</code></td>
88-
<td>Energy of the iron line (6.4 keV)</td>
89-
</tr>
90-
<tr>
91-
<td><code>alpha</code></td>
92-
<td>Emissivity powerlaw index everywhere beyond <code>e5</code></td>
93-
</tr>
94-
<tr>
95-
<td><code>rmin</code></td>
96-
<td>Inner radius of the accretion disc</td>
97-
</tr>
98-
<tr>
99-
<td><code>rmax</code></td>
100-
<td>Outer radius of the accretion disc</td>
101-
</tr>
102-
<tr>
103-
<td><code>e1</code> - <code>e5</code></td>
104-
<td>Emissivity interpolation knots (see <a href="#emissivity-interpolation">Emissivity interpolation</a>)</td>
105-
</tr>
106-
</tbody>
107-
</table>
108-
</details>
109-
110-
<p></p>
37+
| Parameter | Description |
38+
| ------------ | ------------------------------------------------------------------------------------------ |
39+
| `a` | Unitless black hole spin |
40+
| `incl` | Observer inclination $\theta$ (degrees) |
41+
| `eline` | Energy of central line (e.g. Fe K$\alpha$ 6.4 keV) |
42+
| `alpha` | Emissivity powerlaw index beyond `e5` |
43+
| `rmin` | Inner radius of the accretion disc |
44+
| `rout` | Outer radius of the accretion disc |
45+
| `e1` to `e5` | Emissivity interpolation knots (see [Emissivity interpolation](#emissivity-interpolation)) |
11146

11247
### Convolutional
11348

11449
- `kconv`: convolutional analog of `kline`.
11550

116-
<details>
117-
<summary>Parameter summary</summary>
118-
<table class="source-line" data-source-line="25">
119-
<thead>
120-
<tr>
121-
<th>Parameter</th>
122-
<th>Description</th>
123-
</tr>
124-
</thead>
125-
<tbody>
126-
<tr>
127-
<td><code>a</code></td>
128-
<td>Black hole spin (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>∈</mo><mo stretchy="false">[</mo><mo>−</mo><mn>0.998</mn><mo separator="true">,</mo><mn>0.998</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">a \in [-0.998, 0.998]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">[</span><span class="mord">−</span><span class="mord">0.998</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">0.998</span><span class="mclose">]</span></span></span></span>)</td>
129-
</tr>
130-
<tr>
131-
<td><code>incl</code></td>
132-
<td>Observer inclination <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> (degrees)</td>
133-
</tr>
134-
<tr>
135-
<td><code>alpha</code></td>
136-
<td>Emissivity powerlaw index</td>
137-
</tr>
138-
<tr>
139-
<td><code>rmin</code></td>
140-
<td>Inner radius of the accretion disc</td>
141-
</tr>
142-
<tr>
143-
<td><code>rmax</code></td>
144-
<td>Outer radius of the accretion disc</td>
145-
</tr>
146-
</tbody>
147-
</table>
148-
</details>
149-
150-
<p></p>
51+
| Parameter | Description |
52+
| --------- | --------------------------------------- |
53+
| `a` | Unitless black hole spin |
54+
| `incl` | Observer inclination $\theta$ (degrees) |
55+
| `alpha` | Emissivity powerlaw index |
56+
| `rmin` | Inner radius of the accretion disc |
57+
| `rout` | Outer radius of the accretion disc |
15158

15259
- `kconv5`: convolutional analog of `kline5`.
15360

154-
<details>
155-
<summary>Parameter summary</summary>
156-
<table class="source-line" data-source-line="67">
157-
<thead>
158-
<tr>
159-
<th>Parameter</th>
160-
<th>Description</th>
161-
</tr>
162-
</thead>
163-
<tbody>
164-
<tr>
165-
<td><code>a</code></td>
166-
<td>Black hole spin (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>∈</mo><mo stretchy="false">[</mo><mo>−</mo><mn>0.998</mn><mo separator="true">,</mo><mn>0.998</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">a \in [-0.998, 0.998]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathnormal">a</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">∈</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">[</span><span class="mord">−</span><span class="mord">0.998</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">0.998</span><span class="mclose">]</span></span></span></span>)</td>
167-
</tr>
168-
<tr>
169-
<td><code>incl</code></td>
170-
<td>Observer inclination <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">θ</span></span></span></span> (degrees)</td>
171-
</tr>
172-
<tr>
173-
<td><code>alpha</code></td>
174-
<td>Emissivity powerlaw index everywhere beyond <code>e5</code></td>
175-
</tr>
176-
<tr>
177-
<td><code>rmin</code></td>
178-
<td>Inner radius of the accretion disc</td>
179-
</tr>
180-
<tr>
181-
<td><code>rmax</code></td>
182-
<td>Outer radius of the accretion disc</td>
183-
</tr>
184-
<tr>
185-
<td><code>e1</code> - <code>e5</code></td>
186-
<td>Emissivity interpolation knots (see <a href="#emissivity-interpolation">Emissivity interpolation</a>)</td>
187-
</tr>
188-
</tbody>
189-
</table>
190-
</details>
191-
192-
<p></p>
61+
| Parameter | Description |
62+
| ------------ | ------------------------------------------------------------------------------------------ |
63+
| `a` | Unitless black hole spin |
64+
| `incl` | Observer inclination $\theta$ (degrees) |
65+
| `alpha` | Emissivity powerlaw index beyond `e5` |
66+
| `rmin` | Inner radius of the accretion disc |
67+
| `rout` | Outer radius of the accretion disc |
68+
| `e1` to `e5` | Emissivity interpolation knots (see [Emissivity interpolation](#emissivity-interpolation)) |
19369

19470
## Usage
19571

@@ -211,18 +87,16 @@ $$
21187

21288
The cutoff radius $r_\text{cut}$ is just under half of the outer radius of the disc in log space.
21389

214-
where the different $r_i$ are calculated as $N$ log linear intervals between the inner and outer radius of the disc.
215-
90+
where the different $r_i$ are calculated as $N$ log linear intervals between the inner and outer radius of the disc.
21691

21792
This interpolation regime is in order to mimic the different emissivity functions of a disc irradiated by some arbitrary, axis-symmetric ionizing flux. The ionizing flux may itself be a consequence of different coronal models for the black hole. Fitting the emissivity functions should thereby allow the model to infer general properties about e.g. the morphology or position of the corona.
21893

219-
For example, the ionizing flux of a lamp post corona around a maximally spinning black hole at height $h = 10\, r_\text{g}$ may be approximated with this emissivity interpolation:
94+
For example, the ionizing flux of a lamp post corona around a maximally spinning black hole at height $h = 10 r_\text{g}$ may be approximated with this emissivity interpolation:
22095

22196
<p align="center" pa="0" ma="0">
22297
<img width="600px" src="assets/emissivity-interpolation.svg" alt=""/>
22398
</p>
22499

225-
226100
## Building from source
227101

228102
To build the static library from source, compile with Zig v0.11 (current master):

0 commit comments

Comments
 (0)