Exemple #1
0
def plotsigsff(sig, sf, file, nbin):

    psplot = file + ".ps"
    psplotinit(psplot)
    tot = N.ones(len(sf), 'f')
    (sigbin, sfbin) = my.binitsumequal(sig, sf, nbin)
    (sigbin, totbin) = my.binitsumequal(sig, tot, nbin)
    print sfbin
    print totbin
    (sff, sfferr) = my.ratioerror(sfbin, totbin)
    ppgplot.pgbox("", 0.0, 0, "L", 0.0, 0)
    ymin = -.05
    ymax = 1.05
    xmin = min(sig) - 10.
    #xmax=max(sig)-200.
    xmax = 350.
    ppgplot.pgenv(xmin, xmax, ymin, ymax, 0)
    ppgplot.pglab("\gS\d5\u (gal/Mpc\u2\d)", "Fraction EW([OII])>4 \(2078)",
                  "")
    ppgplot.pgsls(1)  #dotted
    ppgplot.pgslw(4)  #line width
    sig = N.array(sig, 'f')
    sff = N.array(sff, 'f')
    ppgplot.pgsci(2)
    ppgplot.pgline(sigbin, sff)
    ppgplot.pgsci(1)

    ppgplot.pgpt(sigbin, sff, 17)
    my.errory(sigbin, sff, sfferr)
    ppgplot.pgend()
Exemple #2
0
def plotsig10sffall(sigspec, sigphot, sf, file, nbin):

    psplot = file + ".ps"
    psplotinit(psplot)
    ppgplot.pgbox("", 0.0, 0, "L", 0.0, 0)
    ymin = -.01
    ymax = 1.01
    #xmin=min(sigspec)-10.
    #xmax=max(sig)-200.
    #xmax=400.
    xmin = -1.
    xmax = 2.7
    ppgplot.pgenv(xmin, xmax, ymin, ymax, 0, 10)
    ppgplot.pglab("\gS\d10\u (gal/Mpc\u2\d)", "Fraction EW([OII])>4 \(2078)",
                  "")
    ppgplot.pgsls(1)  #dotted
    ppgplot.pgslw(4)  #line width
    tot = N.ones(len(sf), 'f')
    (sigbin, sfbin) = my.binitsumequal(sigspec, sf, nbin)
    (sigbin, totbin) = my.binitsumequal(sigspec, tot, nbin)
    (sff, sfferr) = my.ratioerror(sfbin, totbin)
    #sig=N.array(sig,'f')
    #sff=N.array(sff,'f')
    ppgplot.pgsci(2)
    sigbin = N.log10(sigbin)
    ppgplot.pgline(sigbin, sff)
    ppgplot.pgsci(1)

    ppgplot.pgpt(sigbin, sff, 17)
    my.errory(sigbin, sff, sfferr)

    (sigbin, sfbin) = my.binitsumequal(sigphot, sf, nbin)
    (sigbin, totbin) = my.binitsumequal(sigphot, tot, nbin)
    (sff, sfferr) = my.ratioerror(sfbin, totbin)
    #sig=N.array(sig,'f')
    #sff=N.array(sff,'f')
    ppgplot.pgslw(4)  #line width
    ppgplot.pgsci(4)
    sigbin = N.log10(sigbin)
    ppgplot.pgline(sigbin, sff)
    ppgplot.pgsci(1)

    ppgplot.pgpt(sigbin, sff, 21)
    #my.errory(sigbin,sff,sfferr)
    ppgplot.pgend()
