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

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

Built distributions (wheels)

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

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

Download URL lsst_sphgeom-24.0.0a20222401-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
05a55490d11638154d7658a36a6afe4218d793fe303282c9fcf5d19c60855ed8
BLAKE2b-256 checksum
How to use checksums
c974b854ce6c0afa69c1daf18072a8e0e3b98e952a9be154968efc9bf4978105
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.0a20222401-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222401-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
0636d8757aa2c2586051f7affa262c135df861f36089c5f7d0e42d6e1895e785
BLAKE2b-256 checksum
How to use checksums
4809323c6d37d46fde32ecf50c4157afde0cf6f98f90cd0a4ca45acad4b663a9
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.0a20222401-cp310-cp310-macosx_10_9_x86_64.whl

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

Download URL lsst_sphgeom-24.0.0a20222401-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
4a90b9587ff7f10b246115caa6ee9e3b67fc24c11549e56d290aeaeb5af3c925
BLAKE2b-256 checksum
How to use checksums
1cb0404734c773324e832c91f1d9d948ec3b2703d30827ec2c21d7d6bd46abcb
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.0a20222401-cp39-cp39-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222401-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
5f1c9e30d75de75c3218d5754ac703d4e0519827879211ca9e9d839c3509997e
BLAKE2b-256 checksum
How to use checksums
0c5eaf8934cd129d42bafc7c9fbb6436e7d5ccc13788c12b2e6e4b41e5a88d26
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.0a20222401-cp39-cp39-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222401-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
f5ba8d5c203ec184777ba5a30d2efe137ea7a40cb415ac12c6deb07625ccdb61
BLAKE2b-256 checksum
How to use checksums
4d2b2a225f49c8f0a69073688505fac319c7bfbb06082625df3980536ff81f98
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.0a20222401-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222401-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
cefb7cc2d6a420a3d650e3b47c1eb0f54d67a8f11048f2e6eb3aab96d6f58806
BLAKE2b-256 checksum
How to use checksums
8448f136eb64d0a151f3fd29876892f69bad4a3f3e0d4396116fd0d2e6f4a18d
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.0a20222401-cp38-cp38-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222401-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
610855921bffc6b11e59f57c547c36abf788d5fcde209c202fd030cb3b857bb1
BLAKE2b-256 checksum
How to use checksums
355cdd9e3793c6d0bde7694a9a360fd24833e6b1da9b98f815b0e232a13ae350
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.0a20222401-cp38-cp38-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222401-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
0d355bfbc864445a691b3298ed0eb0cc97acd55cf57f8a8b358dc10121c9bb2a
BLAKE2b-256 checksum
How to use checksums
e4935f423bda1598099f737d4bb26c170cf0245b253e5ed8a159edb07c1c8544
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.0a20222401

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