Note
Go to the end to download the full example code.
Fitting RHESSI Spectra#
Example of Fitting RHESSI Spectra#
This notebook provides a quick overlook of the fitting code in sunkit-spex and some real examples of fitting RHESSI spectra that can be compared to published works.
Try fitting the spectra presented in [Fletcher2007] an M1.2 flare which occurred on 2002 October 5.
For a more explained demonstration of the general fitting process and capabilities see the NuSTAR fitting example.
import warnings
import matplotlib.pyplot as plt
import numpy as np
from numpy.exceptions import VisibleDeprecationWarning
from parfive import Downloader
from astropy.time import Time
from sunkit_spex.extern.rhessi import RhessiLoader
from sunkit_spex.legacy.fitting.fitter import Fitter
warnings.filterwarnings("ignore", category=RuntimeWarning)
try:
warnings.filterwarnings("ignore", category=VisibleDeprecationWarning)
except AttributeError:
warnings.filterwarnings("ignore", category=np.exceptions.VisibleDeprecationWarning)
Download the example data
dl = Downloader()
base_url = "https://sky.dias.ie/public.php/dav/files/BHW6y6aXiGGosM6/rhessi/"
file_names = ["20021005_103800_spec.fits", "20021005_103800_srm.fits"]
for fname in file_names:
dl.enqueue_file(base_url + fname, path="../../rhessi/")
files = dl.download()
Files Downloaded: 0%| | 0/2 [00:00<?, ?file/s]
20021005_103800_srm.fits: 0%| | 0.00/420k [00:00<?, ?B/s]
20021005_103800_spec.fits: 0%| | 0.00/536k [00:00<?, ?B/s]
20021005_103800_srm.fits: 0%| | 1.02k/420k [00:00<01:05, 6.39kB/s]
20021005_103800_spec.fits: 0%| | 1.02k/536k [00:00<01:23, 6.37kB/s]
20021005_103800_srm.fits: 10%|▉ | 42.0k/420k [00:00<00:02, 136kB/s]
20021005_103800_spec.fits: 8%|▊ | 42.0k/536k [00:00<00:03, 134kB/s]
20021005_103800_spec.fits: 25%|██▍ | 132k/536k [00:00<00:01, 375kB/s]
20021005_103800_srm.fits: 51%|█████ | 214k/420k [00:00<00:00, 490kB/s]
Files Downloaded: 50%|█████ | 1/2 [00:00<00:00, 1.09file/s]
20021005_103800_spec.fits: 53%|█████▎ | 282k/536k [00:00<00:00, 722kB/s]
Files Downloaded: 100%|██████████| 2/2 [00:01<00:00, 2.28file/s]
Files Downloaded: 100%|██████████| 2/2 [00:01<00:00, 1.96file/s]
Set up some plotting numbers
time_profile_size = (9, 6)
spec_plot_size = (6, 6)
tol = 1e-20
spec_font_size = 18
default_text = 10
xlims, ylims = [3, 100], [5e-4, 1e4]
Load in the data…
rhess_spec = RhessiLoader(
spectrum_fn="../../rhessi/20021005_103800_spec.fits", srm_fn="../../rhessi/20021005_103800_srm.fits"
)
To see what we have, we can plot the time profile. The whole file time is taken as the event time as default (indicated by purple shaded region).
We do this by accessing the RHESSI spectral loader in the ress_spec.loaded_spec_data dictionary.
Since the RHESSI spectrum is the only one loaded it is under the "spectrum1" entry.
Default energy range plotted is all energies but the user can define an energy rangem or ranges. Ranges are inclusive at the bounds and here we see the 5$-$10 keV, 10$-$30 keV, and 25$-$50 keV ranges.
plt.rcParams["font.size"] = spec_font_size
plt.figure(figsize=time_profile_size)
# the line that actually plots
rhess_spec.lightcurve(energy_ranges=[[5, 10], [10, 30], [25, 50]])
plt.show()
plt.rcParams["font.size"] = default_text

Since the default event data is assumed to be the full time, we might want to change this. We also define a background time too and plot again.
Both need to be set, if one is None (default) then no background will be calculated or will be removed
Plot again
plt.rcParams["font.size"] = spec_font_size
plt.figure(figsize=time_profile_size)
rhess_spec.lightcurve(energy_ranges=[[5, 10], [10, 30], [25, 50]])
plt.show()
plt.rcParams["font.size"] = default_text

We can also see the X-ray evolution via a spectrogram.
# plot spectrogram
plt.rcParams["font.size"] = spec_font_size
plt.figure(figsize=(15, 10))
rhess_spec.spectrogram()
plt.show()
plt.rcParams["font.size"] = default_text
![RHESSI Spectrogram [Counts s$^{-1}$]](../../../_images/sphx_glr_fitting_RHESSI_spectra_003.png)
Now let’s get going with a model and explicitly stating a fit statistic
fitter = Fitter(rhess_spec)
fitter.model = "(f_vth+thick_fn)"
fitter.loglikelihood = "cstat"
See what parameters we have to play with:
fitter.show_params
Looking at the spectrum, define sensible numbers for starting values (maybe some trial and error here).
For this sepctrum, we will fit the thermal and non-thermal model over different energy ranges separately then both over the full range.
We fit the thermal model from 6$-$15 keV and fix the non-thermal model parameters.
fitter.energy_fitting_range = [6, 15]
# sort model parameters
fitter.params["T1_spectrum1"] = {"Value": 50, "Bounds": (15, 99)}
fitter.params["EM1_spectrum1"] = {"Value": 2e1, "Bounds": (1e0, 1e4)}
fitter.params["total_eflux1_spectrum1"] = {"Status": "fix", "Value": 0.9, "Bounds": (1e-1, 1e1)}
fitter.params["index1_spectrum1"] = {"Status": "fix", "Value": 6, "Bounds": (3, 1e1)}
fitter.params["e_c1_spectrum1"] = {"Status": "fix", "Value": 2e1, "Bounds": (1e1, 1e2)}
Now perform the fit.
rhess_spec_fit = fitter.fit(tol=tol)
Fix thermal parameters and free non-thermal parameters and fit over 15$-$45 keV.
fitter.energy_fitting_range = [15, 45]
# sort model parameters
fitter.params["T1_spectrum1"] = "fix"
fitter.params["EM1_spectrum1"] = "fix"
fitter.params["total_eflux1_spectrum1"] = "free"
fitter.params["index1_spectrum1"] = "free"
fitter.params["e_c1_spectrum1"] = "free"
Do the fit
rhess_spec_fit = fitter.fit(tol=tol)
Free all parameters and fit over 6$-$45 keV.
# define energy fitting range
fitter.energy_fitting_range = [6, 45]
# sort model parameters
fitter.params["T1_spectrum1"] = "free"
fitter.params["EM1_spectrum1"] = "free"
fitter.params["total_eflux1_spectrum1"] = "free"
fitter.params["index1_spectrum1"] = "free"
fitter.params["e_c1_spectrum1"] = "free"
Fit
rhess_spec_fit = fitter.fit(tol=tol)
Let’s plot the result. Since a background has been set it will be displayed in grey behind all other models and data.
plt.rcParams["font.size"] = spec_font_size
plt.figure(figsize=spec_plot_size)
# the line that actually plots
axes, res_axes = fitter.plot()
# make plot nicer
for a in axes:
a.set_xlim(xlims)
a.set_ylim(ylims)
a.set_xscale("log")
plt.show()
plt.rcParams["font.size"] = default_text

How is the background included when fitting?#
By default the (time scaled) background is added to the model then compared to the event data (i.e., fitting the event data with background+model). This is the recommended approach, especially since we’re dealing with Poisson statistics.
However, this has been difficult in the past in software like OSPEX and so fitting usually been done by subtracting the background from the event time and fitting the model to the result (i.e., fitting the event-background with the model). To replicate this method we make use of the data2data_minus_background setter; we set this to True.
fitter.data.loaded_spec_data["spectrum1"].data2data_minus_background = True
/home/docs/checkouts/readthedocs.org/user_builds/sunkit-spex/checkouts/250/examples/legacy/fitting_RHESSI_spectra.py:227: UserWarning: Please use the `subtract_background` property instead.
fitter.data.loaded_spec_data["spectrum1"].data2data_minus_background = True
The data being fitted then becomes event-background and a dictionary key is set to make sure that the background is not included in the fitting process. Fitting continues as normal as though there is not background.
We then reset the parameter starting values, perform the fit, and plot again.
# define energy fitting range
fitter.energy_fitting_range = [6, 15]
# sort model parameters
fitter.params["T1_spectrum1"] = {"Value": 50, "Bounds": (15, 99)} # 22
fitter.params["EM1_spectrum1"] = {"Value": 2e1, "Bounds": (1e0, 1e2)} # 20
fitter.params["total_eflux1_spectrum1"] = {"Status": "fix", "Value": 0.9, "Bounds": (1e-1, 1e1)}
fitter.params["index1_spectrum1"] = {"Status": "fix", "Value": 6, "Bounds": (3, 1e1)}
fitter.params["e_c1_spectrum1"] = {"Status": "fix", "Value": 2e1, "Bounds": (1e1, 1e2)}
Fit
fitter.fit(tol=tol)
# define energy fitting range
fitter.energy_fitting_range = [15, 45]
# sort model parameters
fitter.params["T1_spectrum1"] = "fix"
fitter.params["EM1_spectrum1"] = "fix"
fitter.params["total_eflux1_spectrum1"] = "free"
fitter.params["index1_spectrum1"] = "free"
fitter.params["e_c1_spectrum1"] = "free"
# fit
fitter.fit(tol=tol)
# define energy fitting range
fitter.energy_fitting_range = [6, 45]
# sort model parameters
fitter.params["T1_spectrum1"] = "free"
fitter.params["EM1_spectrum1"] = "free"
fitter.params["total_eflux1_spectrum1"] = "free"
fitter.params["index1_spectrum1"] = "free"
fitter.params["e_c1_spectrum1"] = "free"
# fit
fitter.fit(tol=tol)
[22.113890752889844, 99.99999628170605, 0.8735518488341278, 3.565270937497191, 10.00150573857859]
Plot again plot
plt.rcParams["font.size"] = spec_font_size
plt.figure(figsize=spec_plot_size)
# the line that actually plots
axes, res_axes = fitter.plot()
# make plot nicer
for a in axes:
a.set_xlim(xlims)
a.set_ylim(ylims)
a.set_xscale("log")
plt.show()
plt.rcParams["font.size"] = default_text

As we can see, there is a “Counts=Evt-BG” tag added in the top left corner of the plot along with the BG grey label to indicate that the counts being fitted are calculated from the background subtracted event data.
If the user wishes to undo this and wants to return to using the model+background fitting the event method then set
data2data_minus_background back to False like so.
fitter.data.loaded_spec_data["spectrum1"].data2data_minus_background = False
/home/docs/checkouts/readthedocs.org/user_builds/sunkit-spex/checkouts/250/examples/legacy/fitting_RHESSI_spectra.py:304: UserWarning: Please use the `subtract_background` property instead.
fitter.data.loaded_spec_data["spectrum1"].data2data_minus_background = False
Any change to the background time and the data2data_minus_background setter will be set back to False.
Therefore, if the user changes the background times at all and still wants the event-background method then the
data2data_minus_background setter must be set to True again.
Running an MCMC#
Run the MCMC.
rhess_spec_mcmc = fitter.run_mcmc()
0%| | 0/1200 [00:00<?, ?it/s]
0%| | 4/1200 [00:00<00:41, 28.87it/s]
1%| | 7/1200 [00:00<00:46, 25.93it/s]
1%| | 10/1200 [00:00<00:53, 22.35it/s]
1%| | 13/1200 [00:00<00:54, 21.63it/s]
1%|▏ | 16/1200 [00:00<01:01, 19.30it/s]
2%|▏ | 18/1200 [00:00<01:03, 18.56it/s]
2%|▏ | 20/1200 [00:00<01:05, 18.00it/s]
2%|▏ | 22/1200 [00:01<01:07, 17.57it/s]
2%|▏ | 24/1200 [00:01<01:08, 17.20it/s]
2%|▏ | 26/1200 [00:01<01:06, 17.53it/s]
2%|▏ | 28/1200 [00:01<01:08, 17.17it/s]
2%|▎ | 30/1200 [00:01<01:08, 17.18it/s]
3%|▎ | 32/1200 [00:01<01:09, 16.88it/s]
3%|▎ | 34/1200 [00:01<01:08, 16.94it/s]
3%|▎ | 36/1200 [00:01<01:08, 16.99it/s]
3%|▎ | 38/1200 [00:02<01:10, 16.43it/s]
3%|▎ | 40/1200 [00:02<01:12, 16.04it/s]
4%|▎ | 42/1200 [00:02<01:14, 15.53it/s]
4%|▎ | 44/1200 [00:02<01:14, 15.43it/s]
4%|▍ | 46/1200 [00:02<01:16, 15.08it/s]
4%|▍ | 48/1200 [00:02<01:17, 14.86it/s]
4%|▍ | 50/1200 [00:02<01:18, 14.71it/s]
4%|▍ | 52/1200 [00:03<01:18, 14.60it/s]
4%|▍ | 54/1200 [00:03<01:19, 14.50it/s]
5%|▍ | 56/1200 [00:03<01:19, 14.42it/s]
5%|▍ | 58/1200 [00:03<01:19, 14.41it/s]
5%|▌ | 60/1200 [00:03<01:19, 14.38it/s]
5%|▌ | 62/1200 [00:03<01:19, 14.33it/s]
5%|▌ | 64/1200 [00:03<01:19, 14.25it/s]
6%|▌ | 66/1200 [00:04<01:19, 14.27it/s]
6%|▌ | 68/1200 [00:04<01:19, 14.27it/s]
6%|▌ | 70/1200 [00:04<01:19, 14.28it/s]
6%|▌ | 72/1200 [00:04<01:18, 14.30it/s]
6%|▌ | 74/1200 [00:04<01:18, 14.32it/s]
6%|▋ | 76/1200 [00:04<01:18, 14.32it/s]
6%|▋ | 78/1200 [00:04<01:18, 14.33it/s]
7%|▋ | 80/1200 [00:04<01:18, 14.34it/s]
7%|▋ | 82/1200 [00:05<01:17, 14.34it/s]
7%|▋ | 84/1200 [00:05<01:18, 14.30it/s]
7%|▋ | 86/1200 [00:05<01:17, 14.31it/s]
7%|▋ | 88/1200 [00:05<01:17, 14.31it/s]
8%|▊ | 90/1200 [00:05<01:17, 14.30it/s]
8%|▊ | 92/1200 [00:05<01:17, 14.29it/s]
8%|▊ | 94/1200 [00:05<01:17, 14.31it/s]
8%|▊ | 96/1200 [00:06<01:17, 14.32it/s]
8%|▊ | 98/1200 [00:06<01:16, 14.33it/s]
8%|▊ | 100/1200 [00:06<01:16, 14.34it/s]
8%|▊ | 102/1200 [00:06<01:16, 14.35it/s]
9%|▊ | 104/1200 [00:06<01:16, 14.36it/s]
9%|▉ | 106/1200 [00:06<01:16, 14.37it/s]
9%|▉ | 108/1200 [00:06<01:16, 14.36it/s]
9%|▉ | 110/1200 [00:07<01:15, 14.37it/s]
9%|▉ | 112/1200 [00:07<01:15, 14.35it/s]
10%|▉ | 114/1200 [00:07<01:15, 14.33it/s]
10%|▉ | 116/1200 [00:07<01:15, 14.35it/s]
10%|▉ | 118/1200 [00:07<01:15, 14.36it/s]
10%|█ | 120/1200 [00:07<01:15, 14.34it/s]
10%|█ | 122/1200 [00:07<01:15, 14.33it/s]
10%|█ | 124/1200 [00:08<01:14, 14.35it/s]
10%|█ | 126/1200 [00:08<01:14, 14.33it/s]
11%|█ | 128/1200 [00:08<01:14, 14.35it/s]
11%|█ | 130/1200 [00:08<01:14, 14.36it/s]
11%|█ | 132/1200 [00:08<01:14, 14.35it/s]
11%|█ | 134/1200 [00:08<01:14, 14.33it/s]
11%|█▏ | 136/1200 [00:08<01:14, 14.34it/s]
12%|█▏ | 138/1200 [00:09<01:14, 14.33it/s]
12%|█▏ | 140/1200 [00:09<01:14, 14.31it/s]
12%|█▏ | 142/1200 [00:09<01:13, 14.30it/s]
12%|█▏ | 144/1200 [00:09<01:13, 14.32it/s]
12%|█▏ | 146/1200 [00:09<01:13, 14.33it/s]
12%|█▏ | 148/1200 [00:09<01:13, 14.31it/s]
12%|█▎ | 150/1200 [00:09<01:13, 14.30it/s]
13%|█▎ | 152/1200 [00:10<01:13, 14.32it/s]
13%|█▎ | 154/1200 [00:10<01:13, 14.32it/s]
13%|█▎ | 156/1200 [00:10<01:12, 14.32it/s]
13%|█▎ | 158/1200 [00:10<01:12, 14.34it/s]
13%|█▎ | 160/1200 [00:10<01:12, 14.35it/s]
14%|█▎ | 162/1200 [00:10<01:12, 14.35it/s]
14%|█▎ | 164/1200 [00:10<01:12, 14.36it/s]
14%|█▍ | 166/1200 [00:10<01:11, 14.36it/s]
14%|█▍ | 168/1200 [00:11<01:11, 14.34it/s]
14%|█▍ | 170/1200 [00:11<01:12, 14.30it/s]
14%|█▍ | 172/1200 [00:11<01:11, 14.31it/s]
14%|█▍ | 174/1200 [00:11<01:11, 14.32it/s]
15%|█▍ | 176/1200 [00:11<01:11, 14.32it/s]
15%|█▍ | 178/1200 [00:11<01:11, 14.31it/s]
15%|█▌ | 180/1200 [00:11<01:11, 14.32it/s]
15%|█▌ | 182/1200 [00:12<01:11, 14.33it/s]
15%|█▌ | 184/1200 [00:12<01:10, 14.33it/s]
16%|█▌ | 186/1200 [00:12<01:10, 14.33it/s]
16%|█▌ | 188/1200 [00:12<01:10, 14.34it/s]
16%|█▌ | 190/1200 [00:12<01:10, 14.38it/s]
16%|█▌ | 192/1200 [00:12<01:10, 14.40it/s]
16%|█▌ | 194/1200 [00:12<01:09, 14.41it/s]
16%|█▋ | 196/1200 [00:13<01:09, 14.42it/s]
16%|█▋ | 198/1200 [00:13<01:09, 14.41it/s]
17%|█▋ | 200/1200 [00:13<01:09, 14.40it/s]
17%|█▋ | 202/1200 [00:13<01:09, 14.41it/s]
17%|█▋ | 204/1200 [00:13<01:09, 14.43it/s]
17%|█▋ | 206/1200 [00:13<01:09, 14.40it/s]
17%|█▋ | 208/1200 [00:13<01:08, 14.38it/s]
18%|█▊ | 210/1200 [00:14<01:08, 14.42it/s]
18%|█▊ | 212/1200 [00:14<01:08, 14.41it/s]
18%|█▊ | 214/1200 [00:14<01:08, 14.42it/s]
18%|█▊ | 216/1200 [00:14<01:08, 14.46it/s]
18%|█▊ | 218/1200 [00:14<01:07, 14.48it/s]
18%|█▊ | 220/1200 [00:14<01:07, 14.50it/s]
18%|█▊ | 222/1200 [00:14<01:07, 14.52it/s]
19%|█▊ | 224/1200 [00:15<01:07, 14.54it/s]
19%|█▉ | 226/1200 [00:15<01:06, 14.54it/s]
19%|█▉ | 228/1200 [00:15<01:06, 14.53it/s]
19%|█▉ | 230/1200 [00:15<01:06, 14.54it/s]
19%|█▉ | 232/1200 [00:15<01:06, 14.57it/s]
20%|█▉ | 234/1200 [00:15<01:06, 14.55it/s]
20%|█▉ | 236/1200 [00:15<01:06, 14.54it/s]
20%|█▉ | 238/1200 [00:15<01:06, 14.56it/s]
20%|██ | 240/1200 [00:16<01:05, 14.59it/s]
20%|██ | 242/1200 [00:16<01:05, 14.61it/s]
20%|██ | 244/1200 [00:16<01:05, 14.58it/s]
20%|██ | 246/1200 [00:16<01:05, 14.62it/s]
21%|██ | 248/1200 [00:16<01:04, 14.65it/s]
21%|██ | 250/1200 [00:16<01:04, 14.68it/s]
21%|██ | 252/1200 [00:16<01:04, 14.69it/s]
21%|██ | 254/1200 [00:17<01:04, 14.71it/s]
21%|██▏ | 256/1200 [00:17<01:04, 14.71it/s]
22%|██▏ | 258/1200 [00:17<01:04, 14.69it/s]
22%|██▏ | 260/1200 [00:17<01:03, 14.70it/s]
22%|██▏ | 262/1200 [00:17<01:03, 14.71it/s]
22%|██▏ | 264/1200 [00:17<01:03, 14.69it/s]
22%|██▏ | 266/1200 [00:17<01:03, 14.63it/s]
22%|██▏ | 268/1200 [00:18<01:03, 14.61it/s]
22%|██▎ | 270/1200 [00:18<01:03, 14.65it/s]
23%|██▎ | 272/1200 [00:18<01:03, 14.66it/s]
23%|██▎ | 274/1200 [00:18<01:03, 14.69it/s]
23%|██▎ | 276/1200 [00:18<01:02, 14.70it/s]
23%|██▎ | 278/1200 [00:18<01:02, 14.72it/s]
23%|██▎ | 280/1200 [00:18<01:02, 14.74it/s]
24%|██▎ | 282/1200 [00:18<01:02, 14.75it/s]
24%|██▎ | 284/1200 [00:19<01:02, 14.77it/s]
24%|██▍ | 286/1200 [00:19<01:01, 14.75it/s]
24%|██▍ | 288/1200 [00:19<01:01, 14.73it/s]
24%|██▍ | 290/1200 [00:19<01:01, 14.73it/s]
24%|██▍ | 292/1200 [00:19<01:01, 14.74it/s]
24%|██▍ | 294/1200 [00:19<01:01, 14.72it/s]
25%|██▍ | 296/1200 [00:19<01:01, 14.73it/s]
25%|██▍ | 298/1200 [00:20<01:01, 14.76it/s]
25%|██▌ | 300/1200 [00:20<01:01, 14.74it/s]
25%|██▌ | 302/1200 [00:20<01:00, 14.74it/s]
25%|██▌ | 304/1200 [00:20<01:00, 14.76it/s]
26%|██▌ | 306/1200 [00:20<01:00, 14.78it/s]
26%|██▌ | 308/1200 [00:20<01:00, 14.79it/s]
26%|██▌ | 310/1200 [00:20<01:00, 14.79it/s]
26%|██▌ | 312/1200 [00:21<00:59, 14.80it/s]
26%|██▌ | 314/1200 [00:21<00:59, 14.80it/s]
26%|██▋ | 316/1200 [00:21<00:59, 14.76it/s]
26%|██▋ | 318/1200 [00:21<00:59, 14.76it/s]
27%|██▋ | 320/1200 [00:21<00:59, 14.77it/s]
27%|██▋ | 322/1200 [00:21<00:59, 14.78it/s]
27%|██▋ | 324/1200 [00:21<00:59, 14.74it/s]
27%|██▋ | 326/1200 [00:21<00:59, 14.74it/s]
27%|██▋ | 328/1200 [00:22<00:59, 14.73it/s]
28%|██▊ | 330/1200 [00:22<00:59, 14.72it/s]
28%|██▊ | 332/1200 [00:22<00:58, 14.73it/s]
28%|██▊ | 334/1200 [00:22<00:58, 14.75it/s]
28%|██▊ | 336/1200 [00:22<00:58, 14.76it/s]
28%|██▊ | 338/1200 [00:22<00:58, 14.79it/s]
28%|██▊ | 340/1200 [00:22<00:58, 14.79it/s]
28%|██▊ | 342/1200 [00:23<00:58, 14.79it/s]
29%|██▊ | 344/1200 [00:23<00:57, 14.80it/s]
29%|██▉ | 346/1200 [00:23<00:57, 14.77it/s]
29%|██▉ | 348/1200 [00:23<00:57, 14.77it/s]
29%|██▉ | 350/1200 [00:23<00:57, 14.79it/s]
29%|██▉ | 352/1200 [00:23<00:57, 14.77it/s]
30%|██▉ | 354/1200 [00:23<00:57, 14.76it/s]
30%|██▉ | 356/1200 [00:23<00:57, 14.76it/s]
30%|██▉ | 358/1200 [00:24<00:57, 14.77it/s]
30%|███ | 360/1200 [00:24<00:56, 14.78it/s]
30%|███ | 362/1200 [00:24<00:56, 14.78it/s]
30%|███ | 364/1200 [00:24<00:56, 14.79it/s]
30%|███ | 366/1200 [00:24<00:56, 14.79it/s]
31%|███ | 368/1200 [00:24<00:56, 14.81it/s]
31%|███ | 370/1200 [00:24<00:56, 14.81it/s]
31%|███ | 372/1200 [00:25<00:55, 14.81it/s]
31%|███ | 374/1200 [00:25<00:56, 14.72it/s]
31%|███▏ | 376/1200 [00:25<00:56, 14.71it/s]
32%|███▏ | 378/1200 [00:25<00:55, 14.73it/s]
32%|███▏ | 380/1200 [00:25<00:55, 14.76it/s]
32%|███▏ | 382/1200 [00:25<00:55, 14.74it/s]
32%|███▏ | 384/1200 [00:25<00:55, 14.73it/s]
32%|███▏ | 386/1200 [00:26<00:55, 14.74it/s]
32%|███▏ | 388/1200 [00:26<00:55, 14.71it/s]
32%|███▎ | 390/1200 [00:26<00:55, 14.72it/s]
33%|███▎ | 392/1200 [00:26<00:54, 14.74it/s]
33%|███▎ | 394/1200 [00:26<00:54, 14.76it/s]
33%|███▎ | 396/1200 [00:26<00:54, 14.76it/s]
33%|███▎ | 398/1200 [00:26<00:54, 14.76it/s]
33%|███▎ | 400/1200 [00:26<00:54, 14.75it/s]
34%|███▎ | 402/1200 [00:27<00:54, 14.75it/s]
34%|███▎ | 404/1200 [00:27<00:54, 14.71it/s]
34%|███▍ | 406/1200 [00:27<00:53, 14.70it/s]
34%|███▍ | 408/1200 [00:27<00:53, 14.73it/s]
34%|███▍ | 410/1200 [00:27<00:53, 14.74it/s]
34%|███▍ | 412/1200 [00:27<00:53, 14.71it/s]
34%|███▍ | 414/1200 [00:27<00:53, 14.71it/s]
35%|███▍ | 416/1200 [00:28<00:53, 14.73it/s]
35%|███▍ | 418/1200 [00:28<00:53, 14.72it/s]
35%|███▌ | 420/1200 [00:28<00:52, 14.72it/s]
35%|███▌ | 422/1200 [00:28<00:52, 14.76it/s]
35%|███▌ | 424/1200 [00:28<00:52, 14.77it/s]
36%|███▌ | 426/1200 [00:28<00:52, 14.77it/s]
36%|███▌ | 428/1200 [00:28<00:52, 14.78it/s]
36%|███▌ | 430/1200 [00:29<00:52, 14.78it/s]
36%|███▌ | 432/1200 [00:29<00:51, 14.78it/s]
36%|███▌ | 434/1200 [00:29<00:51, 14.76it/s]
36%|███▋ | 436/1200 [00:29<00:51, 14.75it/s]
36%|███▋ | 438/1200 [00:29<00:51, 14.76it/s]
37%|███▋ | 440/1200 [00:29<00:51, 14.77it/s]
37%|███▋ | 442/1200 [00:29<00:51, 14.75it/s]
37%|███▋ | 444/1200 [00:29<00:51, 14.75it/s]
37%|███▋ | 446/1200 [00:30<00:51, 14.75it/s]
37%|███▋ | 448/1200 [00:30<00:50, 14.75it/s]
38%|███▊ | 450/1200 [00:30<00:50, 14.77it/s]
38%|███▊ | 452/1200 [00:30<00:50, 14.79it/s]
38%|███▊ | 454/1200 [00:30<00:50, 14.80it/s]
38%|███▊ | 456/1200 [00:30<00:50, 14.80it/s]
38%|███▊ | 458/1200 [00:30<00:50, 14.81it/s]
38%|███▊ | 460/1200 [00:31<00:49, 14.81it/s]
38%|███▊ | 462/1200 [00:31<00:49, 14.82it/s]
39%|███▊ | 464/1200 [00:31<00:49, 14.77it/s]
39%|███▉ | 466/1200 [00:31<00:49, 14.78it/s]
39%|███▉ | 468/1200 [00:31<00:49, 14.80it/s]
39%|███▉ | 470/1200 [00:31<00:49, 14.79it/s]
39%|███▉ | 472/1200 [00:31<00:49, 14.77it/s]
40%|███▉ | 474/1200 [00:31<00:49, 14.78it/s]
40%|███▉ | 476/1200 [00:32<00:48, 14.78it/s]
40%|███▉ | 478/1200 [00:32<00:48, 14.77it/s]
40%|████ | 480/1200 [00:32<00:48, 14.79it/s]
40%|████ | 482/1200 [00:32<00:48, 14.78it/s]
40%|████ | 484/1200 [00:32<00:48, 14.80it/s]
40%|████ | 486/1200 [00:32<00:48, 14.80it/s]
41%|████ | 488/1200 [00:32<00:48, 14.82it/s]
41%|████ | 490/1200 [00:33<00:47, 14.82it/s]
41%|████ | 492/1200 [00:33<00:47, 14.80it/s]
41%|████ | 494/1200 [00:33<00:47, 14.78it/s]
41%|████▏ | 496/1200 [00:33<00:47, 14.78it/s]
42%|████▏ | 498/1200 [00:33<00:47, 14.79it/s]
42%|████▏ | 500/1200 [00:33<00:47, 14.77it/s]
42%|████▏ | 502/1200 [00:33<00:47, 14.75it/s]
42%|████▏ | 504/1200 [00:34<00:47, 14.77it/s]
42%|████▏ | 506/1200 [00:34<00:46, 14.78it/s]
42%|████▏ | 508/1200 [00:34<00:46, 14.78it/s]
42%|████▎ | 510/1200 [00:34<00:46, 14.80it/s]
43%|████▎ | 512/1200 [00:34<00:46, 14.81it/s]
43%|████▎ | 514/1200 [00:34<00:46, 14.82it/s]
43%|████▎ | 516/1200 [00:34<00:46, 14.83it/s]
43%|████▎ | 518/1200 [00:34<00:46, 14.82it/s]
43%|████▎ | 520/1200 [00:35<00:45, 14.84it/s]
44%|████▎ | 522/1200 [00:35<00:45, 14.82it/s]
44%|████▎ | 524/1200 [00:35<00:45, 14.79it/s]
44%|████▍ | 526/1200 [00:35<00:45, 14.76it/s]
44%|████▍ | 528/1200 [00:35<00:45, 14.78it/s]
44%|████▍ | 530/1200 [00:35<00:45, 14.78it/s]
44%|████▍ | 532/1200 [00:35<00:45, 14.76it/s]
44%|████▍ | 534/1200 [00:36<00:45, 14.77it/s]
45%|████▍ | 536/1200 [00:36<00:44, 14.78it/s]
45%|████▍ | 538/1200 [00:36<00:44, 14.78it/s]
45%|████▌ | 540/1200 [00:36<00:44, 14.80it/s]
45%|████▌ | 542/1200 [00:36<00:44, 14.81it/s]
45%|████▌ | 544/1200 [00:36<00:44, 14.82it/s]
46%|████▌ | 546/1200 [00:36<00:44, 14.83it/s]
46%|████▌ | 548/1200 [00:36<00:44, 14.82it/s]
46%|████▌ | 550/1200 [00:37<00:43, 14.81it/s]
46%|████▌ | 552/1200 [00:37<00:43, 14.79it/s]
46%|████▌ | 554/1200 [00:37<00:43, 14.77it/s]
46%|████▋ | 556/1200 [00:37<00:43, 14.79it/s]
46%|████▋ | 558/1200 [00:37<00:43, 14.80it/s]
47%|████▋ | 560/1200 [00:37<00:43, 14.79it/s]
47%|████▋ | 562/1200 [00:37<00:43, 14.77it/s]
47%|████▋ | 564/1200 [00:38<00:42, 14.79it/s]
47%|████▋ | 566/1200 [00:38<00:42, 14.79it/s]
47%|████▋ | 568/1200 [00:38<00:42, 14.80it/s]
48%|████▊ | 570/1200 [00:38<00:42, 14.81it/s]
48%|████▊ | 572/1200 [00:38<00:42, 14.82it/s]
48%|████▊ | 574/1200 [00:38<00:42, 14.80it/s]
48%|████▊ | 576/1200 [00:38<00:42, 14.81it/s]
48%|████▊ | 578/1200 [00:39<00:42, 14.79it/s]
48%|████▊ | 580/1200 [00:39<00:41, 14.80it/s]
48%|████▊ | 582/1200 [00:39<00:41, 14.75it/s]
49%|████▊ | 584/1200 [00:39<00:41, 14.67it/s]
49%|████▉ | 586/1200 [00:39<00:41, 14.72it/s]
49%|████▉ | 588/1200 [00:39<00:41, 14.75it/s]
49%|████▉ | 590/1200 [00:39<00:41, 14.75it/s]
49%|████▉ | 592/1200 [00:39<00:41, 14.75it/s]
50%|████▉ | 594/1200 [00:40<00:41, 14.78it/s]
50%|████▉ | 596/1200 [00:40<00:40, 14.77it/s]
50%|████▉ | 598/1200 [00:40<00:40, 14.79it/s]
50%|█████ | 600/1200 [00:40<00:40, 14.80it/s]
50%|█████ | 602/1200 [00:40<00:40, 14.81it/s]
50%|█████ | 604/1200 [00:40<00:40, 14.81it/s]
50%|█████ | 606/1200 [00:40<00:40, 14.80it/s]
51%|█████ | 608/1200 [00:41<00:39, 14.81it/s]
51%|█████ | 610/1200 [00:41<00:39, 14.79it/s]
51%|█████ | 612/1200 [00:41<00:39, 14.77it/s]
51%|█████ | 614/1200 [00:41<00:39, 14.78it/s]
51%|█████▏ | 616/1200 [00:41<00:39, 14.79it/s]
52%|█████▏ | 618/1200 [00:41<00:39, 14.74it/s]
52%|█████▏ | 620/1200 [00:41<00:39, 14.72it/s]
52%|█████▏ | 622/1200 [00:41<00:39, 14.74it/s]
52%|█████▏ | 624/1200 [00:42<00:39, 14.77it/s]
52%|█████▏ | 626/1200 [00:42<00:38, 14.76it/s]
52%|█████▏ | 628/1200 [00:42<00:38, 14.79it/s]
52%|█████▎ | 630/1200 [00:42<00:38, 14.80it/s]
53%|█████▎ | 632/1200 [00:42<00:38, 14.82it/s]
53%|█████▎ | 634/1200 [00:42<00:38, 14.83it/s]
53%|█████▎ | 636/1200 [00:42<00:38, 14.83it/s]
53%|█████▎ | 638/1200 [00:43<00:37, 14.83it/s]
53%|█████▎ | 640/1200 [00:43<00:37, 14.83it/s]
54%|█████▎ | 642/1200 [00:43<00:37, 14.80it/s]
54%|█████▎ | 644/1200 [00:43<00:37, 14.80it/s]
54%|█████▍ | 646/1200 [00:43<00:37, 14.80it/s]
54%|█████▍ | 648/1200 [00:43<00:37, 14.80it/s]
54%|█████▍ | 650/1200 [00:43<00:37, 14.78it/s]
54%|█████▍ | 652/1200 [00:44<00:37, 14.79it/s]
55%|█████▍ | 654/1200 [00:44<00:36, 14.79it/s]
55%|█████▍ | 656/1200 [00:44<00:36, 14.78it/s]
55%|█████▍ | 658/1200 [00:44<00:36, 14.80it/s]
55%|█████▌ | 660/1200 [00:44<00:36, 14.80it/s]
55%|█████▌ | 662/1200 [00:44<00:36, 14.80it/s]
55%|█████▌ | 664/1200 [00:44<00:36, 14.82it/s]
56%|█████▌ | 666/1200 [00:44<00:36, 14.81it/s]
56%|█████▌ | 668/1200 [00:45<00:35, 14.79it/s]
56%|█████▌ | 670/1200 [00:45<00:35, 14.79it/s]
56%|█████▌ | 672/1200 [00:45<00:35, 14.77it/s]
56%|█████▌ | 674/1200 [00:45<00:35, 14.79it/s]
56%|█████▋ | 676/1200 [00:45<00:35, 14.80it/s]
56%|█████▋ | 678/1200 [00:45<00:35, 14.79it/s]
57%|█████▋ | 680/1200 [00:45<00:35, 14.77it/s]
57%|█████▋ | 682/1200 [00:46<00:35, 14.78it/s]
57%|█████▋ | 684/1200 [00:46<00:34, 14.79it/s]
57%|█████▋ | 686/1200 [00:46<00:34, 14.80it/s]
57%|█████▋ | 688/1200 [00:46<00:34, 14.81it/s]
57%|█████▊ | 690/1200 [00:46<00:34, 14.83it/s]
58%|█████▊ | 692/1200 [00:46<00:34, 14.82it/s]
58%|█████▊ | 694/1200 [00:46<00:34, 14.79it/s]
58%|█████▊ | 696/1200 [00:46<00:34, 14.80it/s]
58%|█████▊ | 698/1200 [00:47<00:33, 14.81it/s]
58%|█████▊ | 700/1200 [00:47<00:33, 14.80it/s]
58%|█████▊ | 702/1200 [00:47<00:33, 14.78it/s]
59%|█████▊ | 704/1200 [00:47<00:33, 14.80it/s]
59%|█████▉ | 706/1200 [00:47<00:33, 14.80it/s]
59%|█████▉ | 708/1200 [00:47<00:33, 14.78it/s]
59%|█████▉ | 710/1200 [00:47<00:33, 14.76it/s]
59%|█████▉ | 712/1200 [00:48<00:33, 14.78it/s]
60%|█████▉ | 714/1200 [00:48<00:32, 14.76it/s]
60%|█████▉ | 716/1200 [00:48<00:32, 14.73it/s]
60%|█████▉ | 718/1200 [00:48<00:32, 14.75it/s]
60%|██████ | 720/1200 [00:48<00:32, 14.76it/s]
60%|██████ | 722/1200 [00:48<00:32, 14.69it/s]
60%|██████ | 724/1200 [00:48<00:32, 14.65it/s]
60%|██████ | 726/1200 [00:49<00:32, 14.65it/s]
61%|██████ | 728/1200 [00:49<00:32, 14.68it/s]
61%|██████ | 730/1200 [00:49<00:31, 14.71it/s]
61%|██████ | 732/1200 [00:49<00:31, 14.72it/s]
61%|██████ | 734/1200 [00:49<00:31, 14.74it/s]
61%|██████▏ | 736/1200 [00:49<00:31, 14.76it/s]
62%|██████▏ | 738/1200 [00:49<00:31, 14.76it/s]
62%|██████▏ | 740/1200 [00:49<00:31, 14.76it/s]
62%|██████▏ | 742/1200 [00:50<00:30, 14.78it/s]
62%|██████▏ | 744/1200 [00:50<00:30, 14.78it/s]
62%|██████▏ | 746/1200 [00:50<00:30, 14.78it/s]
62%|██████▏ | 748/1200 [00:50<00:30, 14.80it/s]
62%|██████▎ | 750/1200 [00:50<00:30, 14.80it/s]
63%|██████▎ | 752/1200 [00:50<00:30, 14.80it/s]
63%|██████▎ | 754/1200 [00:50<00:30, 14.79it/s]
63%|██████▎ | 756/1200 [00:51<00:30, 14.80it/s]
63%|██████▎ | 758/1200 [00:51<00:29, 14.80it/s]
63%|██████▎ | 760/1200 [00:51<00:29, 14.79it/s]
64%|██████▎ | 762/1200 [00:51<00:29, 14.79it/s]
64%|██████▎ | 764/1200 [00:51<00:29, 14.80it/s]
64%|██████▍ | 766/1200 [00:51<00:29, 14.80it/s]
64%|██████▍ | 768/1200 [00:51<00:29, 14.79it/s]
64%|██████▍ | 770/1200 [00:52<00:29, 14.79it/s]
64%|██████▍ | 772/1200 [00:52<00:28, 14.80it/s]
64%|██████▍ | 774/1200 [00:52<00:28, 14.80it/s]
65%|██████▍ | 776/1200 [00:52<00:28, 14.79it/s]
65%|██████▍ | 778/1200 [00:52<00:28, 14.80it/s]
65%|██████▌ | 780/1200 [00:52<00:28, 14.81it/s]
65%|██████▌ | 782/1200 [00:52<00:28, 14.81it/s]
65%|██████▌ | 784/1200 [00:52<00:28, 14.81it/s]
66%|██████▌ | 786/1200 [00:53<00:27, 14.80it/s]
66%|██████▌ | 788/1200 [00:53<00:27, 14.80it/s]
66%|██████▌ | 790/1200 [00:53<00:27, 14.78it/s]
66%|██████▌ | 792/1200 [00:53<00:27, 14.79it/s]
66%|██████▌ | 794/1200 [00:53<00:27, 14.80it/s]
66%|██████▋ | 796/1200 [00:53<00:27, 14.78it/s]
66%|██████▋ | 798/1200 [00:53<00:27, 14.76it/s]
67%|██████▋ | 800/1200 [00:54<00:27, 14.77it/s]
67%|██████▋ | 802/1200 [00:54<00:26, 14.77it/s]
67%|██████▋ | 804/1200 [00:54<00:26, 14.76it/s]
67%|██████▋ | 806/1200 [00:54<00:26, 14.76it/s]
67%|██████▋ | 808/1200 [00:54<00:26, 14.78it/s]
68%|██████▊ | 810/1200 [00:54<00:26, 14.78it/s]
68%|██████▊ | 812/1200 [00:54<00:26, 14.78it/s]
68%|██████▊ | 814/1200 [00:54<00:26, 14.80it/s]
68%|██████▊ | 816/1200 [00:55<00:25, 14.81it/s]
68%|██████▊ | 818/1200 [00:55<00:25, 14.79it/s]
68%|██████▊ | 820/1200 [00:55<00:25, 14.78it/s]
68%|██████▊ | 822/1200 [00:55<00:25, 14.78it/s]
69%|██████▊ | 824/1200 [00:55<00:25, 14.79it/s]
69%|██████▉ | 826/1200 [00:55<00:25, 14.78it/s]
69%|██████▉ | 828/1200 [00:55<00:25, 14.76it/s]
69%|██████▉ | 830/1200 [00:56<00:25, 14.78it/s]
69%|██████▉ | 832/1200 [00:56<00:24, 14.74it/s]
70%|██████▉ | 834/1200 [00:56<00:24, 14.77it/s]
70%|██████▉ | 836/1200 [00:56<00:24, 14.78it/s]
70%|██████▉ | 838/1200 [00:56<00:24, 14.78it/s]
70%|███████ | 840/1200 [00:56<00:24, 14.80it/s]
70%|███████ | 842/1200 [00:56<00:24, 14.80it/s]
70%|███████ | 844/1200 [00:57<00:24, 14.80it/s]
70%|███████ | 846/1200 [00:57<00:23, 14.80it/s]
71%|███████ | 848/1200 [00:57<00:23, 14.80it/s]
71%|███████ | 850/1200 [00:57<00:23, 14.79it/s]
71%|███████ | 852/1200 [00:57<00:23, 14.77it/s]
71%|███████ | 854/1200 [00:57<00:23, 14.78it/s]
71%|███████▏ | 856/1200 [00:57<00:23, 14.77it/s]
72%|███████▏ | 858/1200 [00:57<00:23, 14.77it/s]
72%|███████▏ | 860/1200 [00:58<00:22, 14.79it/s]
72%|███████▏ | 862/1200 [00:58<00:22, 14.79it/s]
72%|███████▏ | 864/1200 [00:58<00:22, 14.79it/s]
72%|███████▏ | 866/1200 [00:58<00:22, 14.79it/s]
72%|███████▏ | 868/1200 [00:58<00:22, 14.79it/s]
72%|███████▎ | 870/1200 [00:58<00:22, 14.78it/s]
73%|███████▎ | 872/1200 [00:58<00:22, 14.78it/s]
73%|███████▎ | 874/1200 [00:59<00:22, 14.79it/s]
73%|███████▎ | 876/1200 [00:59<00:21, 14.80it/s]
73%|███████▎ | 878/1200 [00:59<00:21, 14.79it/s]
73%|███████▎ | 880/1200 [00:59<00:21, 14.78it/s]
74%|███████▎ | 882/1200 [00:59<00:21, 14.77it/s]
74%|███████▎ | 884/1200 [00:59<00:21, 14.78it/s]
74%|███████▍ | 886/1200 [00:59<00:20, 15.00it/s]
74%|███████▍ | 888/1200 [00:59<00:20, 14.92it/s]
74%|███████▍ | 890/1200 [01:00<00:20, 14.89it/s]
74%|███████▍ | 892/1200 [01:00<00:20, 14.86it/s]
74%|███████▍ | 894/1200 [01:00<00:20, 14.84it/s]
75%|███████▍ | 896/1200 [01:00<00:20, 14.82it/s]
75%|███████▍ | 898/1200 [01:00<00:20, 14.82it/s]
75%|███████▌ | 900/1200 [01:00<00:20, 14.82it/s]
75%|███████▌ | 902/1200 [01:00<00:20, 14.82it/s]
75%|███████▌ | 904/1200 [01:01<00:19, 14.81it/s]
76%|███████▌ | 906/1200 [01:01<00:19, 14.81it/s]
76%|███████▌ | 908/1200 [01:01<00:19, 14.78it/s]
76%|███████▌ | 910/1200 [01:01<00:19, 14.79it/s]
76%|███████▌ | 912/1200 [01:01<00:19, 14.80it/s]
76%|███████▌ | 914/1200 [01:01<00:19, 14.80it/s]
76%|███████▋ | 916/1200 [01:01<00:19, 14.78it/s]
76%|███████▋ | 918/1200 [01:02<00:19, 14.79it/s]
77%|███████▋ | 920/1200 [01:02<00:18, 14.79it/s]
77%|███████▋ | 922/1200 [01:02<00:18, 14.79it/s]
77%|███████▋ | 924/1200 [01:02<00:18, 14.78it/s]
77%|███████▋ | 926/1200 [01:02<00:18, 14.78it/s]
77%|███████▋ | 928/1200 [01:02<00:18, 14.80it/s]
78%|███████▊ | 930/1200 [01:02<00:18, 14.80it/s]
78%|███████▊ | 932/1200 [01:02<00:18, 14.81it/s]
78%|███████▊ | 934/1200 [01:03<00:17, 14.81it/s]
78%|███████▊ | 936/1200 [01:03<00:17, 14.81it/s]
78%|███████▊ | 938/1200 [01:03<00:17, 14.80it/s]
78%|███████▊ | 940/1200 [01:03<00:17, 14.78it/s]
78%|███████▊ | 942/1200 [01:03<00:17, 14.79it/s]
79%|███████▊ | 944/1200 [01:03<00:17, 14.79it/s]
79%|███████▉ | 946/1200 [01:03<00:17, 14.78it/s]
79%|███████▉ | 948/1200 [01:04<00:17, 14.78it/s]
79%|███████▉ | 950/1200 [01:04<00:16, 14.79it/s]
79%|███████▉ | 952/1200 [01:04<00:16, 14.79it/s]
80%|███████▉ | 954/1200 [01:04<00:16, 14.78it/s]
80%|███████▉ | 956/1200 [01:04<00:16, 14.78it/s]
80%|███████▉ | 958/1200 [01:04<00:16, 14.80it/s]
80%|████████ | 960/1200 [01:04<00:16, 14.80it/s]
80%|████████ | 962/1200 [01:04<00:16, 14.80it/s]
80%|████████ | 964/1200 [01:05<00:15, 14.82it/s]
80%|████████ | 966/1200 [01:05<00:15, 14.81it/s]
81%|████████ | 968/1200 [01:05<00:15, 14.78it/s]
81%|████████ | 970/1200 [01:05<00:15, 14.79it/s]
81%|████████ | 972/1200 [01:05<00:15, 14.80it/s]
81%|████████ | 974/1200 [01:05<00:15, 14.80it/s]
81%|████████▏ | 976/1200 [01:05<00:15, 14.78it/s]
82%|████████▏ | 978/1200 [01:06<00:15, 14.77it/s]
82%|████████▏ | 980/1200 [01:06<00:14, 14.78it/s]
82%|████████▏ | 982/1200 [01:06<00:14, 14.78it/s]
82%|████████▏ | 984/1200 [01:06<00:14, 14.79it/s]
82%|████████▏ | 986/1200 [01:06<00:14, 14.80it/s]
82%|████████▏ | 988/1200 [01:06<00:14, 14.80it/s]
82%|████████▎ | 990/1200 [01:06<00:14, 14.81it/s]
83%|████████▎ | 992/1200 [01:07<00:14, 14.81it/s]
83%|████████▎ | 994/1200 [01:07<00:13, 14.82it/s]
83%|████████▎ | 996/1200 [01:07<00:13, 14.81it/s]
83%|████████▎ | 998/1200 [01:07<00:13, 14.79it/s]
83%|████████▎ | 1000/1200 [01:07<00:13, 14.80it/s]
84%|████████▎ | 1002/1200 [01:07<00:13, 14.81it/s]
84%|████████▎ | 1004/1200 [01:07<00:13, 14.78it/s]
84%|████████▍ | 1006/1200 [01:07<00:13, 14.77it/s]
84%|████████▍ | 1008/1200 [01:08<00:12, 14.79it/s]
84%|████████▍ | 1010/1200 [01:08<00:12, 14.79it/s]
84%|████████▍ | 1012/1200 [01:08<00:12, 14.78it/s]
84%|████████▍ | 1014/1200 [01:08<00:12, 14.79it/s]
85%|████████▍ | 1016/1200 [01:08<00:12, 14.80it/s]
85%|████████▍ | 1018/1200 [01:08<00:12, 14.79it/s]
85%|████████▌ | 1020/1200 [01:08<00:12, 14.78it/s]
85%|████████▌ | 1022/1200 [01:09<00:12, 14.80it/s]
85%|████████▌ | 1024/1200 [01:09<00:11, 14.81it/s]
86%|████████▌ | 1026/1200 [01:09<00:11, 14.80it/s]
86%|████████▌ | 1028/1200 [01:09<00:11, 14.79it/s]
86%|████████▌ | 1030/1200 [01:09<00:11, 14.79it/s]
86%|████████▌ | 1032/1200 [01:09<00:11, 14.80it/s]
86%|████████▌ | 1034/1200 [01:09<00:11, 14.79it/s]
86%|████████▋ | 1036/1200 [01:09<00:11, 14.78it/s]
86%|████████▋ | 1038/1200 [01:10<00:10, 14.80it/s]
87%|████████▋ | 1040/1200 [01:10<00:10, 14.81it/s]
87%|████████▋ | 1042/1200 [01:10<00:10, 14.79it/s]
87%|████████▋ | 1044/1200 [01:10<00:10, 14.81it/s]
87%|████████▋ | 1046/1200 [01:10<00:10, 14.81it/s]
87%|████████▋ | 1048/1200 [01:10<00:10, 14.82it/s]
88%|████████▊ | 1050/1200 [01:10<00:10, 14.82it/s]
88%|████████▊ | 1052/1200 [01:11<00:09, 14.80it/s]
88%|████████▊ | 1054/1200 [01:11<00:09, 14.77it/s]
88%|████████▊ | 1056/1200 [01:11<00:09, 14.76it/s]
88%|████████▊ | 1058/1200 [01:11<00:09, 14.77it/s]
88%|████████▊ | 1060/1200 [01:11<00:09, 14.80it/s]
88%|████████▊ | 1062/1200 [01:11<00:09, 14.81it/s]
89%|████████▊ | 1064/1200 [01:11<00:09, 14.80it/s]
89%|████████▉ | 1066/1200 [01:12<00:09, 14.79it/s]
89%|████████▉ | 1068/1200 [01:12<00:08, 14.80it/s]
89%|████████▉ | 1070/1200 [01:12<00:08, 14.80it/s]
89%|████████▉ | 1072/1200 [01:12<00:08, 14.79it/s]
90%|████████▉ | 1074/1200 [01:12<00:08, 14.79it/s]
90%|████████▉ | 1076/1200 [01:12<00:08, 14.80it/s]
90%|████████▉ | 1078/1200 [01:12<00:08, 14.81it/s]
90%|█████████ | 1080/1200 [01:12<00:08, 14.81it/s]
90%|█████████ | 1082/1200 [01:13<00:07, 14.81it/s]
90%|█████████ | 1084/1200 [01:13<00:07, 14.81it/s]
90%|█████████ | 1086/1200 [01:13<00:07, 14.80it/s]
91%|█████████ | 1088/1200 [01:13<00:07, 14.80it/s]
91%|█████████ | 1090/1200 [01:13<00:07, 14.79it/s]
91%|█████████ | 1092/1200 [01:13<00:07, 14.79it/s]
91%|█████████ | 1094/1200 [01:13<00:07, 14.79it/s]
91%|█████████▏| 1096/1200 [01:14<00:07, 14.79it/s]
92%|█████████▏| 1098/1200 [01:14<00:06, 14.80it/s]
92%|█████████▏| 1100/1200 [01:14<00:06, 14.81it/s]
92%|█████████▏| 1102/1200 [01:14<00:06, 14.80it/s]
92%|█████████▏| 1104/1200 [01:14<00:06, 14.80it/s]
92%|█████████▏| 1106/1200 [01:14<00:06, 14.80it/s]
92%|█████████▏| 1108/1200 [01:14<00:06, 14.80it/s]
92%|█████████▎| 1110/1200 [01:14<00:06, 14.79it/s]
93%|█████████▎| 1112/1200 [01:15<00:05, 14.80it/s]
93%|█████████▎| 1114/1200 [01:15<00:05, 14.80it/s]
93%|█████████▎| 1116/1200 [01:15<00:05, 14.78it/s]
93%|█████████▎| 1118/1200 [01:15<00:05, 14.79it/s]
93%|█████████▎| 1120/1200 [01:15<00:05, 14.79it/s]
94%|█████████▎| 1122/1200 [01:15<00:05, 14.79it/s]
94%|█████████▎| 1124/1200 [01:15<00:05, 14.79it/s]
94%|█████████▍| 1126/1200 [01:16<00:05, 14.78it/s]
94%|█████████▍| 1128/1200 [01:16<00:04, 14.79it/s]
94%|█████████▍| 1130/1200 [01:16<00:04, 14.79it/s]
94%|█████████▍| 1132/1200 [01:16<00:04, 14.78it/s]
94%|█████████▍| 1134/1200 [01:16<00:04, 14.79it/s]
95%|█████████▍| 1136/1200 [01:16<00:04, 14.79it/s]
95%|█████████▍| 1138/1200 [01:16<00:04, 14.80it/s]
95%|█████████▌| 1140/1200 [01:17<00:04, 14.81it/s]
95%|█████████▌| 1142/1200 [01:17<00:03, 14.81it/s]
95%|█████████▌| 1144/1200 [01:17<00:03, 14.81it/s]
96%|█████████▌| 1146/1200 [01:17<00:03, 14.79it/s]
96%|█████████▌| 1148/1200 [01:17<00:03, 14.80it/s]
96%|█████████▌| 1150/1200 [01:17<00:03, 14.80it/s]
96%|█████████▌| 1152/1200 [01:17<00:03, 14.79it/s]
96%|█████████▌| 1154/1200 [01:17<00:03, 14.77it/s]
96%|█████████▋| 1156/1200 [01:18<00:02, 14.78it/s]
96%|█████████▋| 1158/1200 [01:18<00:02, 14.78it/s]
97%|█████████▋| 1160/1200 [01:18<00:02, 14.79it/s]
97%|█████████▋| 1162/1200 [01:18<00:02, 14.78it/s]
97%|█████████▋| 1164/1200 [01:18<00:02, 14.79it/s]
97%|█████████▋| 1166/1200 [01:18<00:02, 14.78it/s]
97%|█████████▋| 1168/1200 [01:18<00:02, 15.01it/s]
98%|█████████▊| 1170/1200 [01:19<00:02, 14.95it/s]
98%|█████████▊| 1172/1200 [01:19<00:01, 14.91it/s]
98%|█████████▊| 1174/1200 [01:19<00:01, 14.86it/s]
98%|█████████▊| 1176/1200 [01:19<00:01, 14.82it/s]
98%|█████████▊| 1178/1200 [01:19<00:01, 14.83it/s]
98%|█████████▊| 1180/1200 [01:19<00:01, 15.05it/s]
98%|█████████▊| 1182/1200 [01:19<00:01, 14.95it/s]
99%|█████████▊| 1184/1200 [01:19<00:01, 14.88it/s]
99%|█████████▉| 1186/1200 [01:20<00:00, 14.85it/s]
99%|█████████▉| 1188/1200 [01:20<00:00, 14.84it/s]
99%|█████████▉| 1190/1200 [01:20<00:00, 14.83it/s]
99%|█████████▉| 1192/1200 [01:20<00:00, 14.80it/s]
100%|█████████▉| 1194/1200 [01:20<00:00, 14.81it/s]
100%|█████████▉| 1196/1200 [01:20<00:00, 14.80it/s]
100%|█████████▉| 1198/1200 [01:20<00:00, 14.75it/s]
100%|██████████| 1200/1200 [01:21<00:00, 14.77it/s]
100%|██████████| 1200/1200 [01:21<00:00, 14.80it/s]
Look at the detailed MCMC results.
# burn the run in phase
fitter.burn_mcmc = 250
# look if the log probability chain has settled and decide if the number of samples burned was appropriate
plt.figure()
fitter.plot_log_prob_chain()
plt.ylim([-80, -60])
plt.show()