Exemple #3
0
def plotspiralvsmassall():
    figure(figsize=[10,8])
    clf()
    #subplots_adjust(wspace=.25,hspace=.35)
    x1=[]
    y1=[]
    x2=[]
    y2=[]
    x3=[]
    y3=[]
    x4=[]
    y4=[]
    i=0
    n1field=0
    n2field=0
    d1field=0
    d2field=0
    for cl in mylocalclusters:
        #si += 1
        #ssubplot(3,3,i)
        a=sum(cl.On24ImageFlag & cl.spiralflag & (cl.snr24>3) & cl.member)
        b=sum(cl.On24ImageFlag & cl.spiralflag & cl.member)
        n1field=n1field+sum(cl.On24ImageFlag & cl.spiralflag & (cl.snr24>3) & cl.field)
        d1field=d1field+sum(cl.On24ImageFlag & cl.spiralflag & cl.field)
        r,errdown,errup=my.ratioerror(a,b)
        subplot(2,2,1)
        plot(cl.biweightscale,r,color=colors[i],marker=shapes[i],markersize=10)
        x1.append(cl.biweightscale)
        y1.append(r)
        erry=zeros((2,1))
        erry[1]=errup
        erry[0]=errdown
        errorbar(cl.biweightscale,r,yerr=erry,fmt=None,ecolor=colors[i])
        subplot(2,2,2)
        plot(cl.cLx,r,color=colors[i],marker=shapes[i],markersize=10)
        errorbar(cl.cLx,r,yerr=erry,fmt=None,ecolor=colors[i])

        x2.append(cl.cLx)
        y2.append(r)

        a=sum(cl.On24ImageFlag & cl.galfitflag & (cl.galfit24.re1*mipspixelscale < truncation_fraction*cl.n.SERSIC_TH50) & cl.member)
        b=sum(cl.On24ImageFlag & cl.galfitflag &  cl.member)

        n2field=n2field+sum(cl.On24ImageFlag & cl.galfitflag & (cl.galfit24.re1*mipspixelscale < truncation_fraction*cl.n.SERSIC_TH50) & cl.field)
        d2field=d2field+sum(cl.On24ImageFlag & cl.galfitflag &  cl.field)
        r,errdown,errup=my.ratioerror(a,b)
        print cl.prefix,cl.cLx, r, errdown, errup



        erry=zeros((2,1))
        erry[1]=errup
        erry[0]=errdown


        subplot(2,2,3)
        plot(cl.biweightscale,r,color=colors[i],marker=shapes[i],markersize=10)
        errorbar(cl.biweightscale,r,yerr=erry,fmt=None,ecolor=colors[i])
        x3.append(cl.biweightscale)
        y3.append(r)

        subplot(2,2,4)
        plot(cl.cLx,r,color=colors[i],marker=shapes[i],markersize=10)
        errorbar(cl.cLx,r,yerr=erry,fmt=None,ecolor=colors[i])
        x4.append(cl.cLx)
        y4.append(r)

        i += 1

    subplot(2,2,1)
    r,errdown,errup=my.ratioerror(n1field,d1field)
    axhline(y=r,color='k',ls='-')
    axhline(r-errdown,color='k',ls=':')
    axhline(r+errup,color='k',ls=':')
    ylabel('$ f(SF \ Spirals) $',fontsize=18)
    subplot(2,2,2)
    axhline(y=r,color='k',ls='-')
    axhline(r-errdown,color='k',ls=':')
    axhline(r+errup,color='k',ls=':')

    ax=gca()
    ax.set_xscale('log')

    subplot(2,2,3)
    r,errdown,errup=my.ratioerror(n2field,d2field)

    axhline(y=r,color='k',ls='-')
    axhline(r-errdown,color='k',ls=':')
    axhline(r+errup,color='k',ls=':')
    ylabel('$ f(Truncated \ Spirals) $',fontsize=18)
    xlabel('$ \sigma \ (km/s) $',fontsize=18)
    subplot(2,2,4)
    axhline(y=r,color='k',ls='-')
    axhline(r-errdown,color='k',ls=':')
    axhline(r+errup,color='k',ls=':')
    ax=gca()
    ax.set_xscale('log')
    xlabel('$ L_X \ (10^{43} erg/s) $',fontsize=18)


    for i in range(1,5):
        subplot(2,2,i)
        ylim(0,1)
    
    print 'SF Frac vs sigma'
    r,p=spearman(x1,y1)
    print 'SF Frac vs Lx'
    r,p=spearman(x2,y2)
    print 'Trun Frac vs sigma'
    r,p=spearman(x3,y3)
    print 'Trun Frac vs Lx'
    r,p=spearman(x4,y4)

    print 'Trun Frac vs Lx (w/out MKW11)'
    r,p=spearman(x4[1:],y4[1:])

    #text(.9,.15,'$ rho = %4.2f$'%(r),horizontalalignment='right',transform=ax.transAxes,fontsize=14)
    #text(.9,.1,'$p = %4.4f$'%(p),horizontalalignment='right',transform=ax.transAxes,fontsize=14)

    #xbin,ybin,ybinerr=my.binitbins(-.5,2,5,xall,yall)
    #xbin,ybin,ybinerr=my.binit(xall,yall,4)
    #plot(xbin,ybin,'k-',marker='o',markersize=14,label='median')
    #errorbar(xbin,ybin,yerr=ybinerr,fmt=None,ecolor='k',label='_nolegend_')
    #legend(loc='upper right',numpoints=1)
    #axis([-1,1.5,0,2.5])
    savefig(figuredir+'spiralpropvsmass.eps')
