def main():

    # --- Set up all options --------------------------------------------------

    # determine normalization factor for NormAn winding.
    S = 20.0
    Ly = 12.0
    normFactor = 4.0 * (S + Ly) ** 2

    # some plotting color and label options
    colors = ["Salmon", "MediumSpringGreen", "DarkViolet", "Fuchsia", "Blue", "Maroon"]

    RandomColors = False
    if RandomColors:
        random.shuffle(colors)

    # get names of all subdirectories az_XXX.
    direcs = glob.glob("az_*")

    # build array of Lz values for plotting Lz vs winding.
    azValues = pl.array([])

    # build array of norman winding values along with bins, for Lz plotting.
    windingAverages = pl.array([])
    windingErrors = pl.array([])
    filmAverages = pl.array([])
    filmErrors = pl.array([])
    bulkAverages = pl.array([])
    bulkErrors = pl.array([])

    # --- loop over and collect/analyze all data from files -------------------
    for nd, d in enumerate(sorted(direcs)):

        os.chdir("./" + d)

        print d[3:]
        azValues = pl.append(azValues, float(d[3:]))

        # --- angular winding ---
        f = glob.glob("*AveragedNtwind*")[0]

        aCol = 3
        sCol = 4
        bCol = 5

        avg, stdErr = cT.crunchZfile(f, aCol, sCol, bCol, normFactor)
        print avg
        windingAverages = pl.append(windingAverages, avg)
        windingErrors = pl.append(windingErrors, stdErr)

        # --- film densities ---
        f = glob.glob("*AveragedBipart*")[0]
        aCol = 0
        sCol = 1
        bCol = 2

        avg, stdErr = cT.crunchZfile(f, aCol, sCol, bCol, 1.0)

        filmAverages = pl.append(filmAverages, avg)
        filmErrors = pl.append(filmErrors, stdErr)

        # --- bulk densities ---
        aCol = 3
        sCol = 4
        bCol = 5

        avg, stdErr = cT.crunchZfile(f, aCol, sCol, bCol, normFactor)

        bulkAverages = pl.append(bulkAverages, avg)
        bulkErrors = pl.append(bulkErrors, stdErr)

        os.chdir("..")

    invaz = 1.0 / azValues
    figg = pl.figure(1)
    ax = figg.add_subplot(111)
    pl.errorbar(invaz, windingAverages, windingErrors, fmt="o", color="Indigo")
    pl.xlabel(r"$1/a_z\ [\si{\angstrom}^{-1}]$", fontsize=20)
    pl.ylabel(r"$\langle \Omega \rangle$", fontsize=26)
    pl.grid(True)
    pl.tick_params(axis="both", which="major", labelsize=16)
    pl.tick_params(axis="both", which="minor", labelsize=16)
    xticks = ax.xaxis.get_major_ticks()
    xticks[0].set_visible(False)
    pl.tight_layout()

    pl.savefig("Omega_vs_inverseLZ_S20.pdf", format="pdf", bbox_inches="tight")

    figg = pl.figure(2)
    ax = figg.add_subplot(111)
    pl.errorbar(invaz, filmAverages, filmErrors, fmt="o")
    pl.xlabel(r"$1/L_z\ [\si{\angstrom}^{-1}]$", fontsize=20)
    pl.ylabel(r"$ \rho_{\text{film}} $", fontsize=26)
    pl.grid(True)
    pl.tick_params(axis="both", which="major", labelsize=16)
    pl.tick_params(axis="both", which="minor", labelsize=16)
    xticks = ax.xaxis.get_major_ticks()
    xticks[0].set_visible(False)
    pl.tight_layout()

    pl.show()
