Exploring the Athena X-IFU WHIM Data Challenge

One task for Athena X-IFU will be measuring the Warm-Hot Intergalactic Medium (WHIM) via absorption spectroscopy. While WHIM itself does not emit X-rays, it will produce absorption lines in the X-ray spectra of bright Gamma-ray Burst (GRB) afterglows. This is important for solving the missing baryon problem.

How well Athena will be able to measure the WHIM depends on how well it is going to be able to identify lines in GRB afterglows. To this purpose, the Athena X-IFU WHIM Data Challenge was called into existence. The point here is figure out the best way to identify lines and their redshift, and find the method that has the highest detection probability for the weak lines expected from WHIM.

Exploring the Simulations

Let's first actually look at the data, so that we can set up an appropriate model.

Imports


In [1]:
%matplotlib notebook
import matplotlib.pyplot as plt
import seaborn as sns

import glob

import numpy as np
import pandas as pd

import sherpa.astro.ui
import astropy.io.fits as fits

datadir = "../data/"


WARNING: imaging routines will not be available, 
failed to import sherpa.image.ds9_backend due to 
'RuntimeErr: DS9Win unusable: Could not find ds9 on your PATH'
WARNING: failed to import WCS module; WCS routines will not be available
WARNING: failed to import sherpa.astro.xspec; XSPEC models will not be available

Before we do anything clever, I want to have a look at the FITS files so that I know what's going on:


In [2]:
import sherpa

In [3]:
sherpa.__version__


Out[3]:
'4.9.0'

In [4]:
hdulist = fits.open("../data/47.pha")
hdulist


Out[4]:
[<astropy.io.fits.hdu.image.PrimaryHDU object at 0x11682aef0>, <astropy.io.fits.hdu.table.BinTableHDU object at 0x11683c828>]

In [5]:
hdr = hdulist[0].header

In [6]:
hdr


Out[6]:
SIMPLE  =                    T / file does conform to FITS standard             
BITPIX  =                   16 / number of bits per data pixel                  
NAXIS   =                    0 / number of data axes                            
EXTEND  =                    T / FITS dataset may contain extensions            
COMMENT   FITS (Flexible Image Transport System) format is defined in 'Astronomy
COMMENT   and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H 

What's in the data extension?


In [7]:
hdulist[1].header


Out[7]:
XTENSION= 'BINTABLE'           / binary table extension                         
BITPIX  =                    8 / 8-bit bytes                                    
NAXIS   =                    2 / 2-dimensional binary table                     
NAXIS1  =                    8 / width of table in bytes                        
NAXIS2  =                29874 / number of rows in table                        
PCOUNT  =                    0 / size of special data area                      
GCOUNT  =                    1 / one data group (required keyword)              
TFIELDS =                    2 / number of fields in each row                   
TTYPE1  = 'CHANNEL '           / label for field   1                            
TFORM1  = 'J       '           / data format of field: 4-byte INTEGER           
TTYPE2  = 'COUNTS  '           / label for field   2                            
TFORM2  = 'J       '           / data format of field: 4-byte INTEGER           
EXTNAME = 'SPECTRUM'           / name of this binary table extension            
TELESCOP= 'ATHENA  '                                                            
INSTRUME= 'XIFU    '                                                            
FILTER  = 'NONE    '                                                            
EXPOSURE=               75500.                                                  
AREASCAL=                   1.                                                  
BACKFILE= 'none    '                                                            
BACKSCAL=                   1.                                                  
CORRFILE= 'none    '                                                            
CORRSCAL=                   1.                                                  
RESPFILE= 'athena_xifu_rmf_highres_v20150609.rmf'                               
ANCRFILE= 'athena_xifu_sixte_1469_onaxis_v20150402.arf'                         
HDUCLASS= 'OGIP    '                                                            
HDUCLAS1= 'SPECTRUM'                                                            
HDUVERS = '1.2.1   '                                                            
CHANTYPE= 'PI      '                                                            
DETCHANS=                29874                                                  
CREATOR = '{fits_write_pha_file} v{1.0.0}'                                      
HDUCLAS2= 'TOTAL   '                                                            
HDUCLAS3= 'COUNTS  '                                                            
GROUPING=                    0                                                  
AREAFILE= 'none    '                                                            
POISSERR=                    T / Poisson errors appropriate?                    
STAT_ERR=                    F / Assume statistical errors?                     
SYS_ERR =                   0. / no global systematic error                     

In [8]:
hdulist[1].columns


Out[8]:
ColDefs(
    name = 'CHANNEL'; format = 'J'
    name = 'COUNTS'; format = 'J'
)

Hmm, so it doesn't look like I have energy information for each bin. Maybe the ARF/RMF files do?


In [9]:
arf_hdulist = fits.open(datadir+"athena_xifu_sixte_1469_onaxis_v20150402.arf")

In [10]:
arf_hdulist.info()


Filename: ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
No.    Name         Type      Cards   Dimensions   Format
  0  PRIMARY     PrimaryHDU       8   ()      
  1  SPECRESP    BinTableHDU     31   29874R x 3C   [D, D, D]   

In [11]:
e_low = arf_hdulist[1].data.field("ENERG_LO")
e_high = arf_hdulist[1].data.field("ENERG_HI")

What about the RMF?


In [12]:
rmf_hdulist = fits.open(datadir+"athena_xifu_rmf_highres_v20150609.rmf")

In [13]:
rmf_hdulist.info()


Filename: ../data/athena_xifu_rmf_highres_v20150609.rmf
No.    Name         Type      Cards   Dimensions   Format
  0  PRIMARY     PrimaryHDU       8   ()      
  1  EBOUNDS     BinTableHDU     32   29874R x 3C   [J, D, D]   
  2  MATRIX      BinTableHDU     46   29874R x 6C   [D, D, J, J, J, 92D]   

In [14]:
rmf_hdulist[1].header


