Skip to main content

A Jupyter widget for playing with CAR Leaflet maps

Project description

A tool to visualize and play with CMB maps. psplay is a jupyter extension to allow interactive visualization of CMB maps through Leaflet library. psplay also provides a set of tools based on pspy to compute and to show CMB power spectra.

https://img.shields.io/pypi/v/psplay.svg?style=flat

All the specific javascript library developed for psplay is done by Sigurd Naess. The build and javscript architecture is highly inspired by ipyleaflet project.

To convert CMB map from FITS format to tile images you will also need this kind of program.

Installation

Using pip:

$ pip install psplay [--user]

To enable the extension within Jupyter, you will need to install several JupyterLab extensions especially the Python plotly library. For JupyterLab > 2.0.0, you can do

$ jupyter labextension install @plotlywidget@4.6.0 jupyterlab-plotly@4.6.0

Finally, you need to install the jupyter-leaflet-car and the support for widgets in Jupyter

$ jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-leaflet-car

Installation from sources

For a development installation (requires npm)

$ git clone https://github.com/xgarrido/psplay.git
$ cd psplay
$ pip install -e .

If you are using the classic Jupyter Notebook you need to install the nbextension:

$ jupyter nbextension install --py --symlink --sys-prefix psplay
$ jupyter nbextension enable --py --sys-prefix psplay

If you are using JupyterLab, you need to install the labextension:

$ jupyter labextension install @jupyter-widgets/jupyterlab-manager js

Note for developers:

  • the -e pip option allows one to modify the Python code in-place. Restart the kernel in order to see the changes.

  • the --symlink argument on Linux or OS X allows one to modify the JavaScript code in-place. This feature is not available with Windows.

For automatically building the JavaScript code every time there is a change, run the following command from the psplay/js/ directory:

$ npm run watch

If you are on JupyterLab you also need to run the following in a separate terminal:

$ jupyter lab --watch

Every time a JavaScript build has terminated you need to refresh the Notebook page in order to load the JavaScript code again.

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

psplay-0.0.0.tar.gz (788.5 kB view hashes)

Uploaded Source

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