Skip to main content

MOC parsing and manipulation in Python

Project description

PyPI version Build/Test status Notebook Binder Doc

mocpy's logo

MOCPy is a Python library allowing easy creation and manipulation of MOCs (Multi-Order Coverage maps).

MOC is an IVOA standard enabling description of arbitrary sky regions. Based on the HEALPix sky tessellation, it maps regions on the sky into hierarchically grouped predefined cells.

An experimental support for TMOC (temporal MOC) has been added since version 0.4.0. It allows creation, parsing and comparison of TMOCs.

Space & Time coverages (STMOC) are an extension of MOC to add time information. It is possible to get a TMOC by querying a STMOC with a MOC and/or get a MOC by querying a STMOC with a TMOC.

Please check the mocpy’s documentation for more details about installing MOCPy and using it.

For a command line tool, see the moc-cli.

For more information about the MOCPy Rust core, see the moc crate.

map to buried treasure

Rendered with MOCpy!

Migrating to version 0.12

Since 0.12.3

  • MOC.MAX_ORDER` and `TimeMOC.MAX_ORDER replace the former IntervalSet.HPX_MAX_ORDER and IntervalSet.TIME_MAX_ORDER

  • MOC.to_depth29_ranges is now a public method replacing the former private IntervalSet.nested and addition of TimeMOC.to_depth61_ranges for a time counterpart

Since v0.12.0

  • MOC.contains_skycoords and MOC.contains_lonlat replace MOC.contains (contains will be removed in v1.0.0)

  • TimeMOC.contains_with_timeresolution has been added with the previous behaviour of TimeMOC.contains

  • from_uniq` removed from `IntervalSet and added to MOC

  • MOC.from_healpix_cells now requires the max_depth argument, the depth of the MOC we want to create

  • World2ScreenMPL has been renamed WCS


We strongly recommend to work in an environnement

Latest stable version

  • from pip pip install mocpy

  • from conda conda install -c conda-forge mocpy

  • from this repository

Unreleased latest version

git clone
cd mocpy
pip install .

Note that the point is important.

To run the notebooks

The example notebooks require additional dependencies. They can be installed with

pip install mocpy[notebooks]

For use in pyodide

Wheels that run in pyodide can be downloaded from this repository assets. This is not fully tested.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mocpy-0.13.1.tar.gz (81.0 MB view hashes)

Uploaded source

Built Distributions

mocpy-0.13.1-cp312-none-win_amd64.whl (819.3 kB view hashes)

Uploaded cp312

mocpy-0.13.1-cp311-none-win_amd64.whl (819.2 kB view hashes)

Uploaded cp311

mocpy-0.13.1-cp310-none-win_amd64.whl (819.2 kB view hashes)

Uploaded cp310

mocpy-0.13.1-cp39-none-win_amd64.whl (819.6 kB view hashes)

Uploaded cp39

mocpy-0.13.1-cp38-none-win_amd64.whl (819.4 kB view hashes)

Uploaded cp38

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page