Out[14]:
XTENSION= 'BINTABLE'           / binary table extension                         
BITPIX  =                    8 / 8-bit bytes                                    
NAXIS   =                    2 / 2-dimensional binary table                     
NAXIS1  =                   20 / width of table in bytes                        
NAXIS2  =                29874 / number of rows in table                        
PCOUNT  =                    0 / size of special data area                      
GCOUNT  =                    1 / one data group (required keyword)              
TFIELDS =                    3 / number of fields in each row                   
TTYPE1  = 'CHANNEL '           / label for field   1                            
TFORM1  = 'J       '           / data format of field: 4-byte INTEGER           
TTYPE2  = 'E_MIN   '           / label for field   2                            
TFORM2  = 'D       '           / data format of field: 8-byte DOUBLE            
TTYPE3  = 'E_MAX   '           / label for field   3                            
TFORM3  = 'D       '           / data format of field: 8-byte DOUBLE            
EXTNAME = 'EBOUNDS '           / name of this binary table extension            
TELESCOP= 'ATHENA  '                                                            
INSTRUME= 'XIFU    '                                                            
FILTER  = 'NONE    '                                                            
CHANTYPE= 'PI      '                                                            
DETCHANS=                29874                                                  
HDUCLASS= 'OGIP    '                                                            
HDUCLAS1= 'RESPONSE'                                                            
HDUCLAS2= 'EBOUNDS '                                                            
HDUVERS = '1.2.0   '                                                            
ORIGIN  = 'ECAP    '                                                            
VERSION =             20150609 / Version number                                 
TUNIT2  = 'keV     '                                                            
TUNIT3  = 'keV     '                                                            
HISTORY file written by fits_write_rmf.sl                                       
CHECKSUM= 'aqnjbokiaokiaoki'   / HDU checksum updated 2015-06-09T11:52:53       
DATASUM = '403690390'          / data unit checksum updated 2015-06-09T11:52:51 
FWHM    =              2.50000 / Resolution in eV below 7.0 keV                 

In [15]:
rmf_data = rmf_hdulist[2].data

In [16]:
rmf_data.columns


Out[16]:
ColDefs(
    name = 'ENERG_LO'; format = 'D'; unit = 'keV'
    name = 'ENERG_HI'; format = 'D'; unit = 'keV'
    name = 'N_GRP'; format = 'J'
    name = 'F_CHAN'; format = 'J'
    name = 'N_CHAN'; format = 'J'
    name = 'MATRIX'; format = '92D'; dim = '(92)'
)

In [17]:
datadir = "../data/"
datafiles = glob.glob(datadir+"*.pha")
print(datafiles)


['../data/01.pha', '../data/02.pha', '../data/03.pha', '../data/04.pha', '../data/05.pha', '../data/06.pha', '../data/07.pha', '../data/08.pha', '../data/09.pha', '../data/10.pha', '../data/11.pha', '../data/12.pha', '../data/13.pha', '../data/14.pha', '../data/15.pha', '../data/16.pha', '../data/17.pha', '../data/18.pha', '../data/19.pha', '../data/20.pha', '../data/21.pha', '../data/22.pha', '../data/23.pha', '../data/24.pha', '../data/25.pha', '../data/26.pha', '../data/27.pha', '../data/28.pha', '../data/29.pha', '../data/30.pha', '../data/31.pha', '../data/32.pha', '../data/33.pha', '../data/34.pha', '../data/35.pha', '../data/36.pha', '../data/37.pha', '../data/38.pha', '../data/39.pha', '../data/40.pha', '../data/41.pha', '../data/42.pha', '../data/43.pha', '../data/44.pha', '../data/45.pha', '../data/46.pha', '../data/47.pha', '../data/48.pha', '../data/49.pha', '../data/50.pha']

Sherpa model of the data

Let's build a simple sherpa model of a galactic abundance and a power law:


In [18]:
sherpa.astro.ui.load_data("../data/47.pha")


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field

In [19]:
d = sherpa.astro.ui.get_data()

In [20]:
arf = d.get_arf()

In [21]:
arf


Out[21]:
<DataARF data set instance '../data/athena_xifu_sixte_1469_onaxis_v20150402.arf'>

In [22]:
rmf = d.get_rmf()

In [23]:
rmf

In [24]:
for i,f in enumerate(datafiles):
    sherpa.astro.ui.load_data(id="%i"%(i+1), filename=datadir+f)


read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
read ARF file ../data/../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field

In [25]:
d1 = sherpa.astro.ui.get_data("1")

In [26]:
energy = d1.get_x()

In [27]:
plt.figure()
plt.plot(energy, d1.counts, label="HEG P1", alpha=0.9,
         c=sns.color_palette()[0], linestyle="steps-mid")

plt.xlim(0.5, 0.68)


Out[27]:
(0.5, 0.68)

Line Search Strategy

In the original document, the line search strategy is between 250 and 584 eV for the OVII line and 250 to 754 eV for the OVII and OVIII line. They use Gaussian statistics, i.e. rebin the data, which we are not going to do.

Question: Do I need to worry about over-sampling?

The authors then do a blind fit to the continuum, followed by a blind line search in the range between $0 \leq z \leq 0.1$, considering the simple case of a WHIM line in the nearby IGM. The search is performed using Protassov et al (2002), searching at every energy for a line and producing a posterior predictive p-value for each line energy in its rest frame $E_0$ shifted to $(1+z)E_0$ while oversampling the detector resolution. They produce a new fit for each energy and test for the presence of a line using a significance test.

Question: What are the priors used in the original approach?

Why this approach is not ideal

  • number of trials explodes!
  • can only find lines at fixed redshift intervals, but redshift is a continuous number!
  • cannot efficiently deal with multi-line inference!

Can we build a better model?

We're going to stick this into ShiftyLines and see what happens! But first, let's look at the relevant energy ranges:


In [28]:
len(e_low)


Out[28]:
29874

In [29]:
x_min = 0.25
x_max = 0.754

d = sherpa.astro.ui.get_data("47")

plt.figure()
plt.plot(e_low, d.counts, alpha=0.9,
         c=sns.color_palette()[0], linestyle="steps-mid")

plt.xlim(x_min, x_max)


Out[29]:
(0.25, 0.754)

I have no idea whether there's a line in there. I know that there are different simulations (1) for a single line search versus two line search, (2) different equivalent widths, and (3) different starting fluxes of the GRB. And apparently also for different exposure times.

Let's plot all spectra, just so I know what I'm dealing with, including the two lines of interest:


In [30]:
0.574*(1.0-0.1)


Out[30]:
0.5166

In [31]:
o_lines = [0.574, 0.654]

In [32]:
plt.figure()

for i,f in enumerate(datafiles):
    d = sherpa.astro.ui.get_data("%i"%(i+1))
    plt.plot(e_low, d.counts, label="HEG P1", alpha=0.9,
             c=sns.color_palette()[0], linestyle="steps-mid")
    
for l in o_lines:
    plt.vlines(l/(1.0 + 0.07), 0, 7000, lw=2, color="black")

plt.xlim(x_min, x_max)


Out[32]:
(0.25, 0.754)

According to the document, the lines are at different redshifts, so fine.

First Attempt

The first attempt to run this with 2 lines on the first spectrum:


In [33]:
sample = np.loadtxt("../../atrytone/data/47_posterior_sample.txt")

The $log(Z) = -2580.20885111$.

The Columns in the Sample File

  • 0: background
  • 1: noise_L
  • 2: noise_sigma
  • 3: number of parameters (I think)
  • 4: number of possible Redshifts
  • 5: log-amplitude hyper mean
  • 6: log-amplitude hyper sigma
  • 7: width hyper mean
  • 8: width hyper sigma
  • 9: threshold parameter
  • 10: number of Doppler shifts
  • 11: Doppler shift
  • 12-XX: parameters for the lines, one per Doppler shift and per line
  • XX-end: posterior sample spectrum

Let's plot the number of Doppler shifts:


In [34]:
plt.figure()
plt.hist(sample[:,10], bins=50);



In [35]:
plt.figure()
plt.hist(sample[:,11], bins=30)


Out[35]:
(array([  1.,   0.,   0.,   0.,   3.,   0.,   1.,   5.,   6.,   2.,  13.,
         48.,  26.,  27.,  39.,  43.,  41.,  46.,  39.,  25.,  22.,   7.,
          7.,   5.,   4.,  26.,   2.,   1.,   2.,   1.]),
 array([ 0.0808045 ,  0.08082568,  0.08084686,  0.08086804,  0.08088922,
         0.0809104 ,  0.08093158,  0.08095276,  0.08097394,  0.08099512,
         0.0810163 ,  0.08103748,  0.08105866,  0.08107984,  0.08110102,
         0.0811222 ,  0.08114338,  0.08116456,  0.08118574,  0.08120692,
         0.0812281 ,  0.08124928,  0.08127046,  0.08129164,  0.08131282,
         0.081334  ,  0.08135518,  0.08137636,  0.08139754,  0.08141872,
         0.0814399 ]),
 <a list of 30 Patch objects>)

In [36]:
x_min = 0.25
x_max = 0.75

In [111]:
min_ind = e_low.searchsorted(x_min)
max_ind = e_low.searchsorted(x_max)

e_low_small = e_low[min_ind:max_ind]
e_high_small = e_high[min_ind:max_ind]

Simulation 01

Let's start with simulation 1.

$log(z) =


In [38]:
# the data
d = sherpa.astro.ui.get_data("1")

In [39]:
sample = np.loadtxt("../../atrytone/data/01_posterior_sample.txt")
print("There are %i samples in the posterior."%len(sample))


There are 409 samples in the posterior.

In [40]:
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8,4))
ax1.hist(sample[:,10], bins=50);
ax1.set_title("Number of Doppler Shifts")

ax2.hist(sample[sample[:,11] != 0.0,11], bins=30)
ax2.set_xlabel("Doppler Shift")
ax2.set_ylabel("p(Doppler Shift)")

plt.figure(figsize=(8,4))
plt.plot(e_low, d.counts, 
         c="black", linestyle="steps-mid")
    
for s in sample[-20:]:
    plt.plot(e_low_small, s[-len(e_low_small)-5:-5], lw=1, 
             c=sns.color_palette()[0], alpha=0.3)
    
plt.xlim(x_min, x_max)
plt.ylim(0, 400)


Out[40]:
(0, 400)

What's the probability of having a Doppler shift in this source?


In [41]:
len(sample[sample[:,10]!= 0.0,11])/len(sample[:,10])


Out[41]:
0.2616136919315403

What are the amplitudes?


In [42]:
istart = 12
ndoppler = 1

nd1 = len(sample[sample[:,10]!=0.0, 10])

amplitudes = np.zeros((nd1, len(o_lines)))


for i in range(len(o_lines)):
    amplitudes[:,i] = sample[sample[:,istart+i*ndoppler]!=0.0, istart+i*ndoppler]

In [43]:
fig, axes = plt.subplots(1,2, figsize=(8,4))

axes = np.hstack(axes)

for i in range(len(o_lines)):
    a = amplitudes[:,i]
    axes[i].hist(a, bins=30)
    axes[i].set_title(o_lines[i])


What are the means and standard deviations of the amplitudes?


In [44]:
for i in range(amplitudes.shape[1]):
    print("Mean for amplitude for line at %.5f is %.5f +/- %.5f"%(o_lines[i], 
                                                                  np.mean(amplitudes[:,i]), 
                                                                  np.std(amplitudes[:,i])))


Mean for amplitude for line at 0.57400 is -4.32944 +/- 2.98967
Mean for amplitude for line at 0.65400 is -5.62011 +/- 3.13360

We have to compute the equivalent width of the two lines. For that, we're going to need (1) The Doppler shift of the line, (2) the shifted mean of the line, (3) the width and amplitude of the line, (4) the background

The Columns in the Sample File

  • 0: background
  • 1: noise_L
  • 2: noise_sigma
  • 3: number of parameters (I think)
  • 4: number of possible Redshifts
  • 5: log-amplitude hyper mean
  • 6: log-amplitude hyper sigma
  • 7: width hyper mean
  • 8: width hyper sigma
  • 9: threshold parameter
  • 10: number of Doppler shifts
  • 11: Doppler shift
  • 12-XX: parameters for the lines, one per Doppler shift and per line
  • XX-end: posterior sample spectrum

In [45]:
ndoppler = 1

In [46]:
import scipy.special

def gaussian_cdf(x, x0, gamma):
    c = 0.5*(1. + scipy.special.erf((x-x0)/(gamma*np.sqrt(2.))))
    return c

This is the factor for converting keV into Angstrom


In [47]:
cfac = 12.3984191

In [135]:
import astropy.units as u

In [137]:
k = 42. * u.keV

In [140]:
k.to(u.Angstrom, equivalencies=u.spectral())


Out[140]:
$0.29520046 \; \mathrm{\mathring{A}}$