def main():

    omega = True
    energy = False
    superFrac = True

    # --- Set up all options --------------------------------------------------

    Ly = 12.0

    # parse command line, getting algorithmic and plotting options.
    args = jk.parseCMD()
    reduceType = args.reduceType
    direc = args.fileNames[0]

    nCol = args.nCol
    nEst = args.nEst

    # some plotting color and label options
    xLab = jk.getXlabel(reduceType)
    extent = args.bulkSeparation
    colors = [
        'Salmon', 'MediumSpringGreen', 'DarkViolet', 'Fuchsia', 'Blue',
        'Maroon'
    ]

    if args.RandomColors:
        random.shuffle(colors)

    # set up figure that displays all data
    figg = pl.figure(1)
    ax = figg.add_subplot(111)
    pl.xlabel(r'$T\ [K]$', fontsize=20)
    pl.ylabel(r'$\langle \Omega \rangle$', fontsize=20)
    pl.grid(True)
    pl.xlim([0.4, 2.6])
    pl.tick_params(axis='both', which='major', labelsize=16)
    pl.tick_params(axis='both', which='minor', labelsize=16)
    yticks = ax.yaxis.get_major_ticks()
    yticks[0].set_visible(False)

    figg2 = pl.figure(2)
    ax = figg2.add_subplot(111)
    pl.ylabel(r'$ \rho_s/\rho $', fontsize=20)
    pl.xlabel(r'$T\ [K]$', fontsize=20)
    pl.grid(True)
    pl.xlim([0.4, 2.6])
    pl.tick_params(axis='both', which='major', labelsize=16)
    pl.tick_params(axis='both', which='minor', labelsize=16)
    yticks = ax.yaxis.get_major_ticks()
    yticks[0].set_visible(False)

    figg3 = pl.figure(3)
    ax = figg3.add_subplot(111)
    pl.ylabel(r'$ \rho_{\text{film}}\ [\si{\angstrom}^{-2}] $', fontsize=20)
    pl.xlabel(r'$T\ [K]$', fontsize=20)
    pl.grid(True)
    pl.xlim([0.4, 2.6])
    pl.tick_params(axis='both', which='major', labelsize=16)
    pl.tick_params(axis='both', which='minor', labelsize=16)
    yticks = ax.yaxis.get_major_ticks()
    yticks[0].set_visible(False)

    figg4 = pl.figure(4)
    ax = figg4.add_subplot(111)
    pl.ylabel(r'$\langle \rho_{\text{bulk}} \rangle$', fontsize=20)
    pl.xlabel(r'$T\ [K]$', fontsize=20)
    pl.grid(True)
    pl.xlim([0.4, 2.6])
    pl.tick_params(axis='both', which='major', labelsize=16)
    pl.tick_params(axis='both', which='minor', labelsize=16)
    yticks = ax.yaxis.get_major_ticks()
    yticks[0].set_visible(False)

    # --- loop over all values of S -------------------------------------------
    os.chdir(direc)
    Svals = glob.glob('S*')
    Svals = natsort.natsorted(Svals)
    print Svals

    for nS, Sval in enumerate(Svals):

        os.chdir(Sval)

        # store bulk separation value
        S = re.search(r'\d+', Sval).group(0)

        print S

        # set normalization
        if omega:
            normFactor = 4.0 * (float(S) + Ly)**2
        else:
            normFactor = 1.0

        print normFactor

        # set label for plot
        #if 'distinguishable' in Sval:
        if 'noSwaps' in Sval:
            labell = 'S = ' + str(
                S) + ' ' + r'$\si{\angstrom}$' ', Boltzmannons'
        else:
            labell = 'S = ' + str(S) + ' ' + r'$\si{\angstrom}$' + ', Bosons'

        # get all temperature directory names
        Tdirs = sorted(glob.glob('T*'))

        # build array of norman winding values along with bins, for Lz plotting.
        windingAverages = pl.array([])
        windingErrors = pl.array([])
        filmAverages = pl.array([])
        filmErrors = pl.array([])
        bulkAverages = pl.array([])
        bulkErrors = pl.array([])
        superAverages = pl.array([])
        superErrors = pl.array([])

        Ts = pl.array([])
        #Omegas = pl.array([])
        #Errs = pl.array([])
        #Films = pl.array([])
        #Ferrs = pl.array([])
        #Bulks = pl.array([])
        #Berrs = pl.array([])
        #Supers = pl.array([])
        #Serrs = pl.array([])

        # --- loop over all temperature values --------------------------------
        for Tdir in Tdirs:

            os.chdir(Tdir)

            # build array of temperatures
            Ts = pl.append(Ts, float(Tdir[1:]))

            # --- angular winding ---
            f = glob.glob('*zAveragedNtwind*')[0]

            aCol = 3
            sCol = 4
            bCol = 5

            avg, stdErr = cT.crunchZfile(f, aCol, sCol, bCol, normFactor)
            windingAverages = pl.append(windingAverages, avg)
            windingErrors = pl.append(windingErrors, stdErr)

            # --- film densities ---
            f = glob.glob('*zAveragedBipart*')[0]
            aCol = 0
            sCol = 1
            bCol = 2

            avg, stdErr = cT.crunchZfile(f, aCol, sCol, bCol, 1.0)

            filmAverages = pl.append(filmAverages, avg)
            filmErrors = pl.append(filmErrors, stdErr)

            # --- bulk densities ---
            aCol = 3
            sCol = 4
            bCol = 5

            avg, stdErr = cT.crunchZfile(f, aCol, sCol, bCol, 1.0)

            bulkAverages = pl.append(bulkAverages, avg)
            bulkErrors = pl.append(bulkErrors, stdErr)

            # --- superfluid fractions ---
            f = glob.glob('*zAveragedSuper*')[0]
            aCol = 0
            sCol = 1
            bCol = 2

            avg, stdErr = cT.crunchZfile(f, aCol, sCol, bCol, 1.0)

            superAverages = pl.append(superAverages, avg)
            superErrors = pl.append(superErrors, stdErr)

            # ----------------------
            os.chdir('..')

        # add data to plot for given S value.
        pl.figure(1)
        pl.errorbar(Ts,
                    windingAverages,
                    windingErrors,
                    fmt='-o',
                    color=colors[nS],
                    label=labell)

        pl.figure(2)
        pl.errorbar(Ts,
                    superAverages,
                    superErrors,
                    fmt='-o',
                    color=colors[nS],
                    label=labell)

        pl.figure(3)
        pl.errorbar(Ts,
                    filmAverages,
                    filmErrors,
                    fmt='-o',
                    color=colors[nS],
                    label=labell)

        pl.figure(4)
        pl.errorbar(Ts,
                    bulkAverages,
                    bulkErrors,
                    fmt='-o',
                    color=colors[nS],
                    label=labell)

        os.chdir('..')

    pl.figure(1)
    pl.legend()

    pl.savefig('Omega_vs_T_allS.pdf', format='pdf', bbox_inches='tight')

    pl.figure(2)
    pl.legend()

    #pl.savefig('SuperFrac_vs_T_allS.pdf', format='pdf',
    #        bbox_inches='tight')

    pl.figure(3)
    pl.legend()

    pl.savefig('FilmDensities_vs_T_allS.pdf',
               format='pdf',
               bbox_inches='tight')

    pl.figure(4)
    pl.legend()

    pl.show()
