@@ -0,0 +1,754 @@
+%0A## Imports%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0Afrom pySpatialTools.Retrieve import GridSpatialDisc, CircRetriever%0Afrom pySpatialTools.Spatial_Relations.region_spatial_relations import regions_relation_points%0A%0A## Paramters%0An = 10000%0Angx, ngy = 100, 100%0A%0A## Artificial distribution in space%0Alocs = np.random.random((n, 2))%0Alocs2 = np.array((locs%5B:, 0%5D*np.cos(locs%5B:, 1%5D*2*np.pi), locs%5B:, 0%5D*np.sin(locs%5B:, 1%5D*np.pi*2))).T%0A%0A# Test distributions%0Afig1 = plt.plot(locs%5B:,0%5D, locs%5B:, 1%5D, '.')%0Afig2 = plt.plot(locs2%5B:,0%5D, locs2%5B:, 1%5D, '.')%0A%0A## Discretization%0Adisc = GridSpatialDisc((ngx, ngy), xlim=(0, 1), ylim=(0, 1))%0Aregions = disc.map2id(locs)%0A%0Adisc2 = GridSpatialDisc((ngx, ngy), xlim=(-1, 1), ylim=(-1, 1))%0Aregions2 = disc2.map2id(locs2)%0A%0A%0A

Test for spatial discretization.