In [207]:
def equivalent_widths(e_low_small, e_high_small, s, o_lines, cfac = 12.3984191):
    
    e_mid_small = e_low_small + (e_high_small - e_low_small)/2.0
    
    e_low_small = e_low_small * u.keV
    e_mid_small = e_mid_small * u.keV
    e_high_small = e_high_small * u.keV
    
    e_low_ang = e_low_small.to(u.Angstrom, equivalencies=u.spectral())
    e_mid_ang = e_mid_small.to(u.Angstrom, equivalencies=u.spectral())
    e_high_ang = e_high_small.to(u.Angstrom, equivalencies=u.spectral())
    
    #e_low_ang = np.array([e.to(u.Angstrom, equivalencies=u.spectral()) for e in e_low_small])
    #e_mid_ang = np.array([e.to(u.Angstrom, equivalencies=u.spectral()) for e in e_mid_small])
    #e_high_ang = np.array([e.to(u.Angstrom, equivalencies=u.spectral()) for e in e_high_small])
    
    # constant background
    bkg = s[0]
    
    # threshold parameter for positive/negative sign
    thr = s[9]

    # number of doppler shifts in this model
    nd = s[10]
    
    # value of the doppler shift (will be zero if nd is zero)
    dop = s[11]

    ew = np.zeros(len(o_lines))

    if nd > 0:
        lpos_kev = np.zeros(len(o_lines))
        lpos_ang = np.zeros(len(o_lines))
        amps = np.zeros(len(o_lines))
        widths = np.zeros(len(o_lines))
        widths_ang = np.zeros(len(o_lines))
        sign = np.zeros(len(o_lines))
        test = np.zeros(len(o_lines))
        lpos_kev = o_lines * u.keV
        lpos_ang = lpos_kev.to(u.Angstrom, equivalencies=u.spectral()) * (1. + dop)
        for i in range(len(o_lines)):
            #lpos[i] = o_lines[i]*1./(1.0+dop)
            #lpos_kev[i] = o_lines[i] * u.keV
            #lpos_ang[i] = lpost_kev[i].to(u.Angstrom, equivalencies=u.spectral())
            amps[i] = np.exp(s[istart+i*ndoppler])
            widths[i] = np.exp(s[istart+i*ndoppler+2])

            sign[i] = s[istart+i*ndoppler+4]

        widths = widths * u.keV
        widths_ang = widths.to(u.keV, equivalencies=u.spectral())

        for i in range(len(o_lines)):
            bkg_model = np.zeros_like(e_mid_ang.value) + bkg
            line_model = amps[i]*scipy.stats.norm(lpos_ang[i].value, widths_ang[i].value).pdf(e_mid_ang.value)
            total_model = bkg_model + line_model
            
            ew[i] = np.sum((-e_high_ang.value + e_low_ang.value) * np.abs(total_model - bkg_model)/bkg_model)
            
    return ew
            
            
#            ew[i] = (amps[i]/bkg)*gaussian_cdf(x_max, lpos[i], widths[i])

In [208]:
def equivalent_widths_old(s, o_lines, cfac = 12.3984191, x_max=0.68):
    # background flux
    bkg = s[0]
    
    # threshold parameter for positive/negative sign
    thr = s[9]

    # number of doppler shifts in this model
    nd = s[10]
    
    # value of the doppler shift (will be zero if nd is zero)
    dop = s[11]

    ew = np.zeros(len(o_lines))

    if nd > 0:
        lpos = np.zeros(len(o_lines))
        amps = np.zeros(len(o_lines))
        widths = np.zeros(len(o_lines))
        sign = np.zeros(len(o_lines))
        test = np.zeros(len(o_lines))
        for i in range(len(o_lines)):
            lpos[i] = o_lines[i]*1./(1.0+dop)
            amps[i] = np.exp(s[istart+i*ndoppler])
            widths[i] = np.exp(s[istart+i*ndoppler+2])
            sign[i] = s[istart+i*ndoppler+4]

        lpos_angstrom = cfac/lpos
        widths_angstrom = cfac/widths

        for i in range(len(o_lines)):
            ew[i] = (amps[i]/bkg)*gaussian_cdf(x_max, lpos[i], widths[i])

    return ew

In [209]:
print(sample[2,10:20])
equivalent_widths(e_low_small, e_high_small, sample[2], o_lines)


[   0.       0.       0.       0.       0.       0.       0.       0.
  116.897  117.753]
Out[209]:
array([ 0.,  0.])

In [210]:
ew = np.array([equivalent_widths(e_low_small, e_high_small, s, o_lines) for s in sample])
ew_old = np.array([equivalent_widths_old(s, o_lines, cfac = 12.3984191, x_max=0.68) for s in sample])

In [211]:
ew


Out[211]:
array([[  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.18265535e-17,   2.43294324e-01],
       [  4.19431938e+00,   1.32082029e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  4.86127081e-02,   4.83711330e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  6.89991038e+00,   6.75402345e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.27535695e+01,   7.50827883e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.03121869e+01,   6.41318712e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.57664980e+00,   2.21809807e+00],
       [  6.89991038e+00,   6.75402345e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.75738078e-06,   5.41194894e-10],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.25513582e-02,   2.32857688e-03],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  5.04378238e-04,   6.75266835e-05],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  4.67673392e-02,   8.54461049e-02],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.58922137e+00,   4.87571622e-02],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  5.30099932e-07,   2.32089045e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.19741525e-01,   8.79729877e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.27535695e+01,   7.50827883e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  7.68777300e+00,   7.14820385e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.47738443e+00,   3.83371152e-02],
       [  5.27351290e-02,   2.25378833e-02],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  6.72790151e+00,   6.70379145e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.15111414e+01,   1.03518511e+01],
       [  0.00000000e+00,   0.00000000e+00],
       [  4.91147485e-01,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.52677503e+01,   0.00000000e+00],
       [  2.18671171e-10,   2.43091651e-08],
       [  0.00000000e+00,   0.00000000e+00],
       [  5.02559952e-10,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  3.51399869e-07,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   9.78431933e-04],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  3.66247272e-03,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   2.63767047e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   4.08491127e-03],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.26328472e+01,   9.02673122e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  6.89991038e+00,   6.75402345e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   8.44313931e-03],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.18671171e-10,   2.43091651e-08],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  7.12422215e+00,   3.19509526e-04],
       [  3.11206076e+01,   1.00435967e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.18357607e-01,   2.77142892e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.11221664e+01,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.41424701e+00,   2.50005246e-01],
       [  8.31431704e-06,   7.33807865e-10],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.03121869e+01,   6.41318712e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  7.68777300e+00,   7.14820385e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  7.68777300e+00,   7.14820385e+00],
       [  1.66899713e-06,   1.10777951e-06],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  3.68843098e-04,   1.89061302e-04],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.13757089e+00,   8.61642651e-03],
       [  7.69800868e+00,   4.24907645e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  4.49171494e-07,   1.84393188e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  6.51993834e-01,   3.81929071e-03],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  5.04378238e-04,   6.75266835e-05],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  4.04217926e-04,   7.96604939e-03],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.41993299e+01,   7.22819851e-01],
       [  5.04378238e-04,   6.75266835e-05],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.43268030e-02,   7.59757286e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   1.39531691e-03],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  7.68777300e+00,   7.14820385e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.11221664e+01,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.27535695e+01,   7.50827883e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.15234174e+00,   6.37202910e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  7.77861810e-02,   8.02874856e-02],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  4.49171494e-07,   1.84393188e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   1.91192572e-07],
       [  0.00000000e+00,   0.00000000e+00],
       [  7.53463908e+00,   4.23982037e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.18671171e-10,   2.43091651e-08],
       [  1.60180169e-13,   4.23466127e-05],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.13757089e+00,   8.61642651e-03],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  7.77861810e-02,   8.02874856e-02],
       [  6.44585031e+00,   1.33625433e-03],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.51987817e+00,   7.89613336e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.74555826e-09,   9.58010113e-17],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.26595386e+00,   1.61888210e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.68203740e-04,   1.88329176e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.37483705e-03,   8.23042360e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.13757089e+00,   8.61642651e-03],
       [  1.55979520e-01,   2.34845523e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.18265535e-17,   2.43294324e-01],
       [  8.64820302e-05,   5.12552235e-05],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  3.40883626e-04,   8.12105894e-05],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   6.83531707e-02],
       [  2.65795541e-07,   1.20882049e-17],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.18357607e-01,   2.77142892e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.41487363e-02,   5.56857634e-03],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.03121869e+01,   6.41318712e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.78390207e+01,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  4.91147485e-01,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  1.15234174e+00,   6.37202910e-01],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  3.40883626e-04,   8.12105894e-05],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  2.65795541e-07,   1.20882049e-17],
       [  1.26595386e+00,   1.61888210e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00],
       [  7.92733237e+00,   2.46180269e-12],
       [  0.00000000e+00,   0.00000000e+00]])

