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

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

Built distributions (wheels)

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

Download URL lsst-sphgeom-26.0.0a20230200.tar.gz
Size 129.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4d7d9dbf3f1038f19910b38b2fd34d110027f542827419c2f2e61148adfdc84d
BLAKE2b-256 checksum
How to use checksums
c57f48bbbb50fbc9998465ee87c87c705903caef7f5520bf41cf1d1861447460
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.0a20230200-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230200-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
7691135617b95a45aab3f3a51aa4ba005405fce509c3fa4e83aed804b7b62c5a
BLAKE2b-256 checksum
How to use checksums
d18c908fbdbb3d64552bead401bcdc26c3d81d96775019bf73e6baa276d5fe4e
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.0a20230200-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-26.0.0a20230200-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
8b338ad5599a31db4f8698fffb4aadfe4edf83fda75df3a7ea507ec48430d47f
BLAKE2b-256 checksum
How to use checksums
522b73d7449f28580e1088c4924fe6e6dd9f30d40231c6a5e721ef70775e71ef
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.0a20230200-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230200-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
915acbbc10f219b71635fd8509e0b72effa705735d9f65950e5721369ecdaf68
BLAKE2b-256 checksum
How to use checksums
d65dcb72cee59f26094eac0131b8a5cec0b2301508200544920309f376c128fd
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.0a20230200-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230200-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
6d8988c4e91fd1c2dfe449f4e99eb63b994e6f62639e3839be65f11f8301afb2
BLAKE2b-256 checksum
How to use checksums
e53a18ba2c50debd01e95c4de227680e6bf7000bbd4cb3f3e91d6aa0561300e3
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.0a20230200-cp39-cp39-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-26.0.0a20230200-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
0e6ba99fadc85d5fc57fd7c3454ea30ab043350f7ff85ed84122fe66c6a190ee
BLAKE2b-256 checksum
How to use checksums
dd80d3508be11a59a4de79ff31e9394a020fbaa8b0ea55092a7a02afd82ebf05
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.0a20230200-cp39-cp39-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230200-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
0a5594e991b7633f19e1c84625fbe39dec3253d500ba7d11b4f77fdc03fb3233
BLAKE2b-256 checksum
How to use checksums
7412d6412de10cd9a192e34c32e4b0dc399a061f22caad72dd3e8033c1093407
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.0a20230200-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230200-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
2b65f47550bd7784a46214c3ee0a169d8f9cdd576c7df65154540f3c9c061d75
BLAKE2b-256 checksum
How to use checksums
a3103fe977868e10350defe8060eddd021c2460a05061e4ecaa0cc6c5901bd56
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.0a20230200-cp38-cp38-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-26.0.0a20230200-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
cd3ecdbe954f0c03ba4762fa5ecaa7cf83c615f74ba176c92fea5079732b3c3b
BLAKE2b-256 checksum
How to use checksums
17483ae96ff87e96ad879da7847e4aef2e6a284e969492fc4ba741fe0eafb2cf
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.0a20230200-cp38-cp38-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-26.0.0a20230200-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
2220c9c4fa333a3f64d23957fa719c6fdb438e60074069a51d4f342662a20386
BLAKE2b-256 checksum
How to use checksums
4c64b3c2c00e7420522ae0a5d55727e8f295dc36a67a9284b61b4796e4bbb451
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.0a20230200

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