Start to produce graphs for 3D DLA

This commit is contained in:
Joshua Coles 2023-03-17 16:00:31 +00:00
parent 36e9a1aa93
commit b970948ba8
2 changed files with 183 additions and 546 deletions

File diff suppressed because one or more lines are too long

View File

@ -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])