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

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

Built distributions (wheels)

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

Download URL lsst-sphgeom-24.0.0a20223000.tar.gz
Size 129.2 kB
Tags Source
SHA-256 checksum
How to use checksums
74523369ef8c991f13860854b2a0ca26c7fbf30f991009d8c7a288f9ced6579e
BLAKE2b-256 checksum
How to use checksums
45cde19813bea0c52b897f9172b5cfcaec19adde9dbdcc53a707158df5321a2a
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.0a20223000-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20223000-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 652.5 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
46e7ac6fab14a735db63b9c3e6f6e26047ab64a0f553cedf179cdb64746993dd
BLAKE2b-256 checksum
How to use checksums
fd6fa28db7453d2adb6511d5549db6199a20055c6202f14228950a1bcac86201
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.0a20223000-cp310-cp310-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20223000-cp310-cp310-macosx_11_0_arm64.whl
Size 495.4 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3378b72fa599ebe32a007ee6e123e03b2066fff68ee4620274714fe65d8906e7
BLAKE2b-256 checksum
How to use checksums
069249ae83916efeab30281e234f2a090810bb6a767bde4dde3b8150ff56d22d
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.0a20223000-cp310-cp310-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20223000-cp310-cp310-macosx_10_9_x86_64.whl
Size 516.5 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
76724bc97b2baa0c25f3cf438972e4232686a46ff5b358786ff3fd87848fcc96
BLAKE2b-256 checksum
How to use checksums
8e2b4faa967f622064a21d22077f76751c1aba2bc24972e501f82308de5c8e56
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.0a20223000-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

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

Download URL lsst_sphgeom-24.0.0a20223000-cp39-cp39-macosx_11_0_arm64.whl
Size 495.4 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b347e101b5a18cb5da0ddb2c95682e96cc0618b1ac0afe9888e70d66bb4d12b8
BLAKE2b-256 checksum
How to use checksums
5f370101d71935f732c03e79edb464d4fdf16fc9d728b7b4117f7bdc3ccca601
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.0a20223000-cp39-cp39-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20223000-cp39-cp39-macosx_10_9_x86_64.whl
Size 516.7 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
f80b067c73a5e1ae6bac1044802ebdf81b913820ccf3ae9144992208c35b86b6
BLAKE2b-256 checksum
How to use checksums
2d4b86f66fa0f7d660e03b5af25c43bea94d7b4e2946a98308c47f12b9be77bb
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.0a20223000-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20223000-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 652.7 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
2d6c27906392f0f91e7c7f2d201dad6c89145a681c813bac7deb0c6aca89cb10
BLAKE2b-256 checksum
How to use checksums
d8c1f3c05d7c8a811c5c663575930af83a754481c88e5e5732ef4418ecba9cbc
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.0a20223000-cp38-cp38-macosx_11_0_arm64.whl

Download URL lsst_sphgeom-24.0.0a20223000-cp38-cp38-macosx_11_0_arm64.whl
Size 495.3 kB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e53c86da8b6db4ca4aa26177e1c411690061abcafc077e63bfdbdf6ca2e60640
BLAKE2b-256 checksum
How to use checksums
f2602b3b2280e608e48a916a1c3a142fe5dd1fef11e5e4ed185e2e83d104ba98
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.0a20223000-cp38-cp38-macosx_10_9_x86_64.whl

Download URL lsst_sphgeom-24.0.0a20223000-cp38-cp38-macosx_10_9_x86_64.whl
Size 516.4 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
458b12652adbf842e8a6b60b8ffeda662c882c51f7596897720a79f0a10d4103
BLAKE2b-256 checksum
How to use checksums
ab5e01a64545218307a9155710f66043f6c68483a5094de1e2cf254c5e23397c
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.0a20223000

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