4 $ PYTHONPATH=`pwd`/sigproc/python python sigproc/python/wirecell/sigproc/paper/noise.py 8 from wirecell
import units
9 from ..
import garfield, response, plots
12 garfield_tarball =
"/home/bviren/projects/wire-cell/garfield-data/ub_10.tar.gz" 13 garfield_tarball =
"/opt/bviren/wct-dev/data/ub_10.tar.gz" 18 return [d
for d
in dat
if abs(d.region)
in regions]
21 def figure_adc(dat, regions=None, outname='paper-noise-figure-adc-%dwires'):
24 if regions
is not None:
27 norm = 16000*units.eplus
28 uvw = response.line(dat, norm)
31 adc_bin_range = 4096.0
32 adc_volt_range = 2000.0
33 adc_per_mv = gain*adc_bin_range/adc_volt_range
35 fig,data = plots.plot_digitized_line(uvw, 14.0, 2.0*units.us,
36 adc_per_mv = adc_per_mv)
39 outname = outname % nwires
40 fig.savefig(outname +
".pdf")
42 with
open(outname +
".txt",
'w')
as fp:
44 fp.write(
'%f %e %e %e\n' % (t,u,v,w))
49 if '__main__' == __name__:
63 print (
"Using %d wires of Garfield data: %s" % (nwires, gt))
64 dat = garfield.load(gt)
67 for nwires
in range(1, nwires + 2):
68 fname =
figure_adc(dat, regions = range(nwires), outname=outname)
69 print (
"\t%s" % fname)
72 print (
"\t%s" % fname)
int open(const char *, int)
Opens a file descriptor.
def filter_response_functions(dat, regions=None)
static int max(int a, int b)
def figure_adc(dat, regions=None, outname='paper-noise-figure-adc-%dwires')