51 Plot three arrays horizontally. 57 if name
in "orig".
split():
60 zlabel = dict(orig=
"ADC", raw=
"nfADC", gauss=
"electrons", wiener=
"electrons")[name]
64 hpix = sum([a.shape[1]
for a
in arrs])
76 width_pix = hpix + len(arrs)*bpix*2 + cpix
77 width_inch = width_pix/dpi
78 height_pix = vpix + 2*bpix + blpix + tpix
79 height_inch = height_pix/dpi
81 bot_pix = blpix + bpix
83 figsize=(width_inch, height_inch)
85 fig = plt.figure(dpi=dpi, figsize = figsize)
91 vmin =
min([numpy.min(arr)
for arr
in arrs])
92 vmax =
max([numpy.max(arr)
for arr
in arrs])
100 for letter, arr, ext
in zip(
"UVW", arrs, extents):
101 tit =
"%d ticks x %d ch grps" % (arr.shape[0], arr.shape[1])
103 xa = (left_pix+bpix)/
float(width_pix)
104 ya = bot_pix/
float(height_pix)
105 dxa = arr.shape[1]/
float(width_pix)
106 dya = arr.shape[0]/
float(height_pix)
107 relaxis = (xa,ya,dxa,dya)
108 x_axes.append((xa,dxa))
110 left_pix += 2*bpix + arr.shape[1]
113 ax = fig.add_axes(relaxis)
116 ax.set_xlabel(
"%s channels" % letter)
117 ax.set_ylabel(
"ticks")
119 im = ax.imshow(arr, cmap=cmap, interpolation=
'none', extent=ext, aspect=
'auto', vmin=vmin, vmax=vmax)
123 relaxis = [(left_pix)/
float(width_pix),
124 bot_pix/
float(height_pix),
125 (cpix-cibpix)/
float(width_pix),
126 (arrs[0].shape[0])/
float(height_pix)]
127 cbar_ax = fig.add_axes(relaxis)
128 fig.colorbar(ims[0], ax=axes[0], cmap=cmap, cax=cbar_ax, label=zlabel)
136 for letter, blarr, ext, (xa,dxa)
in zip(
"UVW", baselines, extents, x_axes):
139 bpix/
float(height_pix),
141 blpix/
float(height_pix))
143 left_pix += 2*bpix + blarr.size/
float(width_pix)
145 ax = fig.add_axes(relaxis)
148 ax.set_xlabel(
"%s channels" % letter)
149 ax.set_ylabel(
"baseline")
152 ax.plot(numpy.linspace(ext[0], ext[1], num=blarr.size), blarr)
153 ax.set_xlim([ext[0],ext[1]])
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
def three_horiz(arrs, extents, name, baselines)
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.
void split(std::string const &s, char c, OutIter dest)