In [212]:
fig, axes = plt.subplots(1, 2, figsize=(8,4))

for i, l in enumerate(o_lines):
    axes[i].hist(np.log(ew[ew[:,i]!= 0.0,i]), bins=30)
    print(np.median(ew[ew[:,i]!= 0.0,i]))
    axes[i].set_title(l)


/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
0.491147484908
0.184393187649

In [213]:
for i in range(len(o_lines)):
    print("Equivalent width for line %.3f: %.5f +/ %.6f" %(o_lines[i], 
                                                           np.median(ew[ew[:,i]!= 0.0,i]), 
                                                           np.std(ew[ew[:,i]!= 0.0,i])))
    print("Equivalent width for line %.3f: %.5f +/ %.6f" %(o_lines[i], 
                                                           np.median(ew_old[ew_old[:,i]!= 0.0,i]), 
                                                           np.std(ew_old[ew_old[:,i]!= 0.0,i])))


Equivalent width for line 0.574: 0.49115 +/ 6.126249
Equivalent width for line 0.574: 0.93446 +/ 4.451956
Equivalent width for line 0.654: 0.18439 +/ 2.656471
Equivalent width for line 0.654: 0.27709 +/ 8.122545

Let's make a function of this:


In [214]:
def plot_ew(sample, o_lines):
    # calculate equivalent widths
    ew = np.array([equivalent_widths_old(s, o_lines) for s in sample])
    
    fig, axes = plt.subplots(1, 2, figsize=(8,4))

    for i, l in enumerate(o_lines):
        axes[i].hist(np.log(ew[ew[:,i]!= 0.0,i]), bins=30)
        print(np.median(ew[ew[:,i]!= 0.0,i]))
        axes[i].set_title(l)
        
    for i in range(len(o_lines)):
        print("Equivalent width for line %.3f: %.5f +/ %.6f" %(o_lines[i], 
                                                               np.median(ew[ew[:,i]!= 0.0,i]), 
                                                               np.std(ew[ew[:,i]!= 0.0,i])))
        
    return fig, axes

In [215]:
_, _ = plot_ew(sample, o_lines)


/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
0.934457806514
0.277092576762
Equivalent width for line 0.574: 0.93446 +/ 4.451956
Equivalent width for line 0.654: 0.27709 +/ 8.122545

Let's make a function of all of it:


In [219]:
def plot_all(nsim, datadir="../data/"):
    
    # the rest energies of the two lines
    o_lines = [0.574, 0.654]
    
    # make a string for the correct data file to load
    if nsim < 10:
        dataid = "0" + str(nsim)
    else:
        dataid = str(nsim)
        
    datafile = datadir + dataid + ".pha"

    # use sherpa to load the data
    sherpa.astro.ui.load_data(id="%i"%nsim, filename=datafile)
    
    # get the data
    d = sherpa.astro.ui.get_data("%i"%nsim)
    
    # get the posterior sample
    sample = np.loadtxt(datadir+"%s_posterior_sample.txt"%dataid)
    print("There are %i samples in the posterior."%len(sample))

    # compute the fraction of samples that have a Doppler shift
    p_doppler = len(sample[sample[:,10]!= 0.0,11])/len(sample[:,10])
    doppler_mean = np.mean(sample[sample[:,10]!= 0.0,11])
    doppler_std = np.std(sample[sample[:,10]!= 0.0,11])
    print("The probability that there is a signal in the data is %.4f"%p_doppler)
    print("The estimate for the Doppler shift is %.3f +/- %.3f"%(doppler_mean, doppler_std))

    # plot the number of Doppler shifts and the posterior distribution
    # of the Doppler shift itself if it's not zero (i.e. doesn't exist)
    fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8,4))
    ax1.hist(sample[:,10], bins=50);
    ax1.set_title("Number of Doppler Shifts")

    ax2.hist(sample[sample[:,11] != 0.0,11], bins=30)
    ax2.set_xlabel("Doppler Shift")
    ax2.set_ylabel("p(Doppler Shift)")

    # plot posterior samples of the light curve
    plt.figure(figsize=(8,4))
    plt.plot(e_low, d.counts, 
             c="black", linestyle="steps-mid")

    for s in sample:
        plt.plot(e_low_small, s[-len(e_low_small)-5:-5], lw=1, 
                 c=sns.color_palette()[0], alpha=0.3)

    # set some sane y axis limits.
    s = sample[0, -len(e_low_small)-5:-5]
    y_min = 0
    y_max = np.max(s) + 20.0
    plt.xlim(x_min, x_max)
    plt.ylim(y_min, y_max)

    # let's also plot the posteriors of the amplitudes
    
    # these are the needed indices
    istart = 12
    ndoppler = 1

    # the number of samples where there is a Doppler shift
    nd1 = len(sample[sample[:,10]!=0.0, 10])

    # empty array for the amplitudes
    amplitudes = np.zeros((nd1, len(o_lines)))

    # get the amplitudes out of the posterior sample
    for i in range(len(o_lines)):
        amplitudes[:,i] = sample[sample[:,istart+i*ndoppler]!=0.0, istart+i*ndoppler]

    # make a plot of the amplitudes
    fig, axes = plt.subplots(1,2, figsize=(8,4))

    axes = np.hstack(axes)

    for i in range(len(o_lines)):
        a = amplitudes[:,i]
        axes[i].hist(a, bins=30)
        axes[i].set_title(o_lines[i])
        
    # print the mean and standard deviation of the amplitudes.
    for i in range(amplitudes.shape[1]):
        print("Mean for amplitude for line at %.5f is %.5f +/- %.5f"%(o_lines[i], 
                                                                      np.mean(amplitudes[:,i]), 
                                                                      np.std(amplitudes[:,i])))

    # compute the equivalent widths
    ew = np.array([equivalent_widths_old(s, o_lines) for s in sample])

    # plot the equivalent widths
    _, _ = plot_ew(sample, o_lines)
    
    return

