Commit 72ee7cf9 authored by Zolnierczuk, Piotr's avatar Zolnierczuk, Piotr
Browse files

q_auto - new python script

parent 643176de
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
commit  92127db2a085f378440653c6a56c5cfc06fc038b (May 21, 2025)

commit 986c0d63d17fea38fa3801fa335f788090cbc8c4
Author: Piotr A. Zolnierczuk <zolnierczukp@ornl.gov>
Date:   Wed Jul 3 15:39:02 2024 -0400
- [PZ] - introduced q_auto Python script, automatic q-binning
- [PZ] - python cleanup
- [PZ] - added missing test files
- [PZ] - added missing_latex.sh to a list of installed scripts
- [PZ] - adding framework for reading nexus files

commit  986c0d63d17fea38fa3801fa335f788090cbc8c4 (Jul 3, 2024)

- [PZ] updated install info
- [PZ] new logger, error_codes, academic exercide to make modules more orthogonal
+7 −3
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ def q_auto_bin(ax, filename, **kwargs):
        bins = q_edges
        ax1.set_xticklabels([])
    else:
        bins = np.linspace(qmin, qmax, bins)
        bins = np.linspace(qmin, qmax, bins+1)

    _, q_edges, _ = ax.hist(q, weights=w, bins=bins, histtype=histtype, **kwargs)

@@ -159,10 +159,14 @@ def main():
    parser.add_argument('--q-min', dest='qmin', type=float)
    parser.add_argument('--q-max', dest='qmax', type=float)
    parser.add_argument('--num-bins', '-n',  dest='nbins', type=int)
    parser.add_argument('--uniform',  '-u',  dest='uniform', action='store_true')
    parser.add_argument('--smooth' ,  '-s',  dest='smooth',  action='store_true')
    parser.add_argument('--uniform',  '-u',  dest='uniform', action='store_true',
                        help='create uniform prob. distribution')
    parser.add_argument('--smooth' ,  '-s',  dest='smooth',  action='store_true',
                        help='"smooth" prob. distribution')

    args = parser.parse_args()
    if args.smooth:
        args.uniform =True

    _ , (ax1, ax2) = plt.subplots(1,2, figsize=(12,6), sharey=True)