예제 #1
0
log_yld=[]
out_yld=[]
cur_dir=[] # Arrary of the directory locations of each *.out file 
tcount=[]
shift = -0.031

for root, dirs, files in os.walk("."):
    dirs[:]=[d for d in dirs if d in targets]
    lcount=0
    for filename in [f for f in files if f.endswith(".out")]:
        fn = os.path.join(root, filename)
        #print fn
        # Create 'output' file containing sputtering data for each meteorite class.
        # The energy, fluence step, nElem x yld, and tot_yld arrays are given for
        # nIncident ions.
        out_yld.append(SDTrimSP_readSput.read_outfile(fn))
        lcount+=1
    if lcount>0:
        # Label should contain the names of the meteorite classes, e.g. "Mars
        for l in range(lcount):
            cur_dir.append(root)
            tcount.append(lcount)

    for filename in [f for f in files if f.endswith(".log")]:
        fn = os.path.join(root, filename)
        #print fn
        # Create independent 'log' files for each simulation file 
        # containing meta data (specific meteorite + ion combination) 
        log_yld.append(SDTrimSP_readSput.read_logfile(fn)) 

print cur_dir
예제 #2
0
    log_yld = []
    sput_yld = []
    esput = []
    trfile = []
    n_eng = 0

    path = askdirectory()
    logfiles = path + "/*.log"
    datfiles = path + "/*.dat"

    path_name = find_between(path, 'data')
    #print path_name
    # first read log data files to get full simulation description
    for filename in glob.glob(logfiles):
        #print 'The file is {0}'.format(filename)
        log_yld.append(SDTrimSP_readSput.read_logfile(filename))
        if log_yld[n_eng].label[4] in tarlist:
            continue
        else:
            tarlist.append(log_yld[n_eng].label[4])
        n_eng += 1
    print tarlist

    # Call read functions for each data file type
    for filename in glob.glob(datfiles):
        if 'E0_31' in filename:
            continue
        # File with variation in elemental concentration vs. timestep(+?)
        elif 'E0_33' in filename:
            # File with variation in elemetal sputter yield vs. timestep
            #print filename
예제 #3
0
log_yld = []
out_yld = []
cur_dir = []  # Arrary of the directory locations of each *.out file
tcount = []
shift = -0.031

for root, dirs, files in os.walk("."):
    dirs[:] = [d for d in dirs if d in targets]
    lcount = 0
    for filename in [f for f in files if f.endswith(".out")]:
        fn = os.path.join(root, filename)
        #print fn
        # Create 'output' file containing sputtering data for each meteorite class.
        # The energy, fluence step, nElem x yld, and tot_yld arrays are given for
        # nIncident ions.
        out_yld.append(SDTrimSP_readSput.read_outfile(fn))
        lcount += 1
    if lcount > 0:
        # Label should contain the names of the meteorite classes, e.g. "Mars
        for l in range(lcount):
            cur_dir.append(root)
            tcount.append(lcount)

    for filename in [f for f in files if f.endswith(".log")]:
        fn = os.path.join(root, filename)
        #print fn
        # Create independent 'log' files for each simulation file
        # containing meta data (specific meteorite + ion combination)
        log_yld.append(SDTrimSP_readSput.read_logfile(fn))

print cur_dir
예제 #4
0
    log_yld=[]
    sput_yld=[]
    esput=[]
    trfile=[]
    n_eng=0
 
    path = askdirectory() 
    logfiles = path+"/*.log"
    datfiles = path+"/*.dat"

    path_name=find_between(path, 'data')
    #print path_name
    # first read log data files to get full simulation description
    for filename in glob.glob(logfiles):
        #print 'The file is {0}'.format(filename)
        log_yld.append(SDTrimSP_readSput.read_logfile(filename))
        if log_yld[n_eng].label[4] in tarlist:
            continue
        else:
            tarlist.append(log_yld[n_eng].label[4])
        n_eng+=1
    print tarlist
    
# Call read functions for each data file type 
    for filename in glob.glob(datfiles):
        if 'E0_31'in filename:
            continue
           # File with variation in elemental concentration vs. timestep(+?)
        elif 'E0_33' in filename:
            # File with variation in elemetal sputter yield vs. timestep
            #print filename
예제 #5
0
cont = 1
nr=1

# Specify whether or not to include experimental and SRIM results
# 1 == yes; 0 == no
incl_expt=0
incl_srim=0

# ----- Import and plot experimental data -----
if incl_expt==1:
    #print "Please identify the experimental data file."
    # show an "Open" dialog box and return the path to the selected file
    #root.withdraw() 
    #efn = askopenfilename()
    efn='ExpData.csv'
    expt_yld=SDTrimSP_readSput.read_exptfile(efn)
    ion_target_pairs=list(set(expt_yld.label[0]))
    target= list(set(expt_yld.label[2]))
    plot_expt = SDTrimSP_plotSput.plot_sputExpt(expt_yld, genClass)

# ----- Import and plot SRIM data -----
if incl_srim==1:
    srim_yld=[]
    srimfn=[]
    srimfiles = "./SRIM/*.srim"
    for filename in glob.glob(srimfiles):
        if 'Thiel' not in filename:
            srimfn.append(filename)
            #print filename
            srim_yld.append(SDTrimSP_readSput.read_exptfile(filename))
            met_class='srim'
예제 #6
0
cont = 1
nr = 1

# Specify whether or not to include experimental and SRIM results
# 1 == yes; 0 == no
incl_expt = 0
incl_srim = 0

# ----- Import and plot experimental data -----
if incl_expt == 1:
    #print "Please identify the experimental data file."
    # show an "Open" dialog box and return the path to the selected file
    #root.withdraw()
    #efn = askopenfilename()
    efn = 'ExpData.csv'
    expt_yld = SDTrimSP_readSput.read_exptfile(efn)
    ion_target_pairs = list(set(expt_yld.label[0]))
    target = list(set(expt_yld.label[2]))
    plot_expt = SDTrimSP_plotSput.plot_sputExpt(expt_yld, genClass)

# ----- Import and plot SRIM data -----
if incl_srim == 1:
    srim_yld = []
    srimfn = []
    srimfiles = "./SRIM/*.srim"
    for filename in glob.glob(srimfiles):
        if 'Thiel' not in filename:
            srimfn.append(filename)
            #print filename
            srim_yld.append(SDTrimSP_readSput.read_exptfile(filename))
            met_class = 'srim'