Skip to main content

Spatial Bucketing of RIPE Atlas Probes on Map Projections.

Project description

RIPE-Atlas-sbucket

Spatial Bucketing of RIPE Atlas Probes on Map Projections

This tool selects probes based on spatial distribution on an arbitrary map projection. Some tweaking might be required for non-mercartor like projections.

Installation

pip install sbucket

Usage

usage: sbucket [-h] [--data DATA] [--projection PROJECTION]
               [--maxiter MAXITER] [--country COUNTRY [COUNTRY ...]]
               [--verbose]
               count

Spatial bucketing of RIPE Atlas probes.

positional arguments:
  count                 number of probes to be returned

optional arguments:
  -h, --help            show this help message and exit
  --data DATA, -d DATA  dump of probe metadata, if not given data is retrieved
                        from atlas.ripe.net
  --projection PROJECTION, -p PROJECTION
                        projection to use for spatial distribution, has to be
                        supported by pyproj (default: merc)
  --maxiter MAXITER, -m MAXITER
                        maximum number of iterations to be performed (default:
                        100)
  --country COUNTRY [COUNTRY ...], -c COUNTRY [COUNTRY ...]
                        Allowed countries. If not set: world-wide.
  --verbose, -v

Example

$ sbucket.py 100
[11689, 15655, 52, 1114, 168, 628, 86, 21451, 16100, 24, 13237, 11, 4096, 303, 176, 33, 4920, 683, 1190, 2810, 14449, 449, 239, 6107, 12505, 17601, 1002, 4814, 74, 1118, 78, 243, 212, 1046, 3466, 16632, 21126, 3585, 227, 126, 73, 12811, 77, 2917, 483, 446, 2062, 3, 253, 3168, 2250, 11061, 3053, 329, 1147, 3461, 2001, 524, 1042, 3579, 93, 75, 4089, 20255, 3646, 4985, 12848, 11691, 165, 3924, 516, 11744, 4776, 1016, 4000, 2564, 97, 14446, 1069, 40, 603, 13028, 645, 521, 20092, 332, 18357, 18641, 1154, 12372, 1133, 234, 1149, 4153, 2456, 15297, 13805, 2218, 18437, 4919, 470, 10688, 1165, 1003]
$

Without sbucket selection (world-wide 500 probes): alt text

The distribution is biased, because it prefers areas with a high density of probes. Here you can see the global distribution of probes by country code: alt text

With sbucket selection (world-wide 500 probes): alt text

After application of the spacial bucket algorithm this distribution has a much longer tail (thus includes more countries) and small countries with high probe density are moved down and large countries are moved up the ladder: alt text

Algorithm

It tries to find a grid with the right number of cells by iterating over grid sizes. It stops after a grid was found which yields the number of probes (with a 5% error margin) OR a maximum number of iterations have been performed.

If the number of probes is bellow the targeted count, the cell number is increased (vertically and horizontally) by 50%, otherwise it is reduce by 10%.

Within one cell a random probe is selected. Grid cells are roughly square.

Known Problems

  • Selection might yield more or less probes then expected, no guarantees here, but it works well for larger numbers (>20).
  • The grid is set between 85 degrees north and south, this might be a problem with other projections than Mercator.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sbucket-0.2.0.tar.gz (18.1 kB view details)

Uploaded Source

File details

Details for the file sbucket-0.2.0.tar.gz.

File metadata

  • Download URL: sbucket-0.2.0.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for sbucket-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a53f94909ccbd9dc6df6c927d6fd43d7d668e80b4e4f87dbb8bde82d107892a9
MD5 bb64ce72841ea753940ad49804377017
BLAKE2b-256 8f49d85adc21ff37b5c386bf719082674b452b478b30a70c3657262844a03a81

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page