Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
readF.py
Go to the documentation of this file.
1import subprocess
2import os
3import pathlib
4import sys
5import numpy as np
6import string, os, math, sys
7
8# Read F File
9def readFfile(folder):
10 F=np.loadtxt(folder +'/F/F_0.txt');
11 F=np.atleast_2d(F)
12 with open(folder +'/F/F_labels.txt') as f:
13 lines = f.readlines()
14 for idx in range(len(lines)):
15 lines[idx] = lines[idx].rstrip()
16 return F,lines
17
18# Get array from F file
19def getFarray(F,Flabels,label):
20 k=0;
21 for line in Flabels:
22 if line==label:
23 return F[:,k]
24 k=k+1
25 raise KeyError('Label "' + label + '" not found in F labels.')
readFfile(folder)
Definition readF.py:9
getFarray(F, Flabels, label)
Definition readF.py:19