Skip to content

Commit

Permalink
update data file format
Browse files Browse the repository at this point in the history
  • Loading branch information
Chao Peng committed Sep 7, 2024
1 parent 5a7dd05 commit 59cf7a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/g4MaterialScan_raw_plot
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bin/g4MaterialScan_to_csv
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 59cf7a5

Please sign in to comment.