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 24.0.0a20222700

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 24.0.0a20222700
File Size Uploaded Provenance
lsst-sphgeom-24.0.0a20222700.tar.gz 128.7 kB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for lsst-sphgeom 24.0.0a20222700
File
lsst_sphgeom-24.0.0a20222700-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-24.0.0a20222700-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
lsst_sphgeom-24.0.0a20222700-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
lsst_sphgeom-24.0.0a20222700-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-24.0.0a20222700-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
lsst_sphgeom-24.0.0a20222700-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
lsst_sphgeom-24.0.0a20222700-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-24.0.0a20222700-cp38-cp38-macosx_11_0_arm64.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64 Details
lsst_sphgeom-24.0.0a20222700-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details

Total release size: 4.8 MB

Release files / lsst-sphgeom-24.0.0a20222700.tar.gz

Download URL lsst-sphgeom-24.0.0a20222700.tar.gz
Size 128.7 kB
Tags Source
SHA-256 checksum
How to use checksums
818296d12afc44b5b20fd47fd101fbba72d92fe689e11db32d0620ad475a6758
BLAKE2b-256 checksum
How to use checksums
be4e3d51cafa21a48ad75f8a3137265be587a142aeed12f9070cfd0a9f99db24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / lsst_sphgeom-24.0.0a20222700-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222700-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 606.2 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
ba9c050b26e11c923b597fef061f473927aeb4e1a5713877671a1644b617c13d
BLAKE2b-256 checksum
How to use checksums
e97fe70df438288bd9d1e521ef9bd24316795296ff090583437f8b69c2cbf72f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / lsst_sphgeom-24.0.0a20222700-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222700-cp310-cp310-macosx_11_0_arm64.whl
Size 457.6 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9e5778289ef90557580262e0ee82bc2712e855c0cac80339dce72758dbce1f06
BLAKE2b-256 checksum
How to use checksums
c75c9af85c584a354297cbf62b69003ad2ef5e43ae52e8c19878c9109646a061
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / lsst_sphgeom-24.0.0a20222700-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222700-cp310-cp310-macosx_10_9_x86_64.whl
Size 478.5 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
9f514b828655341f0f9c62686b74cfc3bb12d4e96364a60cfba23c6569e673b9
BLAKE2b-256 checksum
How to use checksums
c85b348a6dcada4b1ef7f45769edf7d6b697f51a0a6b88ef8e52503a5cae5922
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / lsst_sphgeom-24.0.0a20222700-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222700-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 610.1 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2655d84045414b3f5e0874dfd527da141627c2fd7d56eca0015b81ce997d81b4
BLAKE2b-256 checksum
How to use checksums
1e2b6148c8de813800c7b86d912a8e6a2c21ff40c9dd9f7d4378b3cea1fa00a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / lsst_sphgeom-24.0.0a20222700-cp39-cp39-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222700-cp39-cp39-macosx_11_0_arm64.whl
Size 457.7 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c0b38cc2880cb95ccfd2e3a70c16137857cadc35c9dd1bed80ad030f865d0d64
BLAKE2b-256 checksum
How to use checksums
0464262cdf680b6de91ce0095ef7fb087459ac3eb915a3cad148d134ffea0660
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / lsst_sphgeom-24.0.0a20222700-cp39-cp39-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222700-cp39-cp39-macosx_10_9_x86_64.whl
Size 478.6 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
825da723c8a3ec0b70c99c21c39e79a767115b8e62148ef0c19427a6038c49b5
BLAKE2b-256 checksum
How to use checksums
8a3c31bdace34dcc406704f653ed2845bb6a5dc6f90ae8e8f84481cfd49655a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / lsst_sphgeom-24.0.0a20222700-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222700-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 607.5 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
8ee6b12cee87aed95bb77b471ef8acdaaa1b966ec5877f1fda0de344ee38c0fe
BLAKE2b-256 checksum
How to use checksums
f853fcaf1c43a7e69c3285978405823746d553342bc7c6f84689114e8093fc69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / lsst_sphgeom-24.0.0a20222700-cp38-cp38-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222700-cp38-cp38-macosx_11_0_arm64.whl
Size 457.6 kB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
eb217d78c2db2d9cab8cff0f0107711c9060f807043c7a50d2767499421b9f51
BLAKE2b-256 checksum
How to use checksums
52e0f9dc0b94843f8a74f6f227b419ec260f9d91aff48761c0ffec29ef1283e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / lsst_sphgeom-24.0.0a20222700-cp38-cp38-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222700-cp38-cp38-macosx_10_9_x86_64.whl
Size 478.5 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
bd56b9ca5a86d9d57e6872e3ed5c62a5dad01e31782972db01e59468f0a3428d
BLAKE2b-256 checksum
How to use checksums
abcd2a5a7b4a29f28a120d4394b756598f3ce30eb1568644eb60371ecb5fe211
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Security for lsst-sphgeom 24.0.0a20222700

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