Beispiel #1
0
    try:
        qvol = ppu.read_dbin(str(dbin_path/f'{dbin_fname}'), nQ, nTheta)
    except FileNotFoundError:
        print(f'File {dbin_fname} Not Found: Skipping')
        continue


    qvol = qvol**(0.125)
#    qvol[:,:,:] -= qvol[:,:,::-1]
    


    r1r2 = ppu.extract_r1r2(qvol)
#    r1r2 = ppu.convolve_gaussian(r1r2, 1.5,1.5)
    
    ppu.plot_map(r1r2, title=f'{dbin_fname} r1r2',extent=[0,tmax,0,qmax], cmap='viridis', xlabel='Correlation Angle $\\theta$ [degrees]',ylabel='Correlation length $q$ [1/$\AA$]', save=f'{dbin_fname}_r1r2' )



    sumax0 =np.sum(qvol, axis=0)
#    sumax0 = ppu.convolve_gaussian(sumax0, 1.5,1.5)

    ppu.plot_map(sumax0, title=f'{dbin_fname} sumax0',extent=[0,tmax,0,qmax], cmap='viridis', save=f'{dbin_fname}_sumax0')

#
#
#    qsx, qsy = np.meshgrid(q_space,q_space)
#    
#    sumax2 =np.sum(qvol, axis=2)
#    
#    sumax2 = ppu.convolve_gaussian(sumax2, 1,1)
Beispiel #2
0
            tscale, rscale = np.meshgrid(t_space, r_space)
            try:
                rvol = ppu.read_dbin(
                    str(padf_path / f'{padf_fname}_rmax{rmax}_nl{nl}_padf'),
                    nR, nTheta)
            except FileNotFoundError:
                print('File Not Found: Skipping')
                continue

            print(padf_fname, rvol.shape)

            r1r2 = ppu.extract_r1r2(rvol * rscale**2)

            ppu.plot_map(r1r2[:, :180],
                         title=f'{padf_fname} nl {nl} r1r2',
                         extent=[0, tmax, rmax, 0],
                         vmin=0,
                         cmap='gist_stern',
                         save=f'{padf_fname}_rmax{rmax}_nl{nl}_r1r2')

            sumax0 = np.sum(rvol * rscale**2, axis=0)

            ppu.plot_map(sumax0[:, :180],
                         title=f'{padf_fname} nl {nl} sumax0',
                         extent=[0, tmax, rmax, 0],
                         cmap='gist_stern',
                         vmin=0,
                         save=f'{padf_fname}_rmax{rmax}_nl{nl}_sumax0')

            rsx, rsy = np.meshgrid(r_space, r_space)

            sumax2 = np.sum(rvol, axis=2) * (rsx**(1.5)) * (rsy**(1.5))
    r1r2 = r1r2[nrmin:ncropr, :cropt]

    r1r2 = np.clip(r1r2, 0, np.max(r1r2))
    r1r2 = r1r2**(0.5)

    r1r2 = r1r2 - np.min(r1r2)
    r1r2 = r1r2 / np.max(r1r2)

    lps[f'{padf_fname[:4]}'] = []
    for lp_dist in lp_dists:
        lps[f'{padf_fname[:4]}'].append(r1r2[int((lp_dist / rmax) * nrmax), :])

    ppu.plot_map(r1r2,
                 title=f'{padf_fname[:4].upper()} - PADF',
                 extent=[0, cropt, rmin, cropr],
                 cmap='viridis',
                 save=f'{padf_fname[:4]}_r1r2',
                 xlabel='$\\theta$ / $ ^{\circ}$',
                 ylabel='$r_1 = r_2$ / $\\AA$',
                 fig_size=(8, 5.5))

    dists = [6, 2.2]
    cols = ['orange', 'red']
    for col, dist in zip(cols, dists):
        plt.plot(t_space[90:179],
                 (dist / 2) / np.sin(np.radians(180 - t_space[90:179]) / 2),
                 '-.',
                 color=col,
                 label=f'{dist} \u00c5',
                 linewidth=3)
        # plt.plot(t_space, (dist/2)/np.sin(np.radians(180-t_space)/2), color=col)
    l = plt.legend(
Beispiel #4
0
        qvol = ppu.read_dbin(str(dbin_path / f'{dbin_fname}'), nQ, nTheta)
    except FileNotFoundError:
        print(f'File {dbin_fname} Not Found: Skipping')
        continue

    r1r2 = ppu.extract_r1r2(qvol)

    r1r2 = r1r2**(0.25)

    r1r2 = ppu.convolve_gaussian(r1r2, 2, 2)

    r1r2 -= np.min(r1r2)
    r1r2 /= np.max(r1r2)

    ppu.plot_map(r1r2,
                 aspect='auto',
                 title=f'{dbin_fname[:4].upper()} - $q$ Space Correlation',
                 extent=[0, tmax, 0, qmax],
                 xlabel='$\\theta$ / $ ^{\circ}$',
                 fig_size=(8, 5.5),
                 ylabel='$q_1=q_2$ / $\AA^{-1}$',
                 save=f'{dbin_fname[:4]}_q1q2',
                 cmap='viridis')

    #    plt.plot(t_space, 3.5175*t_space**(-1.038291), 'r,')

    plt.xlim(0, 180)
    plt.ylim(0, qmax)

plt.show()
Beispiel #5
0
        tscale, rscale = np.meshgrid(t_space, r_space)
        print(str(padf_path / f'{padf_fname}_{res_name}_padf'), nR, nTheta)
        try:
            rvol = ppu.read_dbin(
                str(padf_path / f'{padf_fname}_{res_name}_padf'), nR, nTheta)
        except FileNotFoundError:
            print('File Not Found: Skipping')
            continue

#        rvol = rvol**(2)

        r1r2 = ppu.extract_r1r2(rvol * rscale**2)

        ppu.plot_map(r1r2[:, :180],
                     title=f'{padf_fname} r1r2 rbins nR{nR}',
                     extent=[0, tmax, 0, rmax],
                     vmin=0,
                     cmap='gist_stern',
                     save=f'{padf_fname}_r1r2_nR{nR}')

        #
        #
        sumax0 = np.sum(rvol * rscale**2, axis=0)

        ppu.plot_map(sumax0[:, :180],
                     title=f'{padf_fname}  sumax0 nR{nR}',
                     extent=[0, tmax, 0, rmax],
                     vmin=0,
                     cmap='gist_stern',
                     save=f'{padf_fname}_sumax0_nR{nR}')
#              extent=[0,tmax,0,rmax], cmap='gist_stern', vmin=0)
#
Beispiel #6
0
##JACK NORMAL
j_data = np.loadtxt('1al1_ex_rcor.dat')
j_data = np.flip(j_data.T, axis=1)
j_data = np.clip(j_data, 0 , np.max(j_data))

t_space = np.linspace(0,180, j_data.shape[1])
r_space = np.linspace(0,20, j_data.shape[0])

rmax = 20
rmin = 2.5
res = j_data.shape[0]/rmax

nrmin = round(rmin*res)


ppu.plot_map(j_data[nrmin:,:], extent=[0,180,rmin,20], vmax=15, xlabel='$\\theta$ / $ ^{\circ}$', ylabel ='$r_1 = r_2$ /$\AA$', cmap='viridis')



arc_dists = [1.7, 2.7, 4.1,6]#, 10]
cols = plt.cm.autumn(np.linspace(0,1, len(arc_dists)))


for col, arc_dist in zip(cols, arc_dists):

    plt.plot(t_space, (arc_dist/2) /np.sin(np.radians(t_space/2)), '--',label=arc_dist, color=col)
    plt.plot(t_space, (arc_dist/2) /np.sin(np.radians((180-t_space)/2)), '--', color=col)

plt.xlim(0,180)
plt.ylim(rmin, 20)
plt.legend()
Beispiel #7
0
    tscale, rscale = np.meshgrid(t_space, r_space)
    rxx, ryy = np.meshgrid(r_space, r_space)


    try:
        rvol = ppu.read_dbin(str(padf_path/f'{padf_fname}'), nrmax, ntheta)
    except FileNotFoundError:
        print(f'File Not Found: {padf_fname}')
        continue

    rvol = rvol[nrmin:ncropr,nrmin:ncropr, :cropt]
    print('rvol', rvol.shape)
    print('rxx', rxx.shape)
    print('ryy', ryy.shape)
    
    
    for theta in theta_lins:

        rrtheta = rvol[:,:,theta]
        rrtheta = np.clip(rrtheta, 0, np.max(rrtheta))
        print(rrtheta.shape)
        rrtheta = rrtheta*(rxx**1)
        rrtheta = rrtheta*(ryy**1)
        ppu.plot_map(rrtheta, extent=[0,cropr,0,cropr],
                     title=f'{padf_fname[:4].upper()} - $\\theta$={theta}$^\circ$',
                     save=f'{padf_fname[:4]}_rrtheta{theta}',cmap='viridis',
                     xlabel='$r$ / $\\AA$', ylabel='$r`$ / $\\AA$')


plt.show()
Beispiel #8
0
        print(f'File Not Found: {padf_fname}')
        continue

    r1r2 = ppu.extract_r1r2(rvol)
    #    r1r2 *= rscale**2
    r1r2 = r1r2[nrmin:ncropr, :cropt]

    r1r2 = np.clip(r1r2, 0, np.max(r1r2))

    r1r2 = r1r2 - np.min(r1r2)
    r1r2 = r1r2 / np.max(r1r2)

    ppu.plot_map(r1r2,
                 title=f'{padf_fname}  r1r2',
                 extent=[0, cropt, rmin, cropr],
                 cmap='viridis',
                 save=f'{padf_fname}_r1r2',
                 xlabel='Correlation Angle $\\theta$ [degrees]',
                 ylabel='Correlation length $r$ [$\\AA$]')

    iso_peaks = [
        16.6, 10.1, 16.2, 15.2, 10.3, 9.8, 10.3, 15.4, 17.3, 20.4, 17.8, 11.7,
        19.0
    ]

    #    colors = plt.cm.jet(np.linspace(0,1,len(theta_lins)))
    #
    #
    #    plt.figure()
    #    plt.title(f'{padf_fname}_r1r2_theta_lin')
    #    print(len(colors), len(theta_lins))
Beispiel #9
0
        tscale, rscale = np.meshgrid(t_space, r_space)
        try:
            rvol = ppu.read_dbin(str(padf_path / f'{padf_fname}{rmax}_padf'),
                                 nR, nTheta)
        except FileNotFoundError:
            print('File Not Found: Skipping')
            continue

        r1r2 = ppu.extract_r1r2(rvol) * rscale**2

        r1r2 = np.clip(r1r2, 0, np.max(r1r2))**(0.125)

        ppu.plot_map(r1r2[:nRs[0] - 1, :180],
                     title=f'{padf_fname}{rmax}  r1r2',
                     extent=[0, tmax, 0, r_space[nRs[0] - 1]],
                     cmap='viridis',
                     save=f'{padf_fname}{rmax}r1r2')

        multi *= r1r2[:nRs[0] - 1, :180]

        ave += r1r2[:nRs[0] - 1, :180] / 3
#
#
#        sumax0 =np.sum(rvol*rscale**2, axis=0)
#
#        ppu.plot_map(sumax0[:,:180], title=f'{padf_fname}  sumax0',
#              extent=[0,tmax,0,rmax], cmap='gist_stern', vmin=0)
#
#
#