Pixel Clarity for Python#

A fast viewer for large astronomical images, mosaics, cubes and tables, in a Jupyter notebook or in a browser tab from any Python program. The data stays on the server: a process next to the kernel reads it (local files, S3 objects and URLs by range requests, arrays and tables in the kernel) and the browser receives only the tiles, rows and values it shows. A 4k × 4k detector, a mosaic of many detectors or a catalog of millions of rows stays quick to look at, even over an ordinary internet connection.

pip install pixel-clarity
import pixel_clarity as pc

pc.show("image.fits")                                       # a file on the server
pc.show("s3://bucket/path/image.asdf")                      # read where it is, no download
pc.show(array, cmap="magma", scale="asinh", limits="99.5")  # an array in the kernel
pc.rgb("red.fits", "green.fits", "blue.fits")               # three filters as color
pc.mosaic("exposure/")                                      # images placed on the sky
pc.table("catalog.parquet")                                 # sorted, filtered and plotted on the server

Every image viewer on these pages is live. Click one to pan, zoom, change the stretch, hover for values and sky coordinates, and draw regions. Each is the page the code above it writes with share(), read in your browser with nothing installed.

Where to start#

New to it? Getting started installs it and walks through a first image. Used it before? What’s new in version 0.9: pictures saved from code with pc.save_png, figures for papers and talks, and Load all for huge images. Then pick a topic from the list on the left, or one of these: