コード例 #1
0
ファイル: coldens.py プロジェクト: huletlab/apparatus3-py
def azabel(ax, axHist, azdata, **kwargs):
    l = kwargs.get("labelstr", None)
    c = kwargs.get("col", None)
    which = kwargs.get("which", "Int")

    cInt = kwargs.get("colInt", "blue")
    cRad = kwargs.get("colRad", "red")

    if c is not None:
        cInt = c
        cRad = c

    xscale = kwargs.get("xs", 1.0)
    yscale = kwargs.get("ys", 1.0)

    abdat = inverAbelDat(azdata[0], azdata[1])

    tS = kwargs.get("trimStart", 0)
    # Direct integral
    datInt = np.column_stack((xscale * abdat[0][0][tS:], yscale * abdat[0][1][tS:]))
    # Radon transform
    datRad = np.column_stack((xscale * abdat[1][0][tS:], yscale * abdat[1][1][tS:]))

    if ax is not None:
        if "both" == which or "Int" == which:
            ax.plot(datInt[:, 0], datInt[:, 1], "-", marker=".", ms=5, color=cInt, label=l)
            # ms=5, color=cInt, label=l+'Integral' )
        if "both" == which or "Rad" == which:
            ax.plot(datRad[:, 0], datRad[:, 1], ":", marker=".", ms=5, color=cRad, label=l + "Radon")

    # axHist.hist( datInt[:,1] , bins=10, weights=4*np.pi*np.power(datInt[:,0],2) )

    return datInt, datRad
コード例 #2
0
        cddata = coldens.average_cd( os.getcwd(), shots )
        print "\nSum of cddata = ", np.sum(cddata)
    else: 
 
        coldens.Plot_CD_AZ( figure, gs0[0,0], dirpath=os.getcwd(), \
                            shots=shots, 
                            title='column density', magnif=magnif, \
                            lattice_d=lattice_d,\
                            cutPos='manual', r0=r0, c0=c0, **azdict)     

        cddata = coldens.average_cd( os.getcwd(), shots )
        print "\nSum of cddata = ", np.sum(cddata)

        azdata = coldens.average_azcd( os.getcwd(), shots, trimStart=0)
        r = azdata[0]
        az = azdata[1]
        from scipy import integrate
        print "\nIntegral of azdata = ", 2*np.pi * integrate.simps( az*r, r) 
        
        from inverabel import inverAbelDat 
        abdat = inverAbelDat( azdata[0], azdata[1] )
        r = abdat[0][0] 
        ab = abdat[0][1] 
        print "\nIntegral of abdata = ", 4*np.pi * integrate.simps( ab*(r**2.), r)
     
 
    
    figure.savefig( outfile, dpi=250 )