Commit 526093fe authored by LANORE Vincent's avatar LANORE Vincent
Browse files

Added option to display plot of pair distributions.

parent f46a8534
...@@ -42,7 +42,8 @@ Options: ...@@ -42,7 +42,8 @@ Options:
<prefix>_2.tsv and so on <prefix>_2.tsv and so on
-b, --bins <spec> bin specification in the form of a list of intervals -b, --bins <spec> bin specification in the form of a list of intervals
[default: [0,0.4],[0.4,0.6],[0.6,2]] [default: [0,0.4],[0.4,0.6],[0.6,2]]
-s, --bin-size <size> number of pairs per bin [default: 100]""" -s, --bin-size <size> number of pairs per bin [default: 100]
-p, --plot show plot of pair distributions [default: False]"""
from diffsel_script_utils import * from diffsel_script_utils import *
...@@ -59,6 +60,8 @@ binspec = args["--bins"][0] ...@@ -59,6 +60,8 @@ binspec = args["--bins"][0]
MESSAGE("Bin specification is " + param(binspec)) MESSAGE("Bin specification is " + param(binspec))
binsize = int(args["--bin-size"][0]) binsize = int(args["--bin-size"][0])
MESSAGE("Bin size is " + param(binsize)) MESSAGE("Bin size is " + param(binsize))
showplot = args["--plot"]
MESSAGE("Showing distance histogram is set to " + param(showplot == 1))
#=================================================================================================== #===================================================================================================
STEP("Parsing bin specification") STEP("Parsing bin specification")
...@@ -157,7 +160,8 @@ MESSAGE("Post-treatment of pair bins...") ...@@ -157,7 +160,8 @@ MESSAGE("Post-treatment of pair bins...")
for i in range(nb_bins): for i in range(nb_bins):
pair_bins[i].sort_values(by=["distance"]) pair_bins[i].sort_values(by=["distance"])
pair_bins[i]["distance"].hist(bins = 40) pair_bins[i]["distance"].hist(bins = 40)
plt.show() if showplot:
plt.show()
#=================================================================================================== #===================================================================================================
print(step("Writing result to file")) print(step("Writing result to file"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment