pyredshift help

Mouse

InputAction
click (or SPC or A)show wavelength at cursor
dragrubber-band zoom, like e — a purely horizontal drag zooms X only; purely vertical, Y only
right-clickquick line menu — pick a line to set the redshift at that position (same as ESC + shortcut key)

Redshift

KeyAction
ESC keymark known line at cursor via shortcut key (see below; backquote works as ESC)
ESC ESCrefine redshift using nearest line
gguess redshift (enter wavelength of probable line)
=enter redshift directly
rremove features from plot

Shortcut keys after ESC:

KeyLineKeyLine
lLyα 1216gG 4304
cCIV 1549bHβ 4861
mMgII 2800O[OIII] 5007
o[OII] 3727dNaD 5892
kK 3933aHα 6563
hH 3969

Pan / zoom

KeyAction
[ ]pan left/right
z / uzoom / unzoom X axis
i / ozoom / unzoom Y axis ("in" / "out")
x / yset X range / Y range (two cursor picks)
eexpand plot (two corner picks)
wwhole X range
aautoscale Y axis
hhome — restore initial display range
ddisplay again

Analysis

KeyAction
_continuum fit and estimate noise
mmeasure EW/flux of line (define continuum first)
bplot binned up spectrum
splot smoothed spectrum
toverlay template spectrum (currently {template})
kkill nearest line from list
Bbodge cosmic rays/sky by replacing with ZERO

Other

KeyAction
pprint to PDF (pyredshift.pdf)
?this help
qquit

Line list

All wavelengths are VACUUM, in Ångstroms (from pyredshift.lines, colours as plotted):

{linelist}

Guide

pyredshift is a tool for measuring the redshift of a galaxy or quasar from a 1D spectrum, by eye. Run it as pyredshift file — the format (FITS image or table, SDSS, JWST, XSHOOTER, OutThere, CSV, 2-column ascii) is auto-detected, with -f to force one, -z to start from a known redshift and --retro for a retro PGPLOT-style black background. It plots the spectrum histogram-style with a crosshair cursor, and overlays rest-frame line identifications that follow the trial redshift shown at top left.

The basic game: spot a feature you can identify, put the crosshair on it and press ESC then the line's shortcut key (or g to type any rest wavelength) — the line labels jump to that redshift. Now check the other features line up, panning and zooming (mouse drag works), binning (b) or smoothing (s) to dig in the noise, and refining with ESC ESC on the sharpest line. Along the way you can fit a continuum (_) and measure equivalent widths and line fluxes (m), and print to PDF (p). q quits and reports the final redshift to the terminal. It is the Python descendant of Karl's venerable redshift.f (Fortran, 1990s) via pdlredshift (Perl/PDL).

From a Jupyter notebook, call pyredshift.redshift.redshift(wave, flux) with numpy arrays: the interactive window opens outside the notebook, and when you quit the final view is embedded in the cell and the redshift returned.