aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-06-20 15:58:54 +0200
committerThomas White <taw@physics.org>2019-06-21 15:37:04 +0200
commit30a677f1a5c177b56b4d171af0e133445f36900b (patch)
tree464882d22fa1486acecce9d3f44283b9b7b6805d /scripts
parent24be95399829dc0f6d46189caf6e4a015fe27c3c (diff)
scripts/plot-pr-contourmap: Allow the use of folder names other than "pr-logs"
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/plot-pr-contourmap11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/plot-pr-contourmap b/scripts/plot-pr-contourmap
index 8b8e60c3..39fedc97 100755
--- a/scripts/plot-pr-contourmap
+++ b/scripts/plot-pr-contourmap
@@ -44,7 +44,7 @@ def update_graph():
global im, cnt, centre_marker
- filename="pr-logs/grid-crystal%i-cycle%s-%s.dat" % (crystal,cycle,varpair)
+ filename="%s/grid-crystal%i-cycle%s-%s.dat" % (folder,crystal,cycle,varpair)
print filename
with open(filename, "r") as f:
@@ -99,11 +99,18 @@ def update_graph():
fig = plt.figure(figsize=(10,5))
fig.subplots_adjust(left=0.05, bottom=0.05, right=0.70, top=0.95)
+if len(sys.argv) == 2:
+ folder = sys.argv[1]
+else:
+ folder = "pr-logs"
+
+print("Using folder '%s'" % folder)
+
# Find out what there is to plot
crystals = []
cycles = []
varpairs = []
-for file in os.listdir("pr-logs"):
+for file in os.listdir(folder):
if not fnmatch.fnmatch(file, "grid-*.dat"):
continue
sp = file.rstrip(".dat").split("-")