Esempio n. 1
0
pool.close()
pool.join()
t1 = datetime.datetime.now()
print t1 - t0

paths = GEODESIC.combine_paths(paths)
paths = GEODESIC.remove_zeros(paths)

lons, lats = paths[:, 0], paths[:, 1]

if show:
    plt.figure()
    plt.scatter(lons, lats)
    plt.show()

DENSITY = Density(paths=paths)

H, xedges, yedges = DENSITY.hist2d(paths=paths)

H = np.rot90(H)
H = np.flipud(H)
H = np.ma.masked_where(H == 0, H)

H_avg = np.average(H)
H_std = np.std(H)

print "The point density distribution average for {} is: {} ".format(
    region_name, H_avg)
print "The point density distribution standard deviation for {} is: {} ".format(
    region_name, H_std)
Esempio n. 2
0
        #    GEODESIC.fast_paths(path)

        total_points.append(path)

total_points = list(it.chain(*total_points))
total_points = np.array(total_points)

total_points = np.asarray(INPOLY.points_in(total_points, poly=poly, IN=True))

plt.figure()
plt.scatter(total_points[:, 0], total_points[:, 1])
plt.scatter(coords[:, 0], coords[:, 1], c='orange')

plt.show()

DENSITY = Density(paths=total_points, nbins=nbins)

H, xedges, yedges = DENSITY.hist2d(paths=total_points)

#histogram_GIS = np.column_stack((H, xedges, yedges))

print H.shape, xedges.shape, yedges.shape

coords = np.array([[x, y] for x in xedges[:-1] for y in yedges[:-1]])

H = np.rot90(H)
H = np.flipud(H)
#H = np.rot90(H)
#H = np.rot90(H)

#plt.figure()