コード例 #1
0
ファイル: background.py プロジェクト: matthewjpeel/edxrd
        w[1,:] = z.max(0)
        w[0,:] = w.min(0)
    return w[0,:]
    
if __name__ == '__main__':
    import matplotlib.pyplot as plt
    import matplotlib.animation as animation

    fig,axs = plt.subplots(1,1,sharex=True,sharey=True)
    ax1 = axs
    #ax1.set_yscale('log')
    #ax1.set_yscale('linear')
    
    if 1:
        from edxrd.test import get_test_data
        x,y = get_test_data.getedxdata()['Austenite']
    
    else:
        from edxrd.peakfitting import fpeak  
        
        x = np.arange(4000)
        y = np.zeros_like(x)  
        vals = [(1000,15.3,1200,0.25),
                (1300,15.5,12000,0.25),
                (1700,15.8,22000,0.25),
                (1750,16.3,32000,0.25),
                (1800,17.3,22000,0.25),
                (2300,18.3,11000,0.25),
                (2600,70.3,8000,0.25),
                (3200,22.3,6000,0.25),
                (3700,25.3,4000,0.25),
コード例 #2
0
ファイル: makefigs.py プロジェクト: matthewjpeel/edxrd
        
    for label in ax1.get_yticklabels():
        label.set_fontsize(11)
    
    for ax in [ax1,ax2]:
        for s in ax.spines.values():
            s.set_linewidth(1)
        for line in ax.xaxis.get_ticklines()+ax.yaxis.get_ticklines():
            line.set_markeredgewidth(1)
        ax.minorticks_off()

    f.savefig('wavelet_peaksearch.png',dpi=100)
    
if 1:
    from edxrd.test import get_test_data
    edxdata = get_test_data.getedxdata()
    x,y = edxdata['LaB6']   
    x=np.poly1d([1e-9, 0.001942,0.005])(x)         
    unit_cell = [4.15695,4.15695,4.15695,90,90,90]
    space_group = 'pm-3m'      
    
    from edxrd.peaksearch import from_unitcell
    pks = from_unitcell(x,y,unit_cell,space_group,2,4.4,
                                            name='LaB6',shape='g')
    print pks[0].centre
    yfit = np.zeros_like(x)
    for pk in pks:
        yfit+=pk.profile(x)
        
    f,ax = plt.subplots(1,1,figsize=(7,4))
    f.subplots_adjust(bottom=0.15)