Start to produce graphs for 3D DLA
This commit is contained in:
parent
36e9a1aa93
commit
b970948ba8
File diff suppressed because one or more lines are too long
@ -17,6 +17,17 @@ def read_xy(path: str):
|
||||
return df.replace([np.inf, -np.inf], np.nan).dropna()
|
||||
|
||||
|
||||
def read_xyz(path: str):
|
||||
df = pd.read_csv(path)
|
||||
df['N'] = df.index + 1
|
||||
df['r'] = (df.x ** 2 + df.y ** 2 + df.z ** 2) ** 0.5
|
||||
df['cr'] = df.r.cummax()
|
||||
df['fd'] = np.log(df.N) / np.log(df.cr)
|
||||
df['run'] = os.path.splitext(Path(path).name)[0]
|
||||
|
||||
return df
|
||||
|
||||
|
||||
def read_load(load_dir: str, reader=read_xy):
|
||||
paths = glob(f'{load_dir}/*.csv')
|
||||
return pd.concat([reader(path) for path in paths])
|
||||
|
||||
Loading…
Reference in New Issue
Block a user