Skip to main content

MOC parsing and manipulation in Python

Project description

*****
MOCPy
*****
|PyPI version| |Build/Test status| |Notebook Binder| |Doc|

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 <https://cds-astro.github.io/mocpy/>`__
for more details about installing MOCPy and using it.

For a command line tool, see the `moc-cli <https://github.com/cds-astro/cds-moc-rust/tree/main/crates/cli>`__.

For more information about the MOCPy Rust core, see the `moc crate <https://crates.io/crates/moc>`__.

.. figure:: ./resources/readme.png
:scale: 50 %
:align: center
:alt: map to buried treasure

*Rendered with MOCpy!*

.. |PyPI version| image:: https://badge.fury.io/py/mocpy.svg
:target: https://badge.fury.io/py/MOCPy

.. |Build/Test status| image:: https://github.com/cds-astro/mocpy/actions/workflows/test.yml/badge.svg
:target: https://github.com/cds-astro/mocpy/actions/workflows/test.yml

.. |Notebook Binder| image:: http://mybinder.org/badge.svg
:target: https://mybinder.org/v2/gh/cds-astro/mocpy/master

.. |Doc| image:: https://img.shields.io/badge/Documentation-link-green.svg
:target: https://cds-astro.github.io/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``

Installation
------------

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

.. code::

git clone https://github.com/cds-astro/mocpy.git
cd mocpy
pip install .

Note that the point is important.

Developpement version
*********************

.. code::

git clone -b develop https://github.com/cds-astro/mocpy.git
cd mocpy
pip install .

For use in pyodide
******************

Wheels that run in pyodide can be downloaded from `this repository assets <https://github.com/cds-astro/mocpy/releases/download/v0.12.3/mocpy-0.12.3-cp310-cp310-emscripten_3_1_27_wasm32.whl>`__. This is not fully tested.

Project details


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.0.tar.gz (79.0 MB view hashes)

Uploaded Source

Built Distributions

mocpy-0.13.0-cp312-cp312-musllinux_1_2_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ x86-64

mocpy-0.13.0-cp312-cp312-musllinux_1_2_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ i686

mocpy-0.13.0-cp312-cp312-musllinux_1_2_aarch64.whl (1.4 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ ARM64

mocpy-0.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (936.6 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

mocpy-0.13.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

mocpy-0.13.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (867.1 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

mocpy-0.13.0-cp311-none-win_amd64.whl (847.9 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

mocpy-0.13.0-cp311-cp311-musllinux_1_2_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ x86-64

mocpy-0.13.0-cp311-cp311-musllinux_1_2_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ i686

mocpy-0.13.0-cp311-cp311-musllinux_1_2_aarch64.whl (1.4 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ ARM64

mocpy-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (936.6 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

mocpy-0.13.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

mocpy-0.13.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (867.1 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

mocpy-0.13.0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.7 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

mocpy-0.13.0-cp311-cp311-macosx_10_7_x86_64.whl (891.2 kB view hashes)

Uploaded CPython 3.11 macOS 10.7+ x86-64

mocpy-0.13.0-cp310-none-win_amd64.whl (847.9 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

mocpy-0.13.0-cp310-cp310-musllinux_1_2_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ x86-64

mocpy-0.13.0-cp310-cp310-musllinux_1_2_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ i686

mocpy-0.13.0-cp310-cp310-musllinux_1_2_aarch64.whl (1.4 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ ARM64

mocpy-0.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (936.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

mocpy-0.13.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

mocpy-0.13.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (867.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

mocpy-0.13.0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.7 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

mocpy-0.13.0-cp310-cp310-macosx_10_7_x86_64.whl (891.2 kB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

mocpy-0.13.0-cp39-none-win_amd64.whl (848.3 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

mocpy-0.13.0-cp39-cp39-musllinux_1_2_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ x86-64

mocpy-0.13.0-cp39-cp39-musllinux_1_2_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ i686

mocpy-0.13.0-cp39-cp39-musllinux_1_2_aarch64.whl (1.4 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ ARM64

mocpy-0.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (937.0 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

mocpy-0.13.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

mocpy-0.13.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (867.2 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

mocpy-0.13.0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.7 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

mocpy-0.13.0-cp39-cp39-macosx_10_7_x86_64.whl (891.5 kB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

mocpy-0.13.0-cp38-none-win_amd64.whl (848.4 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

mocpy-0.13.0-cp38-cp38-musllinux_1_2_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ x86-64

mocpy-0.13.0-cp38-cp38-musllinux_1_2_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ i686

mocpy-0.13.0-cp38-cp38-musllinux_1_2_aarch64.whl (1.4 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ ARM64

mocpy-0.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (936.5 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

mocpy-0.13.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

mocpy-0.13.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (868.2 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

mocpy-0.13.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.7 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

mocpy-0.13.0-cp38-cp38-macosx_10_7_x86_64.whl (891.7 kB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

mocpy-0.13.0-cp37-none-win_amd64.whl (848.4 kB view hashes)

Uploaded CPython 3.7 Windows x86-64

mocpy-0.13.0-cp37-cp37m-musllinux_1_2_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.2+ x86-64

mocpy-0.13.0-cp37-cp37m-musllinux_1_2_aarch64.whl (1.4 MB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.2+ ARM64

mocpy-0.13.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (936.6 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

mocpy-0.13.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (868.1 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

mocpy-0.13.0-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (1.7 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

mocpy-0.13.0-cp37-cp37m-macosx_10_7_x86_64.whl (891.6 kB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

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