In [220]:
plot_all(1)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 409 samples in the posterior.
The probability that there is a signal in the data is 0.2616
The estimate for the Doppler shift is 0.054 +/- 0.033
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -4.32944 +/- 2.98967
Mean for amplitude for line at 0.65400 is -5.62011 +/- 3.13360
0.934457806514
0.277092576762
Equivalent width for line 0.574: 0.93446 +/ 4.451956
Equivalent width for line 0.654: 0.27709 +/ 8.122545

Simulation 02

$log(z) = -1714.44199708$


In [221]:
plot_all(2)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 402 samples in the posterior.
The probability that there is a signal in the data is 0.7338
The estimate for the Doppler shift is 0.077 +/- 0.014
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.77464 +/- 1.10960
Mean for amplitude for line at 0.65400 is -6.65646 +/- 3.00591
1.67254012234
0.120395517445
Equivalent width for line 0.574: 1.67254 +/ 4.453931
Equivalent width for line 0.654: 0.12040 +/ 59.266591

Simulation 03

$log(z) = -1604.30562265$


In [222]:
plot_all(3)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 417 samples in the posterior.
The probability that there is a signal in the data is 0.0959
The estimate for the Doppler shift is 0.049 +/- 0.027
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -7.34212 +/- 4.68466
Mean for amplitude for line at 0.65400 is -6.39125 +/- 2.72544
0.216961577255
0.75970542062
Equivalent width for line 0.574: 0.21696 +/ 6.259423
Equivalent width for line 0.654: 0.75971 +/ 0.926321

Simulation 04

$log(z) = $


In [223]:
plot_all(4)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 405 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -2.23029 +/- 0.13860
Mean for amplitude for line at 0.65400 is -6.96896 +/- 3.99049
1.60346796155
0.0377719765161
Equivalent width for line 0.574: 1.60347 +/ 0.213056
Equivalent width for line 0.654: 0.03777 +/ 10.545330

Simulation 05

failed


In [224]:
plot_all(5)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 430 samples in the posterior.
The probability that there is a signal in the data is 0.9860
The estimate for the Doppler shift is 0.081 +/- 0.003
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.48270 +/- 0.62102
Mean for amplitude for line at 0.65400 is -5.75041 +/- 2.66470
1.15311573973
0.212030999156
Equivalent width for line 0.574: 1.15312 +/ 0.321785
Equivalent width for line 0.654: 0.21203 +/ 90.297120

Simulation 06


In [226]:
plot_all(6)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 415 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -1.21062 +/- 0.08272
Mean for amplitude for line at 0.65400 is -3.95582 +/- 2.20836
1.47168355503
0.203283889498
Equivalent width for line 0.574: 1.47168 +/ 0.124565
Equivalent width for line 0.654: 0.20328 +/ 0.155826

Simulation 07


In [227]:
plot_all(7)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 467 samples in the posterior.
The probability that there is a signal in the data is 0.1199
The estimate for the Doppler shift is 0.045 +/- 0.027
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -6.07934 +/- 3.51111
Mean for amplitude for line at 0.65400 is -6.66699 +/- 3.76650
0.236141391511
0.430610907334
Equivalent width for line 0.574: 0.23614 +/ 6.516802
Equivalent width for line 0.654: 0.43061 +/ 3.090359

Simulation 08


In [228]:
plot_all(8)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 432 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.082 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.34612 +/- 0.21629
Mean for amplitude for line at 0.65400 is -7.16292 +/- 3.74479
1.48738850616
0.0675271101392
Equivalent width for line 0.574: 1.48739 +/ 0.306605
Equivalent width for line 0.654: 0.06753 +/ 2582.549378

Simulation 09


In [229]:
plot_all(9)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 455 samples in the posterior.
The probability that there is a signal in the data is 0.5846
The estimate for the Doppler shift is 0.080 +/- 0.008
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.80208 +/- 0.93726
Mean for amplitude for line at 0.65400 is -6.83281 +/- 2.84169
1.57311850457
0.10837381003
Equivalent width for line 0.574: 1.57312 +/ 1.876245
Equivalent width for line 0.654: 0.10837 +/ 413.982013

Simulation 10


In [230]:
plot_all(10)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 413 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -2.92756 +/- 0.25667
Mean for amplitude for line at 0.65400 is -6.95647 +/- 2.73934
1.85239323757
0.0696730197897
Equivalent width for line 0.574: 1.85239 +/ 0.413885
Equivalent width for line 0.654: 0.06967 +/ 0.238772

Simulation 11


In [231]:
plot_all(11)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 401 samples in the posterior.
The probability that there is a signal in the data is 0.4738
The estimate for the Doppler shift is 0.071 +/- 0.022
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.94907 +/- 1.30443
Mean for amplitude for line at 0.65400 is -5.89435 +/- 2.89832
1.14232746535
0.308392132096
Equivalent width for line 0.574: 1.14233 +/ 1.053256
Equivalent width for line 0.654: 0.30839 +/ 5.760243

Simulation 12


In [232]:
plot_all(12)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 400 samples in the posterior.
The probability that there is a signal in the data is 0.4400
The estimate for the Doppler shift is 0.073 +/- 0.022
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -4.97243 +/- 3.36689
Mean for amplitude for line at 0.65400 is -6.97927 +/- 4.40054
1.3415563766
0.216163560145
Equivalent width for line 0.574: 1.34156 +/ 1.577059
Equivalent width for line 0.654: 0.21616 +/ 198.990650

Simulation 13


In [233]:
plot_all(13)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 446 samples in the posterior.
The probability that there is a signal in the data is 0.6031
The estimate for the Doppler shift is 0.074 +/- 0.021
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -4.18073 +/- 1.49732
Mean for amplitude for line at 0.65400 is -6.02616 +/- 3.18255
1.51082436355
0.22784831037
Equivalent width for line 0.574: 1.51082 +/ 0.872671
Equivalent width for line 0.654: 0.22785 +/ 10.659099

Simulation 14


