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.0a20224900

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

Built distributions (wheels)

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

Download URL lsst-sphgeom-25.0.0a20224900.tar.gz
Size 129.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1462103a1ef518eb967b2fb829138613e398e597329162ab2e10f4900144ea9a
BLAKE2b-256 checksum
How to use checksums
05fe78723e467aa932f1a4a02a9138ec77574d2ca25388eb856f419e8a6b6af3
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.0a20224900-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224900-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
e39a3cf6937c4d6d3bddbe142869c787d7175ed9435d7ef8d5832279ce559eb8
BLAKE2b-256 checksum
How to use checksums
f2b33d5cbad60a5b63c697259f409b5112931b2a71870e3bd32ec1f9c9b2437b
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.0a20224900-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224900-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
a038d65a3817bba9668987d0789a25391c4bacf90accd8bc24723f5960ef271c
BLAKE2b-256 checksum
How to use checksums
d677019722a438de0d658bf36b3510e26f0561a602eb904036a13a4737fb8191
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.0a20224900-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224900-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
c8475ce437300f326ccdb88684b0fdc7cea5862d4154dcc0ebc98a40ff566ce5
BLAKE2b-256 checksum
How to use checksums
de2ce4cc9f659b782b9a8e0ed624d2e318397844f3702936b1ee34e72d2372dc
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.0a20224900-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224900-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
12f1a84de5b224c684520072c4831f197ac57779702c7af3da628b1978f2e911
BLAKE2b-256 checksum
How to use checksums
a323918b92165dc55a63d25f1f0a7c19c148c3db4634abc2f3221b0ba5012ccd
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.0a20224900-cp39-cp39-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224900-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
99b27dba280e8bf1ca37b8442ac4f476e106d1baeb51f0e7d3224907e03ed6fd
BLAKE2b-256 checksum
How to use checksums
012c876062446da1eecc6ec451bc4b7e4b8a86133c0af43bbe5c6528e6c86a73
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.0a20224900-cp39-cp39-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224900-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
8999f0a40f5f549208ddd9b7aa9481d0d06578d4301910dac5fbcf2db5247dd7
BLAKE2b-256 checksum
How to use checksums
47aecc2fc6de1df23b261a8151c3948124c8668d3252ae29aa8856221603ae64
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.0a20224900-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224900-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
b201e6320032856946784a5e83493838fc3bba8db3e791329e6a2c99da8ab5be
BLAKE2b-256 checksum
How to use checksums
ef8c8f0fad990c40980d791726fc6b654f5fd0c54f800fcf4544def4cb3a6489
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.0a20224900-cp38-cp38-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-25.0.0a20224900-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
48328c0810a4b7ca11d9c7cf2ace00ec619683b1c207e77dc47a9abc7d076365
BLAKE2b-256 checksum
How to use checksums
c1a391f93e97e271a4ebb11a5a510f0e6ebe3dcbc70bc4b507e5023a435b8b9e
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.0a20224900-cp38-cp38-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-25.0.0a20224900-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
2767169392e853a3f56637880c422123dd09c169faa319343851ed1645293125
BLAKE2b-256 checksum
How to use checksums
d672a4f3c59a72aebfa6405d1c23ff38dcbd6ac100534144c70f5a888ae0a554
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.0a20224900

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