Investigate Simard data and calculate covariance matrix and means for apparent Sersic parameters

In this notebook I will load the Sersic only paramters and use Seaborn to plot corner plots


In [18]:
from astropy.io import fits

%matplotlib inline
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm

import numpy as np
import pandas as pd
from scipy import stats, integrate
import seaborn as sns
sns.set(color_codes=True)

In [19]:
datafile = '/Users/rs548/Documents/Science/PeteHurley/Simard/table3wheadings.dat'
data = pd.read_csv(datafile,sep='\s+')
columns = ['z','$n_b$','$R_{chl,g}$','$g_{g2d}$','$M_{r,g}$','$e$']
df2 = data[columns]
len0 = len(df2)
for column in columns:
    df2 = df2.drop(df2[df2[column] == -99.99].index)
print(str(len0 - len(df2)) + ' columns removed because of -99.99 values')


14237 columns removed because of -99.99 values

In [20]:
sns.pairplot( data=df2)


Out[20]:
<seaborn.axisgrid.PairGrid at 0x1612b5290>

In [21]:
g = sns.PairGrid(data=df2)
g.map_diag(sns.kdeplot)
g.map_offdiag(sns.kdeplot, cmap="Blues_d", n_levels=6)


/Users/rs548/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.py:545: UserWarning: No labelled objects found. Use label='...' kwarg on individual plots.
  warnings.warn("No labelled objects found. "

In [22]:
g.savefig('/Users/rs548/Documents/Science/PeteHurley/Simard/kdecorner.png')

In [23]:
df2


Out[23]:
z $n_b$ $R_{chl,g}$ $g_{g2d}$ $M_{r,g}$ $e$
0 0.030284 1.83 1.18 18.19 -18.28 0.67
1 0.077923 0.57 3.61 18.02 -20.63 0.62
2 0.099295 0.94 3.48 18.80 -20.42 0.51
3 0.160228 1.28 12.14 17.89 -22.81 0.43
4 0.071558 1.29 3.89 17.60 -21.10 0.34
5 0.071975 1.02 4.73 17.38 -21.34 0.64
6 0.054841 1.09 4.75 16.05 -21.81 0.20
7 0.054572 0.57 2.71 17.82 -19.80 0.35
8 0.080338 0.84 5.28 18.22 -20.77 0.80
9 0.024743 0.50 0.26 18.22 -17.78 0.85
10 0.077123 2.22 5.82 17.16 -22.02 0.72
11 0.054813 2.52 1.96 18.44 -19.37 0.17
12 0.071597 1.72 2.52 18.27 -19.91 0.73
13 0.157120 7.39 5.18 18.85 -22.17 0.01
14 0.110515 4.04 2.70 19.04 -20.95 0.10
15 0.061805 2.04 0.84 18.56 -19.84 0.67
16 0.226996 2.06 0.00 19.58 -22.80 0.22
17 0.079627 2.66 4.45 18.25 -20.88 0.75
18 0.233186 2.28 5.12 19.49 -22.96 0.45
19 0.252052 4.23 7.41 19.46 -23.26 0.02
20 0.293179 4.47 11.49 19.56 -23.68 0.35
21 0.077636 7.98 5.01 17.45 -21.59 0.13
22 0.127490 1.41 2.54 18.92 -21.45 0.82
23 0.076173 0.81 2.37 18.31 -20.10 0.67
24 0.216687 6.62 6.99 19.34 -22.76 0.23
25 0.113759 3.08 3.89 18.02 -21.75 0.34
26 0.184112 1.24 7.55 19.06 -22.04 0.25
27 0.201887 6.35 6.58 19.21 -22.63 0.11
28 0.156257 2.15 3.31 19.18 -21.68 0.06
29 0.113543 1.04 2.08 18.80 -20.94 0.45
... ... ... ... ... ... ...
1123688 0.048653 1.06 2.27 16.05 -21.31 0.36
1123689 0.049051 2.20 8.99 15.09 -22.41 0.26
1123690 0.081095 6.12 4.93 17.75 -21.19 0.21
1123691 0.190406 1.28 11.00 17.85 -22.76 0.25
1123692 0.088857 3.04 2.25 17.65 -21.52 0.52
1123693 0.129775 3.48 2.83 18.56 -21.69 0.40
1123694 0.123245 2.16 5.72 17.41 -22.41 0.05
1123695 0.167299 2.63 8.28 18.54 -22.29 0.36
1123696 0.149673 7.15 6.58 18.74 -21.89 0.15
1123697 0.179810 0.89 6.05 18.86 -21.88 0.32
1123698 0.233450 6.51 10.81 18.92 -23.23 0.26
1123699 0.034688 1.21 2.18 17.53 -18.87 0.25
1123700 0.177259 4.51 12.62 18.14 -23.09 0.07
1123701 0.146986 0.72 6.70 17.53 -22.59 0.45
1123702 0.094524 0.91 2.59 18.18 -20.93 0.38
1123703 0.046254 0.65 2.46 18.03 -18.99 0.81
1123704 0.046335 1.24 1.86 16.87 -20.38 0.41
1123705 0.077674 4.13 2.97 17.23 -21.54 0.22
1123706 0.263508 4.82 12.21 18.81 -23.67 0.39
1123707 0.138669 2.56 3.67 18.81 -21.56 0.32
1123708 0.062653 0.79 4.32 18.32 -19.56 0.85
1123709 0.242612 6.17 13.52 19.02 -23.33 0.18
1123710 0.178553 3.45 4.39 18.79 -22.41 0.35
1123711 0.112736 3.86 4.50 17.63 -22.06 0.34
1123712 0.118850 1.64 5.32 17.88 -22.00 0.56
1123713 0.181439 4.09 4.26 19.08 -22.19 0.53
1123714 0.054717 1.39 2.36 18.21 -19.41 0.09
1123715 0.117462 5.87 3.57 18.30 -21.60 0.50
1123716 0.025773 1.28 2.66 16.30 -19.47 0.67
1123717 0.086556 2.47 5.91 17.13 -21.93 0.11

1109481 rows × 6 columns


In [29]:
len(df2[df2['$R_{chl,g}$'] < 0])


Out[29]:
14642

In [30]:
len(df2[df2['$R_{chl,g}$'] == 0])


Out[30]:
3923

In [31]:
len(df2[df2['$R_{chl,g}$'] > 0])


Out[31]:
1090916

In [ ]: