From fe967172d06c86f529a2ee980d3e4ea8de9c3953 Mon Sep 17 00:00:00 2001 From: Takahiro OHKUBO Date: Mon, 29 Jun 2026 11:48:50 +0900 Subject: [PATCH] =?UTF-8?q?dump2rotorang.py=E3=82=92argpase=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dump2rotorang.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/dump2rotorang.py b/dump2rotorang.py index eaa7667..c4b65c9 100755 --- a/dump2rotorang.py +++ b/dump2rotorang.py @@ -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.")