43parser = argparse.ArgumentParser(description=
"Simulation of toy data for training of SVD hit time esitmator")
51 help=
'Size of the sample to generate'
59 help=
'Lower bound of t0 distribution, ns')
66 help=
'Upper bound of t0 distribution, ns')
73 help=
'Lower bound of tau distribution, ns')
80 help=
'Upper bound of tau distribution, ns')
87 help=
'RMS of tau jitter, 0 - no jitter, ns')
94 help=
'Lower bound of amplitude distribution, S/N units')
101 help=
'Upper bound of amplitude distribution, S/N units')
108 help=
'Lower bound of sigma distribution, S/N units')
115 help=
'Upper bound of sigma distribution, S/N units')
122 help=
'Size of t0 PDF bin, ns')
124args = parser.parse_args()
126generator = SampleGenerator(
127 (args.t0_low, args.t0_high),
128 (args.tau_low, args.tau_high),
129 (args.amp_low, args.amp_high),
130 (args.sigma_low, args.sigma_high),
134print(f
'Generating {args.n_samples} samples...')
135sample = generator.generate(args.n_samples)
138timearray = generator.get_t0_array()
139timebins = generator.get_t0_bins()
141 'midpoint': timearray,
142 'lower': timebins.values[:-1],
143 'upper': timebins.values[1:]
147bounds = pd.DataFrame({
148 'value': np.array([
't0',
'amplitude',
'tau',
'sigma']),
149 'sampling': np.array([
'uniform',
'uniform',
'uniform',
'uniform']),
151 generator.get_t0_bounds()[0],
152 generator.get_amp_bounds()[0],
154 generator.get_sigma_bounds()[0]
157 generator.get_t0_bounds()[1],
158 generator.get_amp_bounds()[1],
160 generator.get_sigma_bounds()[1]
163orderedcols = [
'value',
'sampling',
'low',
'high']
164bounds = bounds[orderedcols]
166print(
'Samples created.')
168output_name =
'SVDTime_Training{0}_{1}.pkl'
172sample.to_pickle(output_name.format(
'Sample', args.n_samples))
173bins.to_pickle(output_name.format(
'Bins', args.n_samples))
174bounds.to_pickle(output_name.format(
'Bounds', args.n_samples))
176print(
'Done.\nResults saved to {}.'.format(output_name.format(
177 '{Sample, Bins, Bounds}', args.n_samples)))