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

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

Built distributions (wheels)

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

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

Download URL lsst_sphgeom-24.0.0a20222500-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
c29af8bd8a4cc8818abc19252e36fbd0aad428d5f0ca8f8544451b7b3fc987f5
BLAKE2b-256 checksum
How to use checksums
92e052a0595dfd5b2fd388775cf340beccd9d683f92e617d27032fd9ab1e13de
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.0a20222500-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222500-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
926abb8d76a41e224fb6d96e0c8cefe28a14dbf9203f8ad99fcb3a4d2f4d9f9e
BLAKE2b-256 checksum
How to use checksums
33f113e0811a3ce148ec40c14b532162fa8573ebacdb3a31368bb886442ac8e9
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.0a20222500-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222500-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
72de3b8b50af311a6eb3f338e30563ee9cbdbf40dd2737da09a3c64ba6f07961
BLAKE2b-256 checksum
How to use checksums
62e9cb470c034b7328034ca7545bc9982800e1fd79804d17337faa8ab8501896
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.0a20222500-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222500-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 610.0 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
be3b68fdffaed46c0e60291b2f182ed2e056a2ff7b361dc26751983980db6cbe
BLAKE2b-256 checksum
How to use checksums
0f81e3bfa08d2c390a119f811b3b6a973d8904e59e4ea1fc89a0f4a3c77aee91
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.0a20222500-cp39-cp39-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222500-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
a2e634e8b0fc23090f7d08cd5d61160c1d9322fb007a7789e2638e94efe527b0
BLAKE2b-256 checksum
How to use checksums
eb4c4103e7d2a1dc993b743339378252e7f24e19b1ef02dd3f3b74c42ea22049
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.0a20222500-cp39-cp39-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222500-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
a2377fd899c11700764d85fa5a6f711919187c6e8950f46b3b905fd56e187831
BLAKE2b-256 checksum
How to use checksums
80fea3ca21b74fda7f794df821c7e23953ba346ff2bdd6313885e0e8daaadd62
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.0a20222500-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222500-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
84abaa28e0ddcb9ec096afd9371f058a6ef8f8caa0ed153eb26529240d194e89
BLAKE2b-256 checksum
How to use checksums
2eca89db9828ee9da20c38418b7da7d749e2fd42f982f92c419e79026d366582
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.0a20222500-cp38-cp38-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20222500-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
9c773eca114d74c9b0b7c3cc968f3c65054310df6395c5a3ca41d69486a60640
BLAKE2b-256 checksum
How to use checksums
d3dba02b961be1da54e569d14450d1af869539ed499db507840b0790fc6c1892
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.0a20222500-cp38-cp38-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20222500-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
6e970005d61cbcf8d20847e600610ad14d4333eaf119eb031971d22af34f696f
BLAKE2b-256 checksum
How to use checksums
59b85028b5cfdbe6a92a44ee0696011d6b41bf5432f5537afeab0a6e31695cb3
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.0a20222500

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