Skip to main content

biglogo

Python Tests Python Version Support Version PyPI version Documentation Status GitHub repository License: MIT Code style: black

Introduction

SkySegmentor is a python package for dividing points or maps (in HEALPix format) on the celestial sphere into equal-sized segments. It employs a sequential binary space partitioning scheme -- a generalization of the k-d tree algorithm -- that supports segmentation of arbitrarily shaped sky regions. By design, all partitions are approximately equal in area, with discrepancies no larger than the HEALPix pixel scale.

Dependencies

  • numpy>=1.22,<1.27
  • healpy>=1.15.0

Installation

Pip installation:

pip install skysegmentor

From the source:

Clone the repository

git clone https://github.com/knaidoo29/SkySegmentor.git
cd SkySegmentor

and install by running

pip install . [--user]

Documentation

Documentation, including tutorials and explanation of API, can be found here https://skysegmentor.readthedocs.io/. Alternatively a PDF version of the documentation is located in the docs/ folder called skysegmentor.pdf. Offline documentation can be generating by running make html in the docs/ folder which will generate html documentation in the docs/build/html folder that can be accessed by opening the index.html file in a browser.

Tutorial

Basic Usage

Segmenting Healpix Maps

import healpy
import skysegmentor

# Healpix mask, where zeros are regions outside of the mask and ones inside the
# mask. You can also input a weighted map, where instead of 1s you give weights.
mask = # define mask values

Npartitions = 100 # Number of partitions
partitionmap = skysegmentor.segmentmapN(mask, Npartitions)

Segmenting Points on the Sphere

import skysegmentor

# Define points on the sphere to be segmented.
phi = # longitude defined in radians from [0, 2*pi]
the = # latitude defined in radians from [0, pi], where 0 = North Pole.

Npartitions = 100 # Number of partitions
partitionIDs = skysegmentor.segmentpointsN(phi, the, Npartitions)

if using RA and Dec in degrees you can convert to phi and the using

phi = np.deg2rad(ra)
the = np.deg2rad(90. - dec)

if not all points are equal, you can specify a weight

weights = # define point weights
partitionIDs = skysegmentor.segmentpointsN(phi, the, Npartitions, weights=weights)

Citing

SkySegmentor was developed as part of the Euclid angular power spectra internal covariance pipeline. If you use SkySegmentor please cite this paper, which can be found here:

--THESE ARE PLACEHOLDERS TO BE UPDATED LATER--

  • NASA ADS:
  • ArXiv:
  • BibTex:
    @ARTICLE{Naidoo2025,
            author = {{Euclid Collaboration} and {Naidoo}, K. and 
            {Ruiz-Zapatero}, J. and {Tessore}, N. and 
            {Joachimi}, B. and {Loureiro}, A. and
            others ...}
            title = "{Euclid preparation: TBD. Accurate and precise data-driven angular power spectrum covariances}
    }
    

and include a link to the SkySegmentor documentation page:

https://skysegmentor.readthedocs.io/

Support

If you have any issues with the code or want to suggest ways to improve it please open a new issue (here) or (if you don't have a github account) email krishna.naidoo.11@ucl.ac.uk.

Metadata

Release files for skysegmentor 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skysegmentor 1.0.0
File Size Uploaded Provenance Actions
skysegmentor-1.0.0.tar.gz 26.9 kB Without provenance Details for skysegmentor-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for skysegmentor 1.0.0
File Interpreter ABI Platform Actions
skysegmentor-1.0.0-py3-none-any.whl Python 3 none any Details for skysegmentor-1.0.0-py3-none-any.whl

Total release size: 41.9 kB

Release files / skysegmentor-1.0.0.tar.gz

Download URL skysegmentor-1.0.0.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4882c7d6fec64acbddc42e8e62afcd949874871315a13d3150947b669fe74fe8
BLAKE2b-256 checksum
How to use checksums
9a6652f6086b4cd9158bf5609f0547675158dd7cfc7c5d304a84023b42a944eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / skysegmentor-1.0.0-py3-none-any.whl

Download URL skysegmentor-1.0.0-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3fd0df2289e352a281d4e88c262e559fc0bc3e4671c936fc760bd5d985f3067b
BLAKE2b-256 checksum
How to use checksums
2a226c1c07db6aaefe9ab1f6ba23e822f326464cf99487502046ae8311c0830d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for skysegmentor 1.0.0

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

1.0.0 This release

2 release files No provenance

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