Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

sphgeom: spherical geometry primitives

Overview

This low-level C++ library provides primitives for representing points and regions on the unit sphere, as well as support for partitioning the sphere. It can be used to answer the following sorts of questions:

  • Is point X inside region Y?
  • Do two regions A and B intersect?
  • Which pieces of the sphere does region C overlap?

Regions can be serialized to binary strings, so that they may be stored efficiently in files or VARBINARY database columns. They can also be approximated with simpler regions - for example, one can ask for the bounding circle of a convex polygon.

Python bindings that expose most of the C++ API are also provided via pybind11.

Points

There are 3 different classes for points

  • LonLat for spherical coordinates,
  • Vector3d for Cartesian vectors in ℝ³ (not constrained to lie on the unit sphere)
  • UnitVector3d for vectors in ℝ³ with unit ℓ² norm.

Regions

Four basic spherical Region types are provided:

  • Box, a longitude/latitude angle box
  • Circle, a small circle defined by a center and opening angle/chord length
  • Ellipse, the intersection of an elliptical cone with the unit sphere
  • ConvexPolygon, a convex spherical polygon with unit vector vertices and great circle edges

In addition to the spherical regions, there is a type for 3-D axis aligned boxes, Box3d. All spherical regions know how to compute their 3-D bounding boxes, which makes it possible to insert them into a 3-D R-tree. This is used by the exposure indexing task in the daf_ingest package to spatially index exposure bounding polygons using the SQLite 3 R*tree module.

A region can also determine its spatial relationship to another region, and test whether or not it contains a given unit vector.

Pixelizations

This library also provides support for assigning points to pixels (a.k.a. cells or partitions) in a Pixelization (a.k.a. partitioning) of the sphere, and for determining which pixels intersect a region.

Currently, the Chunker class implements the partitioning scheme employed by Qserv. The HtmPixelization class implements the HTM (Hierarchical Triangular Mesh) pixelization. The Q3cPixelization and Mq3cPixelization classes implement the original Quad Tree Cube indexing scheme and a modified version with reduced pixel area variation.

Installing with pip

A simple pip-compatible installer is available. This only installs the Python bindings and the resulting installation is not usable for linking from C++. Some metadata (in particular the version number) are not set properly for the distribution. The main purpose for now is to allow other packages to pip install from the GitHub URL in their CI systems where sphgeom is a dependency.

See Also

Contributing

For instructions on how to contribute, see http://dm.lsst.org/#contributing (or just send us a pull request).

Support

For help, see http://dm.lsst.org/#support.

Metadata

Release files for lsst-sphgeom 26.0.0a20230500

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

Source distribution (sdist)

Source distribution for lsst-sphgeom 26.0.0a20230500
File Size Uploaded Provenance
lsst-sphgeom-26.0.0a20230500.tar.gz 129.3 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for lsst-sphgeom 26.0.0a20230500
File
lsst_sphgeom-26.0.0a20230500-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
lsst_sphgeom-26.0.0a20230500-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
lsst_sphgeom-26.0.0a20230500-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
lsst_sphgeom-26.0.0a20230500-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
lsst_sphgeom-26.0.0a20230500-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
lsst_sphgeom-26.0.0a20230500-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
lsst_sphgeom-26.0.0a20230500-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
lsst_sphgeom-26.0.0a20230500-cp38-cp38-macosx_11_0_arm64.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64 Details
lsst_sphgeom-26.0.0a20230500-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details

Total release size: 5.1 MB

Release files / lsst-sphgeom-26.0.0a20230500.tar.gz

Download URL lsst-sphgeom-26.0.0a20230500.tar.gz
Size 129.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a5a71b0e02d067c6521bafeb5f9d6e5a2f2396f7cead38cbf85677b15ca04e7f
BLAKE2b-256 checksum
How to use checksums
f0f5d9c5306bd0967d99703bb50960e2ad6cb8f8cc1fd27af82bdb9915f2e7f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / lsst_sphgeom-26.0.0a20230500-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230500-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 660.7 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e6a190058d640ed85efda10f82c2bc2c315bcd7d8fe39b30fdfd31887da07018
BLAKE2b-256 checksum
How to use checksums
f5d2e2afe7ab0d478bcbe09b927a85fa2397a65251d8a5d9c18539e5115e623f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / lsst_sphgeom-26.0.0a20230500-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-26.0.0a20230500-cp310-cp310-macosx_11_0_arm64.whl
Size 492.1 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f1b7bf7935e61d5e6fb7c0dab2237f6247701784b3d1262f80256e79c4ab9659
BLAKE2b-256 checksum
How to use checksums
8f86987caeb39dc716312c0d4a7056c486f99caf4577ac77f1c44df22a5a9413
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / lsst_sphgeom-26.0.0a20230500-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230500-cp310-cp310-macosx_10_9_x86_64.whl
Size 513.6 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
9c685e818d66f92b2372acad5c6ad19db8309de51005359b81322087f0893575
BLAKE2b-256 checksum
How to use checksums
4da32d26a92a66b37a58a83ac5b055847315b1a6cce1b2e750e8233cadc4f94c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / lsst_sphgeom-26.0.0a20230500-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230500-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 662.2 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
b2105dd8858a32de38e7c4ace70a1a4160f3777cd38188388b99894d22daeba2
BLAKE2b-256 checksum
How to use checksums
f3b63b17f922e4ed0f5f4bb1867eb9295f0100db9674f321eeb28fe119826c90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / lsst_sphgeom-26.0.0a20230500-cp39-cp39-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-26.0.0a20230500-cp39-cp39-macosx_11_0_arm64.whl
Size 492.2 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
841e630303c30e1478fd994742be9237f3b47e43c5501c46724448ecb048f852
BLAKE2b-256 checksum
How to use checksums
b066cd35ff57bcde01eb05f25c7cf5ba82661da43f89413c341f6170bbbd85bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / lsst_sphgeom-26.0.0a20230500-cp39-cp39-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230500-cp39-cp39-macosx_10_9_x86_64.whl
Size 513.7 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
d1536c93a7a4b3e681c370f1063c6b708442e9bc5f97b2189e3e29360a9bfe53
BLAKE2b-256 checksum
How to use checksums
d4cb9743ebf8cf8d7543369583f15951980b0f80d5a7f71375864db36538e5f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / lsst_sphgeom-26.0.0a20230500-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230500-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 654.7 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1017bef73f1bc1ae2d1a7d2d71636df0019f31f00ea559da86a223b510c63a73
BLAKE2b-256 checksum
How to use checksums
06790923a3c133177c2649d75e4e58be13efe5be19544fba7cec853cee3d65ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / lsst_sphgeom-26.0.0a20230500-cp38-cp38-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-26.0.0a20230500-cp38-cp38-macosx_11_0_arm64.whl
Size 491.9 kB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4e08f97ab8218a2115aa3608c862df56a04f4a119c1406319795239a5841a443
BLAKE2b-256 checksum
How to use checksums
55cb977cb8984813a80717a14fc1207ad71bd84f2b5ed14bf7e7f428545c0884
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / lsst_sphgeom-26.0.0a20230500-cp38-cp38-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230500-cp38-cp38-macosx_10_9_x86_64.whl
Size 513.5 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
13619b12b44fed4ba6016babd5909310c64fbefbdb2ea1f0cd584fabe957d50b
BLAKE2b-256 checksum
How to use checksums
ae470b36b22a21dcb10e73a709a9cff43e54569ec3f3ab5ceb71c149b884bde2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Security for lsst-sphgeom 26.0.0a20230500

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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