Exemple #4
0
def plotfracspiralvsmassall():
    figure(figsize=[10,5])
    clf()
    #subplots_adjust(wspace=.25,hspace=.35)
    x1=[]
    y1=[]
    x2=[]
    y2=[]
    i=0
    n1field=0
    d1field=0
    for cl in mylocalclusters:
        #si += 1
        #ssubplot(3,3,i)
        a=sum(cl.On24ImageFlag & cl.spiralflag  & cl.member)
        b=sum(cl.On24ImageFlag  & cl.member)
        n1field=n1field+sum(cl.On24ImageFlag & cl.spiralflag  & cl.field)
        d1field=d1field+sum(cl.On24ImageFlag  & cl.field)
        r,errdown,errup=my.ratioerror(a,b)
        subplot(1,2,1)
        plot(cl.biweightscale,r,color=colors[i],marker=shapes[i],markersize=10)
        x1.append(cl.biweightscale)
        y1.append(r)
        erry=zeros((2,1))
        erry[1]=errup
        erry[0]=errdown
        errorbar(cl.biweightscale,r,yerr=erry,fmt=None,ecolor=colors[i])
        subplot(1,2,2)
        plot(cl.cLx,r,color=colors[i],marker=shapes[i],markersize=10)
        errorbar(cl.cLx,r,yerr=erry,fmt=None,ecolor=colors[i])

        x2.append(cl.cLx)
        y2.append(r)


        i += 1

    subplot(1,2,1)
    r,errdown,errup=my.ratioerror(n1field,d1field)
    axhline(y=r,color='k',ls='-')
    axhline(r-errdown,color='k',ls=':')
    axhline(r+errup,color='k',ls=':')
    ylabel('$ f(Spirals) $',fontsize=18)
    subplot(1,2,2)
    axhline(y=r,color='k',ls='-')
    axhline(r-errdown,color='k',ls=':')
    axhline(r+errup,color='k',ls=':')

    ax=gca()
    ax.set_xscale('log')


    for i in range(1,3):
        subplot(1,2,i)
        ylim(0,1)
    xlabel1x2plot()
    print 'Frac Spirals vs sigma'
    r,p=spearman(x1,y1)
    print 'Frac Spirals vs Lx'
    r,p=spearman(x2,y2)
    savefig(figuredir+'fracspiralvsmass.eps')
Exemple #5
0
def plotsfspiralvsmassall():
    figure(figsize=[10,5])
    clf()
    #subplots_adjust(wspace=.25,hspace=.35)
    x1=[]
    y1=[]
    x2=[]
    y2=[]
    i=0
    n1field=0
    d1field=0
    for cl in mylocalclusters:
        #si += 1
        #ssubplot(3,3,i)
        #self.galfitflag=self.On24ImageFlag & (self.snr24>3) & ~self.agnflag & ~self.galfit24.numerical_error_flag24  & self.spiralflag & (self.n.SERSIC_TH50 > 5.) & & (self.stellarmass > 1.e10)
        a=sum(cl.On24ImageFlag & cl.spiralflag   & cl.member & (cl.stellarmass > minstellarmass)& (cl.ce.LIR > 5.1e8)  & ~cl.agnflag)
        b=sum(cl.On24ImageFlag & cl.spiralflag & cl.member &(cl.stellarmass > minstellarmass)  & ~cl.agnflag)
        n1field=n1field+sum(cl.On24ImageFlag & cl.spiralflag   & cl.field & (cl.stellarmass > minstellarmass)& (cl.ce.LIR > 5.1e8)  & ~cl.agnflag) 
        d1field=d1field+sum(cl.On24ImageFlag & cl.spiralflag & cl.field &(cl.stellarmass > minstellarmass)  & ~cl.agnflag)
        r,errdown,errup=my.ratioerror(a,b)
        subplot(1,2,1)
        plot(cl.biweightscale,r,color=colors[i],marker=shapes[i],markersize=10,label=cl.prefix)
        x1.append(cl.biweightscale)
        y1.append(r)
        erry=zeros((2,1))
        erry[1]=errup
        erry[0]=errdown
        errorbar(cl.biweightscale,r,yerr=erry,fmt=None,ecolor=colors[i],label='_nolegend_')
        subplot(1,2,2)
        plot(cl.cLx,r,color=colors[i],marker=shapes[i],markersize=10,label=cl.prefix)
        errorbar(cl.cLx,r,yerr=erry,fmt=None,ecolor=colors[i],label='_nolegend_')

        x2.append(cl.cLx)
        y2.append(r)


        i += 1

    subplot(1,2,1)
    r,errdown,errup=my.ratioerror(n1field,d1field)
    axhline(y=r,color='k',ls='-')
    axhline(r-errdown,color='k',ls=':')
    axhline(r+errup,color='k',ls=':')
    ylabel('$ f(SF \ Spirals) $',fontsize=18)
    subplot(1,2,2)
    axhline(y=r,color='k',ls='-')
    axhline(r-errdown,color='k',ls=':')
    axhline(r+errup,color='k',ls=':')
    legend(loc='lower left',prop={'size':8},numpoints=1)
    ax=gca()
    ax.set_xscale('log')


    for i in range(1,3):
        subplot(1,2,i)
        ylim(0,1.05)
    xlabel1x2plot()    
    print 'SF Frac vs sigma'
    r,p=spearman(x1,y1)
    print 'SF Frac vs Lx'
    r,p=spearman(x2,y2)
    savefig(figuredir+'sfspiralvsmass.eps')