{"id":15879116,"url":"https://github.com/simonsobs/psplay","last_synced_at":"2026-01-20T18:56:11.300Z","repository":{"id":52497261,"uuid":"266806675","full_name":"simonsobs/psplay","owner":"simonsobs","description":"Interactive power spectrum code","archived":false,"fork":false,"pushed_at":"2023-09-13T18:52:08.000Z","size":442,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-14T14:17:28.330Z","etag":null,"topics":["cmb","jupyterlab-extension","leaflet"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonsobs.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-05-25T14:53:59.000Z","updated_at":"2024-01-16T22:43:01.000Z","dependencies_parsed_at":"2022-09-12T13:43:02.283Z","dependency_job_id":"e3ff6896-7888-4c76-93f7-c131638c7db0","html_url":"https://github.com/simonsobs/psplay","commit_stats":{"total_commits":143,"total_committers":3,"mean_commits":"47.666666666666664","dds":0.04195804195804198,"last_synced_commit":"a2471dcf1f05750eff905908cc71c4712e698f99"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Fpsplay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Fpsplay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Fpsplay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonsobs%2Fpsplay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonsobs","download_url":"https://codeload.github.com/simonsobs/psplay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247655024,"owners_count":20974112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmb","jupyterlab-extension","leaflet"],"created_at":"2024-10-06T03:00:49.545Z","updated_at":"2026-01-20T18:56:11.289Z","avatar_url":"https://github.com/simonsobs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. raw:: html\n\n      \u003cimg src=\"https://user-images.githubusercontent.com/2495611/80969621-33593680-8e1a-11ea-9692-39e63e9804d8.png\" height=\"400px\"\u003e\n\nA tool to visualize and play with CMB maps. ``psplay`` is a ``jupyter`` extension to allow\ninteractive visualization of CMB maps through `Leaflet \u003cleafletjs.com\u003e`_ library. ``psplay`` also\nprovides a set of tools based on `pspy \u003chttps://github.com/simonsobs/pspy\u003e`_ to compute and to show\nCMB power spectra. You can have a better idea of what ``psplay`` can do by watching this short\n`video \u003chttps://www.youtube.com/watch?v=5IpHZ4WWf2Q\u003e`_.\n\nAll the specific javascript library developed for ``psplay`` is done by `Sigurd Naess\n\u003chttps://github.com/amaurea\u003e`_.  The build process and javascript architecture is highly inspired by\n`ipyleaflet \u003chttps://github.com/jupyter-widgets/ipyleaflet\u003e`_ project.\n\n.. image:: https://img.shields.io/pypi/v/psplay.svg?style=flat\n   :target: https://pypi.python.org/pypi/psplay/\n.. image:: https://img.shields.io/npm/v/jupyter-leaflet-car\n   :target: https://www.npmjs.com/package/jupyter-leaflet-car\n.. image:: https://img.shields.io/github/actions/workflow/status/simonsobs/psplay/main.yml\n   :target: https://github.com/simonsobs/psplay/actions\n\nExamples\n--------\n\n* `From simulated CAR map to psplay \u003chttps://github.com/xgarrido/psplay/blob/master/examples/car_simulation_to_analysis.ipynb\u003e`_\n* `From HEALPIX map file to psplay \u003chttps://github.com/xgarrido/psplay/blob/master/examples/healpix_simulation_to_analysis.ipynb\u003e`_\n\nInstallation\n------------\n\nTo install, you will need to have or to install ``numpy``. Then, run\n\n.. code:: shell\n\n   $ pip install psplay [--user]\n\n``psplay`` runs within a Jupyter notebook and we recommend to use JupyterLab to fully enjoy ``psplay``\n\nTo enable the extension within Jupyter, you will need to install several JupyterLab extensions\nespecially the Python ``plotly`` `library \u003chttps://plotly.com/python\u003e`_ and the Jupyter `widgets\n\u003chttps://github.com/jupyter-widgets/ipywidgets\u003e`_. You will also need `nodejs library\n\u003chttps://nodejs.org/en\u003e`_ and its package manager ``npm``. For JupyterLab \u003e 2.0.0, you can do\n\n.. code:: shell\n\n   $ jupyter labextension install plotlywidget jupyterlab-plotly\n   $ jupyter labextension install @jupyter-widgets/jupyterlab-manager @jupyter-widgets/jupyterlab-sidecar\n\n\nFinally, you need to install the `jupyter-leaflet-car \u003chttps://www.npmjs.com/package/jupyter-leaflet-car\u003e`_ extension\n\n.. code:: shell\n\n   $ jupyter labextension install jupyter-leaflet jupyter-leaflet-car\n\nUsing ``docker``\n----------------\n\nGiven the number of requirements, you can use a ``docker`` image already made with the needed\nlibraries and everything compiled and installed. You should first install `docker\n\u003chttps://docs.docker.com/install/\u003e`_ for your operating system.\n\nThen, you can run the ``simonsobs/psplay`` image by doing\n\n..\n   $ docker run --rm -p 8888:8888 ghcr.io/simonsobs/psplay:master\n\n.. code:: shell\n\n   $ docker run --rm -p 8888:8888 simonsobs/psplay:latest\n\nAfter pulling the ``docker`` image, a JupyterLab instance should start. If your web browser does not\nautomatically load the web page, you can copy-paste the JupyterLab URL.\n\nYou can bind a local directory to make it available within the ``docker`` container with the ``-v``\nflag (see https://docs.docker.com/storage/bind-mounts for more details).\n\n..\n   Using at ``NERSC``\n   ------------------\n\n   On NERSC machines, you can install ``psplay`` within a ``conda`` environment but you can also use a\n   common installation for Simons Observatory people (*i.e.* people belonging to ``sobs`` group)\n   without need to redo the long installation process.\n\n   First you need to log to ``cori.nersc.gov`` machines by enabling port forward to your local machine\n\n   .. code:: shell\n\n      $ ssh -L 8888:localhost:8888 user@cori.nersc.gov\n\n   Everything passing *via* port 8888 in ``NERSC`` will be forwarded to your local machine and you will\n   be able to grab the JupyterLab instance within your local web browser.\n\n   Given a successful connection, you must load the latest ``python`` module\n\n   .. code:: shell\n\n      $ module load python\n\n   and then you can load the ``conda`` environment with the whole software suite for ``psplay``\n\n   .. code:: shell\n\n      $ source activate /global/cscratch1/sd/xgarrido/psplay/env\n\n   Finally, you can copy the ``/global/cscratch1/sd/xgarrido/psplay/examples/minimal`` directory to\n   your home or scratch directory. For example purpose, this directory holds simulation files already\n   converted into ``Leaflet`` tiles. Then, fire a JupyterLab instance by typing\n\n   .. code:: shell\n\n      $ cd /your/owned/directory\n      $ cp -r /global/cscratch1/sd/xgarrido/psplay/examples/minimal .\n      $ jupyter lab --port 8888 --no-browser minimal_working_example.ipynb\n\n   Copy-paste the URL into your local browser and run the Jupyter notebook.\n\n   If port 8888 is already in use, JupyterLab will try another one and then breaks the port forward. In\n   this case you should restart the ssh session with another port.\n\nInstallation from sources\n-------------------------\n\nFor a development installation (requires `npm \u003chttps://www.npmjs.com/get-npm\u003e`_)\n\n.. code:: shell\n\n   $ git clone https://github.com/xgarrido/psplay.git\n   $ cd psplay\n   $ pip install -e .\n\nIf you are using the classic Jupyter Notebook you need to install the nbextension:\n\n.. code:: shell\n\n   $ jupyter nbextension install --py --symlink --sys-prefix psplay\n   $ jupyter nbextension enable --py --sys-prefix psplay\n\nIf you are using JupyterLab, you need to install the labextension:\n\n.. code:: shell\n\n   $ jupyter labextension install @jupyter-widgets/jupyterlab-manager js\n\nNote for developers:\n\n- the ``-e`` pip option allows one to modify the Python code in-place. Restart the kernel in order\n  to see the changes.\n- the ``--symlink`` argument on Linux or OS X allows one to modify the JavaScript code\n  in-place. This feature is not available with Windows.\n\nFor automatically building the JavaScript code every time there is a change, run the following\ncommand from the ``psplay/js/`` directory:\n\n.. code:: shell\n\n   $ npm run watch\n\n\nIf you are on JupyterLab you also need to run the following in a separate terminal:\n\n.. code:: shell\n\n   $ jupyter lab --watch\n\n\nEvery time a JavaScript build has terminated you need to refresh the Notebook page in order to load\nthe JavaScript code again.\n\nAuthors\n-------\n\n* Xavier Garrido\n* Thibaut Louis\n* Sigurd Naess\n\nThe code is part of `PSpipe \u003chttps://github.com/simonsobs/PSpipe\u003e`_ the Simons Observatory power spectrum pipeline.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsobs%2Fpsplay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonsobs%2Fpsplay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonsobs%2Fpsplay/lists"}