Skip to main content

fibgrid

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

Metadata

Release files for fibgrid 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fibgrid 0.0.10
File Size Uploaded
fibgrid-0.0.10.tar.gz 5.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fibgrid 0.0.10
File Interpreter ABI Platform
fibgrid-0.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / fibgrid-0.0.10.tar.gz

Download URL fibgrid-0.0.10.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6bbabd725e6e068fbf4b5e00bcc2331e7b7b18449021ed8bc87b73f08f2abeef
BLAKE2b-256 checksum
How to use checksums
ae4a964567096aafa908f326857cda7397c4d15f67359cd4895b8b8230028178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Release files / fibgrid-0.0.10-py3-none-any.whl

Download URL fibgrid-0.0.10-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2722e4fe8c768947909cf2ab3dc7c6cbb23ff79826c9b9cd461ea9a41f0ff469
BLAKE2b-256 checksum
How to use checksums
ff4fee115fa7c9cbc5b434b4a315dc36246de3d6edefed6a825e5a24a73ab0ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Release history Release notifications | RSS feed

This release

0.0.10 This release

2 release files

0.0.9

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

1 release file

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page