Libraries to be used


In [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

Loading and checking the catalogue


In [2]:
my_data = np.loadtxt('myGAMA_ALL_AB_ABSOL_MAGS_clean.csv', delimiter=',', dtype=str)

In [3]:
print my_data.shape


(41573, 175)

In [4]:
my_dictionary = {}
for i in range(len(my_data[0, :])):                                         # Converting numpy array into dictionary
    my_dictionary[my_data[0, i]] = np.array(my_data[0 + 1:, i], dtype=str)

In [5]:
redshift     = my_dictionary['Z_HELIO'].astype(float)
fuv_band     = my_dictionary['MAG_AB_FUV'].astype(float)   
nuv_band     = my_dictionary['MAG_AB_NUV'].astype(float)
r_band       = my_dictionary['MAG_AB_R'].astype(float)
stellar_mass = my_dictionary['MASS_k0'].astype(float)
sex_index_r  = my_dictionary['SEX_INDEX_R'].astype(float)  #SEx Sérsic Index
sex_index_h  = my_dictionary['SEX_INDEX_H'].astype(float)  #SEx Sérsic Index
gal_index_r  = my_dictionary['GAL_INDEX_R'].astype(float)  #Galfit Sérsic Index
gal_index_h  = my_dictionary['GAL_INDEX_H'].astype(float)  #Galfit Sérsic Index

In [6]:
print sex_index_h.size
print sex_index_r


41572
[ 0.6998503  1.303793   1.143467  ...,  2.656007   0.7202741  1.245958 ]

In [7]:
indexes = np.arange(redshift.size)
index_clean = indexes[(redshift>0.015)*(r_band>0)*(nuv_band>0)*(fuv_band>0)*((fuv_band-nuv_band)<50)*((fuv_band-nuv_band)>(-20))]

Caracterizing the UV emission of these galaxies


In [8]:
index_uvup        = np.where(((redshift>0.015)*(r_band>0)*(nuv_band>0)*(fuv_band>0)*(nuv_band - r_band) > 5.4)*(fuv_band-nuv_band<0.9)*(fuv_band - r_band<6.6)*(fuv_band-nuv_band<50)*(fuv_band-nuv_band>-20))
index_rsf         = np.where(((redshift>0.015)*(r_band>0)*(nuv_band>0)*(fuv_band>0)*(nuv_band - r_band) < 5.4)*(fuv_band-nuv_band<50)*(fuv_band-nuv_band>-20))
index_uvweak      = np.where(((redshift>0.015)*(r_band>0)*(nuv_band>0)*(fuv_band>0)*(nuv_band - r_band) > 5.4)*((fuv_band - r_band)>6.6)*(fuv_band-nuv_band<50)*(fuv_band-nuv_band>-20))
index_redsequence = np.where(((redshift>0.015)*(r_band>0)*(nuv_band>0)*(fuv_band>0)*(nuv_band - r_band) > 5.4)*(fuv_band-nuv_band<50)*(fuv_band-nuv_band>-20))

In [9]:
print fuv_band[index_uvup].size
print fuv_band[index_rsf].size
print fuv_band[index_uvweak].size
print (fuv_band.size)


1213
35665
2998
41572

In [10]:
print redshift[index_clean].min(), redshift[index_clean].max()


0.01555 1.56978

In [11]:
idx_si = indexes[(redshift>0.015)*(r_band>0)*(nuv_band>0)*(fuv_band>0)*((fuv_band-nuv_band)<50)*((fuv_band-nuv_band)>(-20))*(gal_index_r>0)*(gal_index_h>0)]
plt.subplots(1,1, figsize=(10,7))
plt.plot(gal_index_r[idx_si], gal_index_h[idx_si], 'o', color = '#fdae6b', alpha=0.7)
plt.xlabel("Sersic Index r band", fontsize=15)
plt.ylabel("Sersic Index H band", fontsize=15)
plt.ylim(0,20)
plt.xlim(0,20)
plt.tick_params('both', labelsize='15')
plt.savefig('./Figs/sex_indexes_galfit.png', dpi=100)
plt.show()



In [12]:
idx_si = indexes[(redshift>0.015)*(r_band>0)*(nuv_band>0)*(fuv_band>0)*((fuv_band-nuv_band)<50)*((fuv_band-nuv_band)>(-20))*(sex_index_r>0)*(sex_index_h>0)]
plt.subplots(1,1, figsize=(10,7))
plt.plot(sex_index_r[idx_si], sex_index_h[idx_si], 'o', color = '#fdae6b', alpha=0.7)
plt.xlabel("Sersic Index r band", fontsize=15)
plt.ylabel("Sersic Index H band", fontsize=15)
plt.ylim(0,20)
plt.xlim(0,20)
plt.tick_params('both', labelsize='15')
plt.savefig('./Figs/sex_indexes_sextractor.png', dpi=100)
plt.show()


Plot 01: Yi et al. (2011) UV diagnosis plot


In [13]:
sns.set_style("whitegrid")
plt.subplots(1,1, figsize=(10,7))
plt.plot((nuv_band - r_band)[index_clean], (fuv_band - nuv_band)[index_clean], 'o', color = '#fdae6b', alpha=0.7)
plt.plot((nuv_band - r_band)[index_uvup], (fuv_band - nuv_band)[index_uvup], 'o', color = '#e6550d', alpha=0.7)
plt.text(-5, 8, r"RSF", fontsize=15)
plt.text(-5, -3, r"RSF", fontsize=15)
plt.text(7, 8, r"UV Weak", fontsize=15)
plt.text(7, -3, r"UV upturn", fontsize=15)
plt.axvline(x=5.4, color='black', linewidth=2.)
plt.axhline(y=0.9, color='black', linewidth=2.)
plt.xlabel("NUV-r", fontsize=15)
plt.ylabel("FUV-NUV", fontsize=15)
plt.tick_params('both', labelsize='15')
#plt.savefig('./Figs/uvupturn_nospurious.png', dpi=100)
plt.show()



In [14]:
sns.set_style("whitegrid")
plt.subplots(1,1, figsize=(10,7))
plt.plot((nuv_band - r_band)[index_clean], (fuv_band - nuv_band)[index_clean], 'o', color = '#fec44f', alpha=0.7)
plt.plot((nuv_band - r_band)[index_redsequence], (fuv_band - nuv_band)[index_redsequence], 'o', color = '#feb24c', alpha=0.7)
plt.plot((nuv_band - r_band)[index_uvup], (fuv_band - nuv_band)[index_uvup], 'o', color = '#f03b20', alpha=0.7)
plt.text(-5, 8, r"RSF", fontsize=20)
plt.text(-5, -3, r"RSF", fontsize=20)
plt.text(7, 8, r"UV Weak", fontsize=20)
plt.text(7, -3, r"UV upturn", fontsize=20)
plt.axvline(x=5.4, color='black', linewidth=2.)
plt.axhline(y=0.9, color='black', linewidth=2.)
plt.xlabel("NUV-r", fontsize=20)
plt.ylabel("FUV-NUV", fontsize=20)
plt.tick_params('both', labelsize='20')
plt.grid(alpha=0.40)
plt.savefig('./Figs/yi_diagram.pdf')
plt.savefig('./Figs/yi_diagram.png')
plt.show()



In [15]:
print (nuv_band - r_band)[index_clean].size


39330

Plot 02: Redshift x Mass plot


In [16]:
sns.set_style("whitegrid")
plt.subplots(1,1, figsize=(10,7))
plt.semilogy(redshift[index_clean], stellar_mass[index_clean], 'o', alpha=0.7, color='#1b9e77', label='All Galaxies')
plt.semilogy(redshift[index_redsequence], stellar_mass[index_redsequence], 'o', alpha=0.7, color='#7570b3', label='Red Sequence (UV weak+upturn)')
plt.semilogy(redshift[index_uvup], stellar_mass[index_uvup], 'o', alpha=0.7, color='#d95f02', label='UV Upturn')
plt.xlabel("Redshift", fontsize=15)
plt.ylabel("Stellar Mass", fontsize=15)
plt.legend(loc='best', numpoints=1, fontsize=20, frameon=False)
# plt.axhline(y=5E9, color='black', linewidth=1.)
# plt.axvline(x=0.35, color='black', linewidth=1.)
# plt.axvline(x=0.015, color='black', linewidth=1.)
plt.tick_params('both', labelsize='15')
plt.xlim(0, 0.6)
plt.grid(alpha=0.40)
plt.savefig('./Figs/mass_z_uvcategories.pdf')
plt.savefig('./Figs/mass_z_uvcategories.png')
plt.show()


Plot 03: Fraction of UV upturn galaxies among all redsequence


In [17]:
bins = np.arange(0, (redshift[index_clean]).max(), 0.05)
ratio_uvup_redseq = []
average_redshift = []
redshift_uvup = redshift[index_uvup]
z_uv = []
z_rs = []
for i in range(bins.size):
    if i==0:
        continue
    else:
        index_redseq_i = np.where((bins[i-1] <= redshift[index_redsequence]) * (redshift[index_redsequence] <= bins[i]))
        index_uvup_i = np.where((bins[i-1] <= redshift_uvup) * (redshift_uvup <= bins[i]))
        redshift_bin_redseq = redshift[index_redseq_i]
        redshift_bin_uvup   = redshift_uvup[index_uvup_i]
        if (redshift_bin_redseq.size==0):
            ratio_uvup_i = 0
            print "There are no UV Upturn galaxies in this range of redshift: %.2f and %.2f" % (bins[i-1], bins[i])
        else:
            ratio_uvup_i = (np.float(redshift_bin_uvup.size) / np.float(redshift_bin_redseq.size)) *100
            average_redshift_i = np.average((bins[i], bins[i-1]))
        z_uv.append(redshift_bin_uvup.size)
        z_rs.append(redshift_bin_redseq.size)
        ratio_uvup_redseq.append(ratio_uvup_i)
        average_redshift.append(average_redshift_i)
ratio_uvup_redseq = np.array(ratio_uvup_redseq)
z_uv = np.array(z_uv)
z_rs = np.array(z_rs)
average_redshift  = np.array(average_redshift)
print ratio_uvup_redseq
print average_redshift
print z_uv
print z_rs


There are no UV Upturn galaxies in this range of redshift: 0.45 and 0.50
There are no UV Upturn galaxies in this range of redshift: 0.50 and 0.55
There are no UV Upturn galaxies in this range of redshift: 0.55 and 0.60
There are no UV Upturn galaxies in this range of redshift: 0.70 and 0.75
There are no UV Upturn galaxies in this range of redshift: 0.80 and 0.85
There are no UV Upturn galaxies in this range of redshift: 0.85 and 0.90
There are no UV Upturn galaxies in this range of redshift: 0.90 and 0.95
There are no UV Upturn galaxies in this range of redshift: 0.95 and 1.00
There are no UV Upturn galaxies in this range of redshift: 1.00 and 1.05
There are no UV Upturn galaxies in this range of redshift: 1.05 and 1.10
There are no UV Upturn galaxies in this range of redshift: 1.10 and 1.15
There are no UV Upturn galaxies in this range of redshift: 1.15 and 1.20
There are no UV Upturn galaxies in this range of redshift: 1.20 and 1.25
There are no UV Upturn galaxies in this range of redshift: 1.25 and 1.30
There are no UV Upturn galaxies in this range of redshift: 1.30 and 1.35
There are no UV Upturn galaxies in this range of redshift: 1.35 and 1.40
There are no UV Upturn galaxies in this range of redshift: 1.40 and 1.45
There are no UV Upturn galaxies in this range of redshift: 1.45 and 1.50
There are no UV Upturn galaxies in this range of redshift: 1.50 and 1.55
[  8.69565217  15.13026052  24.33823529  34.91525424  45.08816121
  50.74626866  59.75609756  30.          16.66666667   0.           0.           0.
   0.           0.           0.           0.           0.           0.           0.
   0.           0.           0.           0.           0.           0.           0.
   0.           0.           0.           0.           0.        ]
[ 0.025  0.075  0.125  0.175  0.225  0.275  0.325  0.375  0.425  0.425
  0.425  0.425  0.625  0.675  0.675  0.775  0.775  0.775  0.775  0.775
  0.775  0.775  0.775  0.775  0.775  0.775  0.775  0.775  0.775  0.775
  0.775]
[ 14 151 331 309 179 170  49   9   1   0   0   0   0   0   0   0   0   0
   0   0   0   0   0   0   0   0   0   0   0   0   0]
[ 161  998 1360  885  397  335   82   30    6    0    0    0    2    1    0
    1    0    0    0    0    0    0    0    0    0    0    0    0    0    0
    0]

In [18]:
n_groups = bins.size
index = np.arange(1,n_groups,1)
sns.set_style('white')
plt.subplots(1,1, figsize=(10,7))
plt.bar(index, ratio_uvup_redseq, width=1., alpha=0.7, color='#e6550d', edgecolor='#e6550d')
for i in range(9):
    plt.text(index[i]-.4, ratio_uvup_redseq[i]+1, r"%d/%d" % (z_uv[i], z_rs[i]))
plt.xticks(index, bins)
plt.ylabel("% of UV Upturn Galaxies", fontsize=15)
plt.xlabel("Redshift Ranges", fontsize=15)
plt.tick_params('both', labelsize='15')
plt.xlim(0, 10)
plt.ylim(0, 65)
# plt.grid(alpha=0.40)
plt.savefig('./Figs/percentageuvup_redseq.pdf')
plt.savefig('./Figs/percentageuvup_redseq.png')
plt.show()



In [19]:
n_groups = bins.size
# index = np.arange(1,n_groups,1)
sns.set_style('white')
plt.subplots(1,1, figsize=(10,7))
plt.hist(redshift[index_rsf], bins=bins, log=True,  color='#fec44f', alpha=0.6, label='RSF Objects')
plt.hist(redshift[index_redsequence],  bins=bins,log=True,  color='#feb24c', alpha=0.9, label='Red Sequence objects')
plt.hist(redshift[index_uvup], bins=bins, log=True, color='#f03b20', alpha=0.8,  label='UV Upturn')
# plt.xticks(index, bins)
plt.ylabel("Frequency", fontsize=20)
plt.xlabel("Redshift Ranges", fontsize=20)
plt.tick_params('both', labelsize='15')
plt.xlim(0, 0.6)
plt.legend(loc='best', numpoints=1, fontsize=20, frameon=False)
# plt.grid(alpha=0.40)
plt.savefig('./Figs/gal_dist.pdf')
plt.savefig('./Figs/gal_dist.png')
plt.show()



In [20]:
plt.subplots(1,1, figsize=(10,7))
plt.plot(average_redshift, ratio_uvup_redseq, 'o')
plt.ylabel("% of UV Upturn Galaxies", fontsize=15)
plt.xlabel("Redshift Ranges", fontsize=15)
plt.tick_params('both', labelsize='15')
plt.xlim(0.,0.4)
plt.savefig('./Figs/uv_trend.pdf')
plt.savefig('./Figs/uv_trend.png')
plt.show()


Plot 04: Absolute Magnitude r band x NUV-r


In [21]:
mag_abs_r = my_dictionary['MAG_ABSOLUTE_R'].astype(float)
g_band = my_dictionary['MAG_AB_G'].astype(float)

In [22]:
with plt.style.context("seaborn-whitegrid"):
    plt.rcParams["axes.edgecolor"] = "0.15"
    plt.rcParams["axes.linewidth"]  = 1.25
    
    plt.subplots(1,1, figsize=(10,7))
    plt.plot(mag_abs_r[index_clean], (nuv_band[index_clean]- r_band[index_clean]), 'o', color='gray', alpha=0.05, label='All galaxies')
    plt.plot(mag_abs_r[index_uvup], (nuv_band[index_uvup] - r_band[index_uvup]), 'o', color='#e6550d', alpha=0.2, label='UV Upturn')
    sns.kdeplot(mag_abs_r[index_clean], (nuv_band[index_clean] - r_band[index_clean]), n_levels=50, shade=False, 
                cmap="Purples_d", cbar=True)
    plt.xlabel("M$_r$", fontsize=15)
    plt.ylabel("NUV-r", fontsize=15)
    plt.tick_params('both', labelsize='15')
#     plt.xlim(-23, -16.5)
    plt.ylim(-2, 10)
    plt.legend(loc='best', numpoints=100, fontsize=20, frameon=False)
      
    plt.savefig('./Figs/color_mag01.pdf')
    plt.savefig('./Figs/color_mag01.png')
    plt.show()



In [23]:
with plt.style.context("seaborn-whitegrid"):
    plt.rcParams["axes.edgecolor"] = "0.15"
    plt.rcParams["axes.linewidth"]  = 1.25
    
    plt.subplots(1,1, figsize=(10,7))    
    index01 = np.where(((g_band - r_band) <1) * ((nuv_band - r_band) > 5.4) * ((fuv_band - nuv_band) < 0.9) * ((fuv_band - r_band) < 6.6))
    plt.plot(mag_abs_r[index_clean], (g_band - r_band)[index_clean], 'o', color='gray', alpha=0.05, label='All galaxies')
    plt.plot(mag_abs_r[index_uvup], (g_band - r_band)[index_uvup], 'o', color='#e6550d', alpha=0.2, label='UV Upturn')
    sns.kdeplot(mag_abs_r[index_clean], (g_band - r_band)[index_clean], n_levels=50, shade=False, 
                        cmap="Purples_d", cbar=True)
    plt.ylim(-1., 4.)
    plt.xlim()
    plt.xlabel("M$_r$", fontsize=15)
    plt.ylabel("g-r", fontsize=15)
    plt.tick_params('both', labelsize='15')
    plt.legend(loc='best', numpoints=100, fontsize=20, frameon=False)
    plt.savefig('./Figs/color_mag02.pdf')
    plt.savefig('./Figs/color_mag02.png')
    plt.show()


Saving the new dataset


In [24]:
print my_data[0,:]


['CATAID' 'OBJID_SDSSDR7' 'RA' 'DEC' 'KRON_RADIUS' 'PETRO_RADIUS'
 'FLUX_AUTO_U' 'FLUXERR_AUTO_U' 'MAG_AUTO_U' 'MAGERR_AUTO_U' 'MAG_PETRO_U'
 'MAGERR_PETRO_U' 'MAG_AUTO_G' 'MAGERR_AUTO_G' 'MAG_PETRO_G'
 'MAGERR_PETRO_G' 'MAG_AUTO_R' 'MAGERR_AUTO_R' 'MAG_PETRO_R'
 'MAGERR_PETRO_R' 'MAG_AUTO_I' 'MAGERR_AUTO_I' 'MAG_PETRO_I'
 'MAGERR_PETRO_I' 'MAG_AUTO_Z' 'MAGERR_AUTO_Z' 'MAG_PETRO_Z'
 'MAGERR_PETRO_Z' 'MAG_AUTO_Y' 'MAGERR_AUTO_Y' 'MAG_PETRO_Y'
 'MAGERR_PETRO_Y' 'MAG_AUTO_J' 'MAGERR_AUTO_J' 'MAG_PETRO_J'
 'MAGERR_PETRO_J' 'MAG_AUTO_H' 'MAGERR_AUTO_H' 'MAG_PETRO_H'
 'MAGERR_PETRO_H' 'MAG_AUTO_K' 'MAGERR_AUTO_K' 'MAG_PETRO_K'
 'MAGERR_PETRO_K' 'BEST_MAG_NUV' 'BEST_MAGERR_NUV' 'BEST_MAG_FUV'
 'BEST_MAGERR_FUV' 'NMATCHUV' 'NMATCHOPT' 'NUVFLAG' 'FUVFLAG' 'TOT_MAG_NUV'
 'TOT_MAGERR_NUV' 'TOT_MAG_FUV' 'TOT_MAGERR_FUV' 'SPLIT_MAG_NUV'
 'SPLIT_MAGERR_NUV' 'SPLIT_MAG_FUV' 'SPLIT_MAGERR_FUV' 'COG_MAG_NUV'
 'COG_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G'
 'MAG_AB_R' 'MAG_AB_I' 'MAG_AB_Z' 'MAG_AB_Y' 'MAG_AB_J' 'MAG_AB_H'
 'MAG_AB_K' 'MAG_ABSOLUTE_FUV' 'MAG_ABSOLUTE_NUV' 'MAG_ABSOLUTE_U'
 'MAG_ABSOLUTE_G' 'MAG_ABSOLUTE_R' 'MAG_ABSOLUTE_I' 'MAG_ABSOLUTE_Z'
 'MAG_ABSOLUTE_Y' 'MAG_ABSOLUTE_J' 'MAG_ABSOLUTE_H' 'MAG_ABSOLUTE_K'
 'UV_CLASS_YI2011']

In [25]:
header = my_data[0,:]

In [26]:
print my_data[1:,0].size
print my_data[0,:].size


41572
175

In [27]:
my_data_clean = my_data[1:,:][index_clean]

In [28]:
print my_data[1:,:].shape
print my_data_clean.shape
print header


(41572, 175)
(39330, 175)
['CATAID' 'OBJID_SDSSDR7' 'RA' 'DEC' 'KRON_RADIUS' 'PETRO_RADIUS'
 'FLUX_AUTO_U' 'FLUXERR_AUTO_U' 'MAG_AUTO_U' 'MAGERR_AUTO_U' 'MAG_PETRO_U'
 'MAGERR_PETRO_U' 'MAG_AUTO_G' 'MAGERR_AUTO_G' 'MAG_PETRO_G'
 'MAGERR_PETRO_G' 'MAG_AUTO_R' 'MAGERR_AUTO_R' 'MAG_PETRO_R'
 'MAGERR_PETRO_R' 'MAG_AUTO_I' 'MAGERR_AUTO_I' 'MAG_PETRO_I'
 'MAGERR_PETRO_I' 'MAG_AUTO_Z' 'MAGERR_AUTO_Z' 'MAG_PETRO_Z'
 'MAGERR_PETRO_Z' 'MAG_AUTO_Y' 'MAGERR_AUTO_Y' 'MAG_PETRO_Y'
 'MAGERR_PETRO_Y' 'MAG_AUTO_J' 'MAGERR_AUTO_J' 'MAG_PETRO_J'
 'MAGERR_PETRO_J' 'MAG_AUTO_H' 'MAGERR_AUTO_H' 'MAG_PETRO_H'
 'MAGERR_PETRO_H' 'MAG_AUTO_K' 'MAGERR_AUTO_K' 'MAG_PETRO_K'
 'MAGERR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CORR_J_k1' 'KCORR_H_k1' 'KCORR_K_k1' 'CHI2_k1' 'MASS_k1' 'INTSFH_k1'
 'METS_k1' 'B300_k1' 'B1000_k1' 'Column2' 'EBV' 'A_FUV' 'A_NUV' 'A_B' 'A_u'
 'A_g' 'A_r' 'A_i' 'A_z' 'Column3' 'A_Y' 'A_J' 'A_H' 'A_K' 'Column4'
 'SPECID_BEST' 'Z_HELIO' 'MAG_AB_FUV' 'MAG_AB_NUV' 'MAG_AB_U' 'MAG_AB_G'
 'MAG_AB_R' 'MAG_AB_I' 'MAG_AB_Z' 'MAG_AB_Y' 'MAG_AB_J' 'MAG_AB_H'
 'MAG_AB_K' 'MAG_ABSOLUTE_FUV' 'MAG_ABSOLUTE_NUV' 'MAG_ABSOLUTE_U'
 'MAG_ABSOLUTE_G' 'MAG_ABSOLUTE_R' 'MAG_ABSOLUTE_I' 'MAG_ABSOLUTE_Z'
 'MAG_ABSOLUTE_Y' 'MAG_ABSOLUTE_J' 'MAG_ABSOLUTE_H' 'MAG_ABSOLUTE_K'
 'UV_CLASS_YI2011']

In [29]:
my_data_clean_df = pd.DataFrame(my_data_clean)

In [30]:
my_data_clean_df.to_csv('./myGAMA_ALL_AB_ABSOL_MAGS_clean_postprocess.csv', sep=',', header=header, index=False)

Plot 05: Analysing the Sersic Index


In [31]:
sex_clean = sex_index_r[index_clean][[(sex_index_r[index_clean]!=-9999.)*(gal_index_r[index_clean]!=-9999.)*(sex_index_r[index_clean]<=15)*(gal_index_r[index_clean]<=15)]]
gal_clean = gal_index_r[index_clean][[(sex_index_r[index_clean]!=-9999.)*(gal_index_r[index_clean]!=-9999.)*(sex_index_r[index_clean]<=15)*(gal_index_r[index_clean]<=15)]]

In [32]:
plt.hist(sex_clean, bins=50)
# plt.gca().set_yscale("log")
plt.show()



In [33]:
plt.hist(gal_clean, bins=50)
# plt.gca().set_yscale("log")
plt.show()



In [34]:
bins_sersic = np.arange(0, gal_clean.max(), 0.5)

In [35]:
sns.set_style("white")
plt.subplots(1,1, figsize=(10,7))
plt.hist(gal_index_r[index_rsf][[gal_index_r[index_rsf]<=10]], color='#fec44f', alpha=0.4, bins=bins_sersic, log=True, label='RSF Objects')
plt.hist(gal_index_r[index_redsequence][[gal_index_r[index_redsequence]<=10]], color='#feb24c', alpha=0.8, bins=bins_sersic, log=True, label='Red Sequence objects')
plt.hist(gal_index_r[index_uvup][[gal_index_r[index_uvup]<=10]], color='#f03b20', alpha=0.8, bins=bins_sersic, log=True, label='UV Upturn')
plt.xlabel("Sersic Index (SDSS r band)", fontsize=20)
plt.ylabel("Frequency", fontsize=20)
plt.tick_params('both', labelsize='15')
plt.xlim(0,11)
plt.legend(loc='best', numpoints=1, fontsize=20, frameon=False)
plt.savefig('./Figs/sersic_dist.pdf')
plt.show()



In [ ]: