Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
python
readF.py
Go to the documentation of this file.
1
import
subprocess
2
import
os
3
import
pathlib
4
import
sys
5
import
numpy
as
np
6
import
string, os, math, sys
7
8
# Read F File
9
def
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
19
def
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.'
)
readF.readFfile
readFfile(folder)
Definition
readF.py:9
readF.getFarray
getFarray(F, Flabels, label)
Definition
readF.py:19
Generated by
1.15.0