Settings and defaults#
Every keyword that sets how a view starts (the colormap, the stretch, the panels, how mosaics match their levels) is a setting. This page shows how to make your own choices the default, for this session or for good, and lists every setting with its values.
Settings as keywords#
Each setting is a keyword of pc.show, pc.rgb, pc.mosaic, pc.stack, pc.blink,
pc.table and pc.popup. It sets how the view opens; the viewer’s toolbar and panels change
it afterwards.
import pixel_clarity as pc
pc.show("image.fits", cmap="viridis", scale="asinh", limits="99.5", sidebar=False)
Your editor knows them: the keywords are typed, so autocompletion offers their names and allowed values, and a type checker flags a misspelling. A wrong value raises an error that lists the right ones:
pc.show("image.fits", cmap="virdis")
ValueError: cmap='virdis': use one of 'gray', 'heat', 'cool', 'rainbow', 'a', 'b', 'bb', 'he', 'i8', 'aips0', 'red', 'green', 'blue', 'viridis', 'magma', 'inferno', 'plasma', 'cividis', 'turbo', 'cubehelix', 'gist_heat', 'gist_earth', 'coolwarm', 'RdBu_r', 'seismic', 'twilight', 'nipy_spectral', 'hsv'
Defaults for this session#
pc.defaults holds settings applied to every new viewer. Change it like a dictionary:
pc.defaults["cmap"] = "magma"
pc.defaults.update(scale="asinh", limits="99.5")
pc.show("image.fits") # magma, asinh, 99.5%
pc.show("image.fits", cmap="gray") # a keyword still wins
pc.defaults.clear() # back to the viewer's own
Defaults for good#
pc.save_defaults does the same and also keeps your choices for later sessions. They are written
to ~/.config/pixel-clarity/defaults.json and read whenever pixel_clarity is imported.
pc.save_defaults(scale="asinh", limits="99.5", cmap="magma", sky_format="degrees")
pc.reset_defaults() # forget them
PIXEL_CLARITY_DEFAULTS names another file, handy for a project or a shared account. A setting
in the file that this version doesn’t know, or a value it doesn’t allow, is left out with a
warning rather than an error, so an old file never stops a notebook.
What’s set now#
pc.settings() lists every setting with its allowed values, the viewer’s default and yours, so
you can see at a glance what a new viewer will do:
pc.settings()
Every setting#
Setting |
Default |
What it does |
|---|---|---|
|
|
Colormap. Any of |
|
|
Invert the colormap. |
|
|
Scale function. Any of |
|
|
How the display limits are found: the data’s range, zscale, or a percentile. Any of |
|
|
Zoom: “fit” the whole image in the view, or 1 data pixel per screen pixel, centered. Any of |
|
|
Zoomed in past one data pixel per screen pixel, blend between pixel centers instead of drawing square pixels; values and readouts stay the original pixels. |
|
|
Open a file that suggests how to show it (a HiPS’s cut and stretch, color HiPS tiles as they are) that way, instead of by |
|
|
Auto enhance the image when it opens, instead of using |
|
|
Auto enhance: the sky’s brightness as a fraction of white, 0.02 to 0.35. Takes a number. |
|
|
Auto enhance: color saturation of RGB and color mosaics, 0 to 2.5. Takes a number. |
|
|
Sky coordinates in the readout. Any of |
|
|
Where regions say they are: on statistics cards, in the Regions panel and in coordinate labels. Any of |
|
|
A line from each statistics card to its region. |
|
|
Show the side panel: panner, magnifier, histogram, info. |
|
|
Show the row and column cut plots. |
|
|
RGB: the scale function and limits start linked across the three channels. |
|
|
Mosaics: the layout when none is given; “auto” picks the HEALPix plane when every image is a HiPS of one sky frame, then sky when every image has a WCS. Any of |
|
|
Mosaics: outline and label each image. |
|
|
Mosaics: show detectors still in DN/s in MJy/sr, each by its own calibration factor. |
|
|
Mosaics: shift each image’s values so the sky levels agree: each measured on its own (“local”), or compared where they overlap (“match”). Any of |
|
|
Mosaics: blend overlaps over this many pixels from each edge, 0 to 256. Takes a number. |
|
|
Mosaics: leave out this many pixels at each image’s edges, 0 to 32. Display and export only. Takes a number. |
|
|
Reload when the file changes on disk. |
|
|
Allow the SIMBAD lookup (right-click › What is this?) and the Aladin Lite panel, from the browser. |
|
|
Search radius of What is this?, in arcseconds; 0 follows the zoom. Takes a number. |
|
|
The sky survey the Aladin Lite panel opens with. Any of |
|
|
Precision of the reduced overview tiles sent to the page. ; full-resolution tiles are exact. Any of |
|
|
Tile edge in pixels. Any of |
A few keywords aren’t settings, since they belong to one call rather than to every viewer:
height, title, names, kind, layout, active, color, blink, groups, levels,
plot, state, connection, anon and out_dir. The API reference describes
each.