144 def activity(output, slices, slice_line, cluster_tap_file):
148 from matplotlib.colors
import LogNorm
149 from .
import tap, clusters, plots
150 gr = tap.load(cluster_tap_file)
152 ahist = plots.activity(cm)
156 arr = arr[:,slices[0]:slices[1]]
157 extent = [slices[0], slices[1]]
159 extent = [0, arr.shape[1]]
160 extent += [ahist.rangey[1], ahist.rangey[0]]
162 fig,ax = plt.subplots(nrows=1, ncols=1)
163 fig.set_size_inches(8.5,11.0)
165 cmap = plt.get_cmap(
'gist_rainbow')
166 im = ax.imshow(arr, cmap=cmap, interpolation=
'none', norm=LogNorm(), extent=extent)
168 ax.plot([slice_line, slice_line], [ahist.rangey[0], ahist.rangey[1]],
169 linewidth=0.1, color=
'black')
173 for chunk
in [400, 400, 400, 400, 480, 480]:
175 y = boundary + ahist.rangey[0]
176 ax.plot(extent[:2], [y,y], color=
'gray', linewidth=0.1);
178 from matplotlib.ticker
import AutoMinorLocator
179 minorLocator = AutoMinorLocator()
180 ax.yaxis.set_minor_locator(minorLocator)
181 ax.tick_params(which=
"both", width=1)
182 ax.tick_params(which=
"major", length=7)
183 ax.tick_params(which=
"minor", length=3)
185 plt.colorbar(im, ax=ax)
186 ax.set_title(cluster_tap_file)
187 ax.set_xlabel(
"slice ID")
188 ax.set_ylabel(
"channel IDs")
192 @cli.command(
"blob-activity-mask")
193 @click.option(
'-o',
'--output', help=
"The output plot file name")
194 @click.option(
'-s',
'--slices', nargs=2, type=int,
195 help=
"The output plot file name")
196 @click.option(
'-S',
'--slice-line', type=int, default=-1,
197 help=
"Draw a line down a slice")
198 @click.option(
'--found/--missed', default=
True,
199 help=
"Mask what blobs found or missed")
200 @click.argument(
"cluster-tap-file")
def activity(output, slices, slice_line, cluster_tap_file)