dump2rotorang.pyをargpase対応にした

This commit is contained in:
2026-06-29 11:48:50 +09:00
parent 2c740bbb43
commit fe967172d0
+15 -10
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env python
import argparse
import numpy as np
import io
import re
@@ -86,13 +87,17 @@ def run(trjfile):
dset[temp]["orientation"] = df
for k in ["D3d-o", "D3d-p"]:
dset = {}
files = sorted(glob.glob(f"{k}_*K.lammpstrj"))
for f in files:
print(f)
run(f)
outfile = f"{k}.pkl"
with open(outfile, "wb") as f:
pickle.dump(dset, f)
print(f"{outfile} was created.")
par = argparse.ArgumentParser(description="test")
par.add_argument('-f', '--files')
args = par.parse_args()
# for k in ["D3d-o", "D3d-p"]:
# dset = {}
# files = sorted(glob.glob(f"{k}_*K.lammpstrj"))
# for f in files:
# print(f)
# run(f)
# outfile = f"{k}.pkl"
# with open(outfile, "wb") as f:
# pickle.dump(dset, f)
# print(f"{outfile} was created.")