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 25.0.0a20224600

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 25.0.0a20224600
File Size Uploaded Provenance
lsst-sphgeom-25.0.0a20224600.tar.gz 129.3 kB Without provenance Details

Built distributions (wheels)

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

Download URL lsst-sphgeom-25.0.0a20224600.tar.gz
Size 129.3 kB
Tags Source
SHA-256 checksum
How to use checksums
eaf5e9a1c573d69f8fb50c7adb80a22e1c9da222af366667db5c41e13d3bc094
BLAKE2b-256 checksum
How to use checksums
267dcda4bea824b20ed35f5aa8562f590acffbea0257c6d3ad83e3814dfa4aeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224600-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224600-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 659.2 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
858109b20b8a9e9667061c74a94079d2e8571061ff5b75d0680f5983f1a5c9f3
BLAKE2b-256 checksum
How to use checksums
a6c4d737f372150bbdab9d9da0dde2fb650fc91d725a61bed1875acc0d1cfb88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224600-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224600-cp310-cp310-macosx_11_0_arm64.whl
Size 491.7 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9a7c3387353770e591eef78c7091ef3b69afaff251490f7ee17ebcf17f55f9f7
BLAKE2b-256 checksum
How to use checksums
f38e213c022118681a4bd93d354acbd2f9f216b7fbc62bf283bbf391fa9cc238
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224600-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224600-cp310-cp310-macosx_10_9_x86_64.whl
Size 513.2 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
281a1caa767ba75874ec0323674a18f6e95656037f216099a0d0da8ad5156f02
BLAKE2b-256 checksum
How to use checksums
26f9ce349462c2da09eb95d05778b8186ea37ab6cf55efdae7ae26b874e5c0af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224600-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224600-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 666.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
88307827317b744321967622ba92855300fe7827291473a0dbc1ae49152746ae
BLAKE2b-256 checksum
How to use checksums
6124c49016bbbe44204cd9744630630481d60521a36b6fdcd0f501b83d1faeb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224600-cp39-cp39-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224600-cp39-cp39-macosx_11_0_arm64.whl
Size 491.7 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6d8f9d940bad1a77f0b4bf4f60756a7c87e359e7d382edb2ac143b1f176f684e
BLAKE2b-256 checksum
How to use checksums
41f32bd46260b24655bfd121f037d0afc82d19747652651e89736342e85d9e1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224600-cp39-cp39-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224600-cp39-cp39-macosx_10_9_x86_64.whl
Size 513.3 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
f66e5dda56243f5576195ce24aa95a25ddf83cc9b4ea138523a3f6f9148ff433
BLAKE2b-256 checksum
How to use checksums
69e8bfb939cd31fd9ae60409df06584a57ae8062796e3626ca6399a47c9d00b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224600-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224600-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 659.8 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
fa025413541e3e42d908b274be3b44c741c03ceb5488c0ae7687ec7c7e7c4f5a
BLAKE2b-256 checksum
How to use checksums
e11c8cb6a4781035717ccbeb6bdc7b5ae67d6efc13207e1e6ee32b5a92e992c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224600-cp38-cp38-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224600-cp38-cp38-macosx_11_0_arm64.whl
Size 491.6 kB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
be2b243861e302b581bf6daf01b214ec21965254b4c98f9f43a36625c6a070d2
BLAKE2b-256 checksum
How to use checksums
ea9561929612dbd09a16696f9ef3f31fdeb4347c2fc2a01c50053463d76058d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / lsst_sphgeom-25.0.0a20224600-cp38-cp38-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224600-cp38-cp38-macosx_10_9_x86_64.whl
Size 513.1 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
b62247d6a5b07e40523e1a8d53082baf141ece177866a6c95e1550ccc2d69f8d
BLAKE2b-256 checksum
How to use checksums
f7314f9689ff1506a849cded2679d2f3b1148cf9a8df46b09f33514a1c021100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Security for lsst-sphgeom 25.0.0a20224600

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