示例#3
0
def main():

    # --- Set up all options --------------------------------------------------

    # determine normalization factor for NormAn winding.
    S = 20.0
    Ly = 12.0
    normFactor = 4.0 * (S + Ly)**2

    # some plotting color and label options
    colors = [
        'Salmon', 'MediumSpringGreen', 'DarkViolet', 'Fuchsia', 'Blue',
        'Maroon'
    ]

    RandomColors = False
    if RandomColors:
        random.shuffle(colors)

    # get names of all subdirectories az_XXX.
    direcs = glob.glob('az_*')

    # build array of Lz values for plotting Lz vs winding.
    azValues = pl.array([])

    # build array of norman winding values along with bins, for Lz plotting.
    windingAverages = pl.array([])
    windingErrors = pl.array([])
    filmAverages = pl.array([])
    filmErrors = pl.array([])
    bulkAverages = pl.array([])
    bulkErrors = pl.array([])

    # --- loop over and collect/analyze all data from files -------------------
    for nd, d in enumerate(sorted(direcs)):

        os.chdir('./' + d)

        print d[3:]
        azValues = pl.append(azValues, float(d[3:]))

        # --- angular winding ---
        f = glob.glob('*AveragedNtwind*')[0]

        aCol = 3
        sCol = 4
        bCol = 5

        avg, stdErr = cT.crunchZfile(f, aCol, sCol, bCol, normFactor)
        print avg
        windingAverages = pl.append(windingAverages, avg)
        windingErrors = pl.append(windingErrors, stdErr)

        # --- film densities ---
        f = glob.glob('*AveragedBipart*')[0]
        aCol = 0
        sCol = 1
        bCol = 2

        avg, stdErr = cT.crunchZfile(f, aCol, sCol, bCol, 1.0)

        filmAverages = pl.append(filmAverages, avg)
        filmErrors = pl.append(filmErrors, stdErr)

        # --- bulk densities ---
        aCol = 3
        sCol = 4
        bCol = 5

        avg, stdErr = cT.crunchZfile(f, aCol, sCol, bCol, normFactor)

        bulkAverages = pl.append(bulkAverages, avg)
        bulkErrors = pl.append(bulkErrors, stdErr)

        os.chdir('..')

    invaz = 1.0 / azValues
    figg = pl.figure(1)
    ax = figg.add_subplot(111)
    pl.errorbar(invaz, windingAverages, windingErrors, fmt='o', color='Indigo')
    pl.xlabel(r'$1/a_z\ [\si{\angstrom}^{-1}]$', fontsize=20)
    pl.ylabel(r'$\langle \Omega \rangle$', fontsize=26)
    pl.grid(True)
    pl.tick_params(axis='both', which='major', labelsize=16)
    pl.tick_params(axis='both', which='minor', labelsize=16)
    xticks = ax.xaxis.get_major_ticks()
    xticks[0].set_visible(False)
    pl.tight_layout()

    pl.savefig('Omega_vs_inverseLZ_S20.pdf', format='pdf', bbox_inches='tight')

    figg = pl.figure(2)
    ax = figg.add_subplot(111)
    pl.errorbar(invaz, filmAverages, filmErrors, fmt='o')
    pl.xlabel(r'$1/L_z\ [\si{\angstrom}^{-1}]$', fontsize=20)
    pl.ylabel(r'$ \rho_{\text{film}} $', fontsize=26)
    pl.grid(True)
    pl.tick_params(axis='both', which='major', labelsize=16)
    pl.tick_params(axis='both', which='minor', labelsize=16)
    xticks = ax.xaxis.get_major_ticks()
    xticks[0].set_visible(False)
    pl.tight_layout()

    pl.show()
