From 59cf7a5c00124e19408be2085605013b267348c2 Mon Sep 17 00:00:00 2001 From: Chao Peng Date: Fri, 6 Sep 2024 21:54:27 -0500 Subject: [PATCH] update data file format --- bin/g4MaterialScan_raw_plot | 4 ++-- bin/g4MaterialScan_to_csv | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/g4MaterialScan_raw_plot b/bin/g4MaterialScan_raw_plot index 1352ce04a..3b2cf3075 100755 --- a/bin/g4MaterialScan_raw_plot +++ b/bin/g4MaterialScan_raw_plot @@ -18,7 +18,7 @@ from matplotlib.ticker import AutoMinorLocator if __name__ == '__main__': parser = argparse.ArgumentParser( prog='g4MaterialScan_raw_plot', - description = 'A python script to draw material thicknesses from raw output of g4MaterialScan_to_csv.' + description = 'A python script to draw material thickness from raw output of g4MaterialScan_to_csv.' ) parser.add_argument( 'data_path', @@ -79,7 +79,7 @@ if __name__ == '__main__': ax2.step(df['path_length'], df['lambda_cum'], color=colors[1], ls='--') - ax.text(0.05, 0.95, r'$\eta={:g}, \phi={:g}^{{\circ}}$'.format(eta, phi), + ax.text(0.05, 0.95, r'$\eta={:.3f}, \phi={:.3f}^{{\circ}}$'.format(eta, phi), fontsize=fs, color=colors[2], horizontalalignment='left', verticalalignment='top', transform=ax.transAxes) # axis format diff --git a/bin/g4MaterialScan_to_csv b/bin/g4MaterialScan_to_csv index abd4ab9ef..fa05c363b 100755 --- a/bin/g4MaterialScan_to_csv +++ b/bin/g4MaterialScan_to_csv @@ -222,7 +222,7 @@ if __name__ == '__main__': dfa.loc[:, vt] = dfa['int_{}'.format(vt)].diff(1).fillna(dfa['int_{}'.format(vt)]) if args.raw_output: - dfa.to_csv('scan_raw_eta={:g}_phi={:g}.csv'.format(eta, phi), sep=args.sep, float_format='%g') + dfa.to_csv('scan_raw_eta={:.3f}_phi={:.3f}.csv'.format(eta, phi), sep=args.sep, float_format='%g') # group by materials single_scan = dfa.groupby('material')[value_types].sum() # print(single_scan)