In [234]:
plot_all(14)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 400 samples in the posterior.
The probability that there is a signal in the data is 0.8975
The estimate for the Doppler shift is 0.081 +/- 0.003
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.54677 +/- 0.33217
Mean for amplitude for line at 0.65400 is -7.85775 +/- 3.96122
1.56935084655
0.0685716904879
Equivalent width for line 0.574: 1.56935 +/ 0.485097
Equivalent width for line 0.654: 0.06857 +/ 1.160438

Simulation 15

failed

Simulation 16


In [235]:
plot_all(16)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 404 samples in the posterior.
The probability that there is a signal in the data is 0.7178
The estimate for the Doppler shift is 0.081 +/- 0.003
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -4.35750 +/- 0.87409
Mean for amplitude for line at 0.65400 is -7.87656 +/- 4.09270
2.02471839117
0.117279702864
Equivalent width for line 0.574: 2.02472 +/ 0.561855
Equivalent width for line 0.654: 0.11728 +/ 18481776.445950

Simulation 17

failed


In [ ]:

Simulation 18

failed


In [ ]:

Simulation 19


In [236]:
plot_all(19)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 402 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.17335 +/- 0.17620
Mean for amplitude for line at 0.65400 is -6.48400 +/- 3.04663
1.6167587852
0.138566707923
Equivalent width for line 0.574: 1.61676 +/ 0.248694
Equivalent width for line 0.654: 0.13857 +/ 24.506310

Simulation 20

failed


In [ ]:

Simulation 21

failed


In [ ]:

Simulation 22


In [237]:
plot_all(22)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 436 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -1.37311 +/- 0.18215
Mean for amplitude for line at 0.65400 is -4.91853 +/- 2.95979
1.23903416417
0.0810941035388
Equivalent width for line 0.574: 1.23903 +/ 0.204879
Equivalent width for line 0.654: 0.08109 +/ 2539.064596

Simulation 23


In [238]:
plot_all(23)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 404 samples in the posterior.
The probability that there is a signal in the data is 0.1238
The estimate for the Doppler shift is 0.072 +/- 0.020
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -5.50041 +/- 2.79114
Mean for amplitude for line at 0.65400 is -7.67701 +/- 2.99189
1.11145392812
0.0496908878666
Equivalent width for line 0.574: 1.11145 +/ 0.828618
Equivalent width for line 0.654: 0.04969 +/ 0.964294

Simulation 24


In [239]:
plot_all(24)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 402 samples in the posterior.
The probability that there is a signal in the data is 0.7861
The estimate for the Doppler shift is 0.081 +/- 0.001
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -4.02552 +/- 0.84049
Mean for amplitude for line at 0.65400 is -7.41815 +/- 3.67430
1.75523513417
0.150236548234
Equivalent width for line 0.574: 1.75524 +/ 0.488064
Equivalent width for line 0.654: 0.15024 +/ 18.157096

Simulation 25


In [240]:
plot_all(25)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 404 samples in the posterior.
The probability that there is a signal in the data is 0.1460
The estimate for the Doppler shift is 0.065 +/- 0.024
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -6.55565 +/- 3.01086
Mean for amplitude for line at 0.65400 is -8.22869 +/- 3.75278
1.11517522886
0.0788210866614
Equivalent width for line 0.574: 1.11518 +/ 0.716770
Equivalent width for line 0.654: 0.07882 +/ 5.748076

Simulation 26

failed


In [ ]:

Simulation 27


In [241]:
plot_all(27)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 402 samples in the posterior.
The probability that there is a signal in the data is 0.9353
The estimate for the Doppler shift is 0.082 +/- 0.002
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.57180 +/- 0.30855
Mean for amplitude for line at 0.65400 is -6.92329 +/- 3.41207
1.49665120361
0.111975098966
Equivalent width for line 0.574: 1.49665 +/ 0.424544
Equivalent width for line 0.654: 0.11198 +/ 32520.438419

Simulation 28

failed


In [ ]:

Simulation 29


In [242]:
plot_all(29)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 414 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -2.04550 +/- 0.21584
Mean for amplitude for line at 0.65400 is -5.80351 +/- 3.29132
1.3348060837
0.101340996593
Equivalent width for line 0.574: 1.33481 +/ 0.213432
Equivalent width for line 0.654: 0.10134 +/ 19.508850

Simulation 30


In [243]:
plot_all(30)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 404 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -2.95052 +/- 0.16936
Mean for amplitude for line at 0.65400 is -6.65181 +/- 3.11501
1.43551440093
0.0491946797272
Equivalent width for line 0.574: 1.43551 +/ 0.240958
Equivalent width for line 0.654: 0.04919 +/ 11597475.452392

Simulation 31


In [244]:
plot_all(31)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 406 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.32369 +/- 0.20708
Mean for amplitude for line at 0.65400 is -7.01464 +/- 4.16272
1.28812131391
0.0519503649914
Equivalent width for line 0.574: 1.28812 +/ 0.257226
Equivalent width for line 0.654: 0.05195 +/ 126556.209707

Simulation 32


In [245]:
plot_all(32)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 416 samples in the posterior.
The probability that there is a signal in the data is 0.9880
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.21345 +/- 0.22377
Mean for amplitude for line at 0.65400 is -6.08033 +/- 3.24790
1.00445590718
0.129075015964
Equivalent width for line 0.574: 1.00446 +/ 0.203736
Equivalent width for line 0.654: 0.12908 +/ 6.641324

Simulation 33


In [246]:
plot_all(33)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 454 samples in the posterior.
The probability that there is a signal in the data is 0.9868
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.46043 +/- 0.22978
Mean for amplitude for line at 0.65400 is -6.34258 +/- 2.70435
1.51665616759
0.213431021154
Equivalent width for line 0.574: 1.51666 +/ 0.368651
Equivalent width for line 0.654: 0.21343 +/ 4.844399

Simulation 34


In [247]:
plot_all(34)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 408 samples in the posterior.
The probability that there is a signal in the data is 0.0539
The estimate for the Doppler shift is 0.047 +/- 0.031
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -11.28600 +/- 5.21498
Mean for amplitude for line at 0.65400 is -10.56119 +/- 5.43394
0.00466280756827
0.0423377963873
Equivalent width for line 0.574: 0.00466 +/ 2.307165
Equivalent width for line 0.654: 0.04234 +/ 7.386393

Simulation 35


In [248]:
plot_all(35)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 403 samples in the posterior.
The probability that there is a signal in the data is 0.1290
The estimate for the Doppler shift is 0.066 +/- 0.021
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -7.39743 +/- 4.07434
Mean for amplitude for line at 0.65400 is -7.92116 +/- 3.73505
0.309790307409
0.0921407077154
Equivalent width for line 0.574: 0.30979 +/ 0.699156
Equivalent width for line 0.654: 0.09214 +/ 6.805754

