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

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

Built distributions (wheels)

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

Download URL lsst-sphgeom-24.0.0a20222600.tar.gz
Size 128.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b6b87c48de71ba4b054460882bb9c5aa8328ba83566877cfe8b826f888ebce52
BLAKE2b-256 checksum
How to use checksums
c838a14d267a3d56d1817e0c2e0010ab16aa740938457493cbbb5e3431c42292
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.0a20222600-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222600-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
0cd713ebcabf5a111cffec72e162c781da740cb74c6374d66d9d2ccef0917b35
BLAKE2b-256 checksum
How to use checksums
d37c3e529ff057665c42a31c92a8fdc09123c69774c85e4b0dbb9ed324f3febc
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.0a20222600-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222600-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
2257e1f461a62a7288f89af94523d6d88370d7bd73df9f7ad55a890418fa1081
BLAKE2b-256 checksum
How to use checksums
df542cbbdf1f8481d126ce38264c5a78e028330e5c4d771a6d03aceada1c5545
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.0a20222600-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222600-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
edb3e7fe84e5cff4ebf4c75b68719e1ea7545eb6cac826e8f9941228f84d4636
BLAKE2b-256 checksum
How to use checksums
a39c874d2132458f94aa3472cf6947b10650b66fbbac068dbaccf88e5a058bd7
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.0a20222600-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222600-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
5dfce6d64d4d4282f83df21b3e08eee7f115bceb6e98081730a9b178a7eede34
BLAKE2b-256 checksum
How to use checksums
bdb0e8a8d397f326e238c8e3104cbff8de35138dcd7cb4a934fe49816ca72249
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.0a20222600-cp39-cp39-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222600-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
6f623900c6ceb94a05a6654e9f885f5a08410ea7274fc89e58438dd7744e752c
BLAKE2b-256 checksum
How to use checksums
eedeee9b363935417c38f0b8d8bc259438baafd8b8462ef73a22e05fdbf71e29
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.0a20222600-cp39-cp39-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222600-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
bd970056a857c8905dbb6fdf16ad881920db7a0de732ecb33f928e10b9497a0b
BLAKE2b-256 checksum
How to use checksums
243c58c932bc542b9f8dd37172915e3d4e234bbae453f1e811bb2dca1917fe88
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.0a20222600-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222600-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
750b4c47c0b0052f4bc95edef5fde85dc4b89b2a227c19879d5eb5bb1f9f6638
BLAKE2b-256 checksum
How to use checksums
e1e0a47365accbf6d6f33008fa5c655c2812418f721a0a9c6f0ca57b7a93909e
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.0a20222600-cp38-cp38-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222600-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
653c5d63221ce8c91761a44fc1d76eeb7ce531f807a32c486cff841936693ff1
BLAKE2b-256 checksum
How to use checksums
36198a7fa00486f92f69bde9403f05f36cf1a4a3eb58f312747c5c7a2bc440d5
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.0a20222600-cp38-cp38-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222600-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
5c864ebf4253e3a6f56137f6f84c108feeb4a54d3cbf959a12bd0cf623578e70
BLAKE2b-256 checksum
How to use checksums
5eefb17ce81ce9fe89d154185b3e4ba7e7505e9dd46577ad730fe473c50bc972
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.0a20222600

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