Skip to main content
https://github.com/TUW-GEO/fibgrid/actions/workflows/ci.yml/badge.svg https://coveralls.io/repos/github/TUW-GEO/fibgrid/badge.svg?branch=master https://badge.fury.io/py/fibgrid.svg https://readthedocs.org/projects/fibgrid/badge/?version=latest

Fibonacci grid

The Fibonacci Grid is a method for distributing points uniformly across the surface of a sphere. It is inspired by the Fibonacci sequence and the golden angle to ensure a near-equal area distribution of points, making it ideal for applications that require unbiased global sampling. Points are systematically spaced in latitude and longitude, avoiding clustering at the poles, which is a common issue with traditional latitude-longitude grids.

Constructing the grid involves distributing points along the vertical axis of the sphere (latitude) and rotating them around the sphere’s horizontal axis (longitude) based on the golden angle. This deterministic approach is computationally efficient and scales easily by adjusting the number of points. The resulting grid is particularly suitable for representing global data with uniform coverage, making it useful for tasks like climate modeling, ocean simulation, and satellite data representation.

The Fibonacci Grid is valued for its simplicity and uniformity, offering an effective balance between computational efficiency and spatial accuracy. While it does not achieve exact equal-area partitioning or hierarchical refinement like some specialized grids, its versatility and ease of implementation make it a popular choice for applications requiring discrete global grids.

In the context of transforming Fibonacci grid points to an ellipsoid, the coordinates are first calculated on a sphere and then each point is projected onto the ellipsoidal surface. This two-step process ensures that the initial uniform distribution of points across the sphere is preserved while adapting the grid to the Earth’s ellipsoidal shape. Once transformed to the ellipsoid, the grid becomes compatible with real-world geodetic Coordinate Reference Systems (CRS) like WGS84, allowing seamless integration with e.g. satellite data. However, a disadvantage is that the transformation may introduce slight non-uniformities, as the ellipsoid’s curvature differs from that of the sphere. These distortions are typically minor and acceptable for most applications but could be a limitation in scenarios requiring exact equal-area distributions.

Grid construction

Creating a Fibonacci grid based on a given number of points.

from fibgrid.construction import compute_fib_grid

n = 6600000
points, gpi, lon, lat = compute_fib_grid(n)

Grid realization

Three different Fibonacci grids can be directly loaded with different sampling distances (6.25 km, 12.5 km and 25 km). Each grid is given in spherical and WGS84 latitude and longitude coordinates.

  • approx. 6.25 km (N=6,600,000)

  • approx. 12.5 km (N=1,650,000)

  • approx. 25 km (N=430,000)

The grids are distributed as compressed Zarr archives. On first use the required grid is downloaded and extracted into a local cache directory (platformdirs user cache) - subsequent loads read it directly from disk.

from fibgrid.realization import FibGrid

sampling = 12.5
sphere_fb = FibGrid(sampling, geodatum="sphere")
wgs84_fb = FibGrid(sampling, geodatum="WGS84")

Grid points can optionally be sorted in latitude bands (from 90S to 90N). This is available for the 6.25 km and 12.5 km grids:

sorted_fb = FibGrid(12.5, geodatum="WGS84", sort_order="latband")

FibLandGrid restricts the grid to points over land:

from fibgrid.realization import FibLandGrid

land_fb = FibLandGrid(12.5, geodatum="WGS84")

The underlying arrays (longitude, latitude, cell, grid point index and land metadata) can also be read directly:

from fibgrid.realization import read_grid_file

lon, lat, cell, gpi, metadata = read_grid_file(1650000, geodatum="WGS84")

Citation

https://zenodo.org/badge/DOI/10.5281/zenodo.14187001.svg

If you use the software in a publication then please cite it using the Zenodo DOI. Be aware that this badge links to the latest package version.

Please select your specific version at https://doi.org/10.5281/zenodo.14187001 to get the DOI of that version. You should normally always use the DOI for the specific version of your record in citations. This is to ensure that other researchers can access the exact research artefact you used for reproducibility.

You can find additional information regarding DOI versioning at http://help.zenodo.org/#versioning

Download files

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

Source Distribution

fibgrid-0.0.10.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fibgrid-0.0.10-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file fibgrid-0.0.10.tar.gz.

File metadata

  • Download URL: fibgrid-0.0.10.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for fibgrid-0.0.10.tar.gz
Algorithm Hash digest
SHA256 6bbabd725e6e068fbf4b5e00bcc2331e7b7b18449021ed8bc87b73f08f2abeef
MD5 e14b965d01e76a1d53d54125c2beb786
BLAKE2b-256 ae4a964567096aafa908f326857cda7397c4d15f67359cd4895b8b8230028178

See more details on using hashes here.

File details

Details for the file fibgrid-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: fibgrid-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for fibgrid-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 2722e4fe8c768947909cf2ab3dc7c6cbb23ff79826c9b9cd461ea9a41f0ff469
MD5 3327916a497ba416c672e23412926f96
BLAKE2b-256 ff4fee115fa7c9cbc5b434b4a315dc36246de3d6edefed6a825e5a24a73ab0ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page