def main():

    omega = True
    energy = False
    superFrac = True

    # --- Set up all options --------------------------------------------------
    
    Ly = 12.0

    # parse command line, getting algorithmic and plotting options.
    args = jk.parseCMD()
    reduceType = args.reduceType
    direc = args.fileNames[0]

    nCol = args.nCol
    nEst = args.nEst

    # some plotting color and label options
    xLab = jk.getXlabel(reduceType)
    extent = args.bulkSeparation
    colors = ['Salmon','MediumSpringGreen','DarkViolet','Fuchsia','Blue',
            'Maroon']

    if args.RandomColors:
        random.shuffle(colors)
 
    # set up figure that displays all data
    figg = pl.figure(1)
    ax = figg.add_subplot(111)
    pl.xlabel(r'$T\ [K]$', fontsize=20)
    pl.ylabel(r'$\langle \Omega \rangle$', fontsize=20)
    pl.grid(True)
    pl.xlim([0.4,2.6])
    pl.tick_params(axis='both', which='major', labelsize=16)
    pl.tick_params(axis='both', which='minor', labelsize=16)
    yticks = ax.yaxis.get_major_ticks()
    yticks[0].set_visible(False)

    figg2 = pl.figure(2)
    ax = figg2.add_subplot(111)
    pl.ylabel(r'$ \rho_s/\rho $', fontsize=20)
    pl.xlabel(r'$T\ [K]$', fontsize=20)
    pl.grid(True)
    pl.xlim([0.4,2.6])
    pl.tick_params(axis='both', which='major', labelsize=16)
    pl.tick_params(axis='both', which='minor', labelsize=16)
    yticks = ax.yaxis.get_major_ticks()
    yticks[0].set_visible(False)

 
    figg3 = pl.figure(3)
    ax = figg3.add_subplot(111)
    pl.ylabel(r'$ \rho_{\text{film}}\ [\si{\angstrom}^{-2}] $', fontsize=20)
    pl.xlabel(r'$T\ [K]$', fontsize=20)
    pl.grid(True)
    pl.xlim([0.4,2.6])
    pl.tick_params(axis='both', which='major', labelsize=16)
    pl.tick_params(axis='both', which='minor', labelsize=16)
    yticks = ax.yaxis.get_major_ticks()
    yticks[0].set_visible(False)

 
    figg4 = pl.figure(4)
    ax = figg4.add_subplot(111)
    pl.ylabel(r'$\langle \rho_{\text{bulk}} \rangle$', fontsize=20)
    pl.xlabel(r'$T\ [K]$', fontsize=20)
    pl.grid(True)
    pl.xlim([0.4,2.6])
    pl.tick_params(axis='both', which='major', labelsize=16)
    pl.tick_params(axis='both', which='minor', labelsize=16)
    yticks = ax.yaxis.get_major_ticks()
    yticks[0].set_visible(False)

  
    
    # --- loop over all values of S -------------------------------------------
    os.chdir(direc)
    Svals = glob.glob('S*')
    Svals = natsort.natsorted(Svals)
    print Svals

    for nS, Sval in enumerate(Svals):
        
        os.chdir(Sval)

        # store bulk separation value
        S = re.search(r'\d+',Sval).group(0)

        print S

        # set normalization
        if omega:
            normFactor = 4.0*(float(S)+Ly)**2
        else:
            normFactor = 1.0

        print normFactor

        # set label for plot
        #if 'distinguishable' in Sval:
        if 'noSwaps' in Sval:
            labell = 'S = '+str(S)+' '+r'$\si{\angstrom}$'', Boltzmannons'
        else:
            labell = 'S = '+str(S)+' '+r'$\si{\angstrom}$'+', Bosons'

        # get all temperature directory names
        Tdirs = sorted(glob.glob('T*'))

        # build array of norman winding values along with bins, for Lz plotting.
        windingAverages = pl.array([])
        windingErrors = pl.array([])
        filmAverages = pl.array([])
        filmErrors = pl.array([])
        bulkAverages = pl.array([])
        bulkErrors = pl.array([])
        superAverages = pl.array([])
        superErrors = pl.array([])

        Ts = pl.array([])
        #Omegas = pl.array([])
        #Errs = pl.array([])
        #Films = pl.array([])
        #Ferrs = pl.array([])
        #Bulks = pl.array([])
        #Berrs = pl.array([])
        #Supers = pl.array([])
        #Serrs = pl.array([])

        # --- loop over all temperature values --------------------------------
        for Tdir in Tdirs:
            
            os.chdir(Tdir)
            
            # build array of temperatures
            Ts = pl.append(Ts, float(Tdir[1:]))
            
            # --- angular winding ---
            f = glob.glob('*zAveragedNtwind*')[0]
            
            aCol = 3
            sCol = 4
            bCol = 5
            
            avg,stdErr = cT.crunchZfile(f,aCol,sCol,bCol,normFactor)
            windingAverages = pl.append(windingAverages, avg)
            windingErrors = pl.append(windingErrors, stdErr)
            
            # --- film densities ---
            f = glob.glob('*zAveragedBipart*')[0]
            aCol = 0
            sCol = 1
            bCol = 2

            avg,stdErr = cT.crunchZfile(f,aCol,sCol,bCol,1.0)

            filmAverages = pl.append(filmAverages, avg)
            filmErrors = pl.append(filmErrors,stdErr)

            # --- bulk densities ---
            aCol = 3
            sCol = 4
            bCol = 5

            avg,stdErr = cT.crunchZfile(f,aCol,sCol,bCol,1.0)

            bulkAverages = pl.append(bulkAverages,avg)
            bulkErrors = pl.append(bulkErrors, stdErr)

            # --- superfluid fractions ---
            f = glob.glob('*zAveragedSuper*')[0]
            aCol = 0
            sCol = 1
            bCol = 2

            avg,stdErr = cT.crunchZfile(f,aCol,sCol,bCol,1.0)

            superAverages = pl.append(superAverages,avg)
            superErrors = pl.append(superErrors, stdErr)

            # ----------------------
            os.chdir('..')
       

        # add data to plot for given S value.
        pl.figure(1)
        pl.errorbar(Ts, windingAverages, windingErrors, fmt='-o', color=colors[nS], 
                label=labell)
        
        pl.figure(2)
        pl.errorbar(Ts, superAverages, superErrors, fmt='-o', color=colors[nS], 
                label=labell)
        
        pl.figure(3)
        pl.errorbar(Ts, filmAverages, filmErrors, fmt='-o', color=colors[nS], 
                label=labell)
        
        pl.figure(4)
        pl.errorbar(Ts, bulkAverages, bulkErrors, fmt='-o', color=colors[nS], 
                label=labell)

        os.chdir('..')
       
    pl.figure(1)
    pl.legend()

    pl.savefig('Omega_vs_T_allS.pdf', format='pdf',
            bbox_inches='tight')
    
    pl.figure(2)
    pl.legend()
    
    #pl.savefig('SuperFrac_vs_T_allS.pdf', format='pdf',
    #        bbox_inches='tight')
   
    pl.figure(3)
    pl.legend()
     
    pl.savefig('FilmDensities_vs_T_allS.pdf', format='pdf',
            bbox_inches='tight')
   

    pl.figure(4)
    pl.legend()
    
    pl.show()