out,table = p.sfrl1_parse('slug_comp_rere.dat') #out2,table2 = p.sfrl1_parse('slug_comp_rere.dat') #get names of tags #out.dtype.names sfrs = out.sfr_x x = out.x #get the sfr closest to \log sfr = -2 for i in xrange(3): index = np.argmin(abs(out.sfr_x -sfr[i])) this_pdf = table[index] #this_pdf2 = table2[index] print sfrs[index] # plt.plot(p.ln2mv(x), p.ln2mvpdf(this_pdf2), lw=3, color=(1.,0.5,0.5), label='Uncorrected') plt.plot(p.ln2mv(x), p.ln2mvpdf(this_pdf), lw=3, color='blue', label="CLOC") print "Normalization" print np.trapz(p.ln2mvpdf(this_pdf),p.ln2mv(x)) plt.xlim([-1,-18]) f=open(files[i], 'r') slug = np.array(f.read().split("\n")) slug=slug[0:-1] slug = slug.astype(float) bn=20 if i == 1: bn = 30 plt.hist(slug, normed=True, bins=bn, histtype="stepfilled", color='grey',\ edgecolor='none') plt.xlabel(r"$M_V$") plt.ylabel(r"$p(M_V)$") plt.title(r"$\log_{10} \textrm{SFR} = "+repr(sfr[i])+"$") plt.legend(prop={'size':14}, frameon=False)
out, table = p.sfrl1_parse('slug_comp_cut.dat') #out2,table2 = p.sfrl1_parse('slug_comp2.dat') #get names of tags #out.dtype.names sfrs = out.sfr_x x = out.x #get the sfr closest to \log sfr = -2 for i in xrange(3): index = np.argmin(abs(out.sfr_x - sfr[i])) this_pdf = table[index] #this_pdf2 = table2[index] print sfrs[index] plt.plot(p.ln2mv(x), p.ln2mvpdf(this_pdf), lw=3, color='blue', label='CLOC') #plt.plot(p.ln2mv(x), p.ln2mvpdf(this_pdf), lw=3, color='blue', label="Corrected") plt.xlim([-1, -18]) f = open(files[i], 'r') slug = np.array(f.read().split("\n")) slug = slug[0:-1] slug = slug.astype(float) plt.hist(slug, normed=True, bins=40, histtype="stepfilled", color='grey',\ edgecolor='none') plt.xlabel(r"$M_V$") plt.ylabel(r"$p(M_V)$") plt.title(r"$\log_{10} \textrm{SFR} = " + repr(sfr[i]) + "$") plt.legend(prop={'size': 14}, frameon=False)
out,table = p.sfrl1_parse('slug_comp_cut.dat') #out2,table2 = p.sfrl1_parse('slug_comp2.dat') #get names of tags #out.dtype.names sfrs = out.sfr_x x = out.x #get the sfr closest to \log sfr = -2 for i in xrange(3): index = np.argmin(abs(out.sfr_x -sfr[i])) this_pdf = table[index] #this_pdf2 = table2[index] print sfrs[index] plt.plot(p.ln2mv(x), p.ln2mvpdf(this_pdf), lw=3, color='blue', label='CLOC') #plt.plot(p.ln2mv(x), p.ln2mvpdf(this_pdf), lw=3, color='blue', label="Corrected") plt.xlim([-1,-18]) f=open(files[i], 'r') slug = np.array(f.read().split("\n")) slug=slug[0:-1] slug = slug.astype(float) plt.hist(slug, normed=True, bins=40, histtype="stepfilled", color='grey',\ edgecolor='none') plt.xlabel(r"$M_V$") plt.ylabel(r"$p(M_V)$") plt.title(r"$\log_{10} \textrm{SFR} = "+repr(sfr[i])+"$") plt.legend(prop={'size':14}, frameon=False) plt.show() plt.savefig("slugcomp"+repr(i)+"_cut.eps") plt.clf()
gamma_min = 2.438e19, sfr_err=0.005, step=0.125/4) out,table = p.sfrl1_parse('slug_comp.dat') mcdata = open("/Users/rdasilva/Dropbox/sfr_l1_plots/montecarlo/mctest.txt",'r') mcdata = mcdata.read().split("\n")[0:-1] mcdata = np.array(mcdata).astype(float) mcdata=mcdata[mcdata<-3] #get names of tags #out.dtype.names sfrs = out.sfr_x x = out.x #get the sfr closest to \log sfr = -1 index = np.argmin(abs(out.sfr_x -(-1))) this_pdf = table[index] plt.xlim([-1,-18]) plt.hist(mcdata, normed=True, bins=80*4, histtype="stepfilled", color='grey',\ edgecolor='none') plt.plot(p.ln2mv(x), p.ln2mvpdf(this_pdf), lw=3, color='blue') plt.xlabel(r"$M_V$") plt.ylabel(r"$p(M_V)$") plt.show() plt.savefig("compmc.eps") plt.clf()
#out2,table2 = p.sfrl1_parse('slug_comp_rere.dat') #get names of tags #out.dtype.names sfrs = out.sfr_x x = out.x #get the sfr closest to \log sfr = -2 for i in xrange(3): index = np.argmin(abs(out.sfr_x - sfr[i])) this_pdf = table[index] #this_pdf2 = table2[index] print sfrs[index] # plt.plot(p.ln2mv(x), p.ln2mvpdf(this_pdf2), lw=3, color=(1.,0.5,0.5), label='Uncorrected') plt.plot(p.ln2mv(x), p.ln2mvpdf(this_pdf), lw=3, color='blue', label="CLOC") print "Normalization" print np.trapz(p.ln2mvpdf(this_pdf), p.ln2mv(x)) plt.xlim([-1, -18]) f = open(files[i], 'r') slug = np.array(f.read().split("\n")) slug = slug[0:-1] slug = slug.astype(float) bn = 20 if i == 1: bn = 30 plt.hist(slug, normed=True, bins=bn, histtype="stepfilled", color='grey',\ edgecolor='none') plt.xlabel(r"$M_V$")