- start = time.time()
- Z = pool.map(job2, tasks, 1)
- print time.time() - start
-
- s_file = open('surface' + str(k), 'w')
- pickle.dump((X, Y, Z), s_file)
- s_file.close()
- plt.imshow(Z, cmap=cm.jet, interpolation='bicubic',
- origin='upper', extent=(-k, k, -k, k), aspect='equal')
- plt.colorbar()
+ for y in xrange(-k, k):
+ tasks = [(im_l, v1, v2, h1, h2, x, y, dv, dh, size) for x in xrange(-k, k)]
+ Z1.append(pool.map(dist1, tasks, 8))
+ Z2.append(pool.map(dist2, tasks, 8))
+
+ fig = plt.figure()
+ s1 = fig.add_subplot(121)
+ s2 = fig.add_subplot(122)
+
+ s1.imshow(Z1, cmap=cm.jet, interpolation='bicubic',
+ extent=(-k, k, -k, k), aspect='equal')
+ s1.plot([x_v], [-y_v], 'o')
+ s1.set_ylim(-k, k)
+ s1.set_xlim(-k, k)
+ s2.imshow(Z2, cmap=cm.jet, interpolation='bicubic',
+ extent=(-k, k, -k, k), aspect='equal')
+ s2.plot([x_h], [-y_h], 'o')
+ s2.set_ylim(-k, k)
+ s2.set_xlim(-k, k)