Produce a corner plot
corner_plot_ress_spec = fitter.corner_mcmc()

Plot final spectral results.
# start plot
plt.rcParams["font.size"] = spec_font_size
plt.figure(figsize=spec_plot_size)
# the line that actually plots
axes, res_axes = fitter.plot()
# make plot nicer
for a in axes:
a.set_xlim(xlims)
a.set_ylim(ylims)
a.set_xscale("log")
plt.show()
plt.rcParams["font.size"] = default_text

Save out session#
save_filename = "../sunxspexRhessiSpectralFitting.pickle"
fitter.save(save_filename)
Loading session back in#
The session can be loaded back in using the following code as an example,
Comparisons#
Model Parameter |
OSPEX (Flecther et al. 2007) [*] |
Recent OSPEX Fit (from Iain Hannah) |
This Work (Minimize Soln, evt-bg) |
This Work (Minimize Soln) |
This Work (MCMC) |
|---|---|---|---|---|---|
Temperature [MK] |
24.13 |
22.45 |
22.7\(\pm\)0.1 |
22.9\(\pm\)0.1 |
\(22.71^{+0.29}_{-0.34}\) |
Emission Measure [cm-3] |
1.6x1047 |
2.0\(\times\) 1047 |
1.92 \(\pm\) 0.05\(\times\)10 47 |
1.90\(\pm\) 0.04\(\times\)1047 |
\(1.83^{+0.09}_{-0.08}\times10^{47}\) |
Electron Flux [e- s-1] |
9.8\(\times\)1034 |
8.8\(\pm\)0.2\(\times\)1034 |
8.5\(\pm\)0.2\(\times\)1034 |
\(8.5^{+1.1}_{-1.2}\times10^{34}\) |
|
Index |
5.77 |
5.70\(\pm\)0.05 |
5.71\(\pm\)0.05 |
\(5.65^{+0.06}_{-0.04}\) |
|
Low Energy Cut-off [keV] |
19.44 |
19.8\(\pm\)0.1 |
19.9\(\pm\)0.1 |
\(19.8^{+0.6}_{-0.5}\) |
Total running time of the script: (1 minutes 49.000 seconds)