Simulation 36


In [249]:
plot_all(36)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 399 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -0.93136 +/- 0.13533
Mean for amplitude for line at 0.65400 is -4.45927 +/- 3.14788
1.3622011517
0.0786905673646
Equivalent width for line 0.574: 1.36220 +/ 0.168527
Equivalent width for line 0.654: 0.07869 +/ 1499.352730

Simulation 37


In [250]:
plot_all(37)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 404 samples in the posterior.
The probability that there is a signal in the data is 0.1782
The estimate for the Doppler shift is 0.065 +/- 0.025
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -6.43723 +/- 4.55428
Mean for amplitude for line at 0.65400 is -6.58636 +/- 4.12569
1.2757438175
0.668109109301
Equivalent width for line 0.574: 1.27574 +/ 1.681520
Equivalent width for line 0.654: 0.66811 +/ 1.710622

Simulation 38


In [251]:
plot_all(38)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 420 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -0.53482 +/- 0.13281
Mean for amplitude for line at 0.65400 is -4.66740 +/- 2.52991
1.63764116932
0.0536674484385
Equivalent width for line 0.574: 1.63764 +/ 0.229384
Equivalent width for line 0.654: 0.05367 +/ 14.557386

Simulation 39


In [252]:
plot_all(39)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 409 samples in the posterior.
The probability that there is a signal in the data is 0.0513
The estimate for the Doppler shift is 0.062 +/- 0.024
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -7.49408 +/- 4.01352
Mean for amplitude for line at 0.65400 is -8.31129 +/- 3.76664
0.946008292371
0.305580438921
Equivalent width for line 0.574: 0.94601 +/ 0.752134
Equivalent width for line 0.654: 0.30558 +/ 0.853272

Simulation 40


In [253]:
plot_all(40)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 406 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -2.06205 +/- 0.11263
Mean for amplitude for line at 0.65400 is -6.23203 +/- 2.85832
1.41610036945
0.0483224934277
Equivalent width for line 0.574: 1.41610 +/ 0.148163
Equivalent width for line 0.654: 0.04832 +/ 0.603730

Simulation 41


In [254]:
plot_all(41)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 405 samples in the posterior.
The probability that there is a signal in the data is 0.7778
The estimate for the Doppler shift is 0.081 +/- 0.002
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -4.22669 +/- 0.80730
Mean for amplitude for line at 0.65400 is -7.30246 +/- 3.07564
1.83982476743
0.137530427209
Equivalent width for line 0.574: 1.83982 +/ 0.892708
Equivalent width for line 0.654: 0.13753 +/ 1119.846748

Simulation 42

failed


In [ ]:

Simulation 43


In [255]:
plot_all(43)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 405 samples in the posterior.
The probability that there is a signal in the data is 0.7531
The estimate for the Doppler shift is 0.081 +/- 0.004
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.67173 +/- 0.49448
Mean for amplitude for line at 0.65400 is -7.32140 +/- 3.42292
1.6279209786
0.135241515674
Equivalent width for line 0.574: 1.62792 +/ 0.759893
Equivalent width for line 0.654: 0.13524 +/ 508.963838

Simulation 44


In [256]:
plot_all(44)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 406 samples in the posterior.
The probability that there is a signal in the data is 0.9754
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.55564 +/- 0.21559
Mean for amplitude for line at 0.65400 is -7.41147 +/- 4.12345
1.26787398855
0.0840562403149
Equivalent width for line 0.574: 1.26787 +/ 0.270490
Equivalent width for line 0.654: 0.08406 +/ 21.739249

Simulation 45


In [257]:
plot_all(45)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 400 samples in the posterior.
The probability that there is a signal in the data is 0.9350
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -4.44230 +/- 0.24400
Mean for amplitude for line at 0.65400 is -7.87490 +/- 3.04599
2.21207752383
0.160320297708
Equivalent width for line 0.574: 2.21208 +/ 0.430409
Equivalent width for line 0.654: 0.16032 +/ 1723.238664

Simulation 46


In [258]:
plot_all(46)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 404 samples in the posterior.
The probability that there is a signal in the data is 0.9604
The estimate for the Doppler shift is 0.082 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.40905 +/- 0.22594
Mean for amplitude for line at 0.65400 is -7.37867 +/- 3.49243
1.29307543713
0.0524266663636
Equivalent width for line 0.574: 1.29308 +/ 0.302336
Equivalent width for line 0.654: 0.05243 +/ 85.760945

Simulation 47


In [259]:
plot_all(47)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 442 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -0.76062 +/- 0.07859
Mean for amplitude for line at 0.65400 is -4.62214 +/- 2.80744
1.57402997711
0.0635893935144
Equivalent width for line 0.574: 1.57403 +/ 0.131064
Equivalent width for line 0.654: 0.06359 +/ 1.723367

Simulation 48


In [260]:
plot_all(48)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 400 samples in the posterior.
The probability that there is a signal in the data is 0.7475
The estimate for the Doppler shift is 0.080 +/- 0.004
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -3.97382 +/- 0.72246
Mean for amplitude for line at 0.65400 is -7.30649 +/- 2.96614
1.56340499608
0.0732807757524
Equivalent width for line 0.574: 1.56340 +/ 0.447139
Equivalent width for line 0.654: 0.07328 +/ 2829.403975

Simulation 49

failed


In [ ]:

Simulation 50


In [261]:
plot_all(50)


read ARF file ../data/athena_xifu_sixte_1469_onaxis_v20150402.arf
WARNING: '../data/athena_xifu_rmf_highres_v20150609.rmf' is not a filename or  MATRIX column not a variable length field
There are 437 samples in the posterior.
The probability that there is a signal in the data is 1.0000
The estimate for the Doppler shift is 0.081 +/- 0.000
/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/matplotlib/pyplot.py:524: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
Mean for amplitude for line at 0.57400 is -1.19293 +/- 0.06641
Mean for amplitude for line at 0.65400 is -4.09985 +/- 2.60661
1.29534779939
0.12710899321
Equivalent width for line 0.574: 1.29535 +/ 0.085269
Equivalent width for line 0.654: 0.12711 +/ 6.385061

Improving the Model

So far, we've run basically ShiftyLines without many changes, but that's probably not the best strategy. The model needed for Athena WHIM detections can be much simpler. In particular:

  • We should try a run without the OU process
  • Make sure the hyperparameter on the amplitude doesn't clobber allowing the amplitudes of the two parameters to be far apart
  • We can probably simplify the width parameter, since the width should be fairly narrow
  • The features we are looking for are always absorption features: thus we can remove the sign parameter that flips between emission and absorption lines

In [ ]: