Signal Viewer
The central viewer displays synchronized multi-channel PSG signal and annotation data.
Top panel

The top panel displays:
-
clock times in hourly intervals (24-hour format) across the top
-
a representation of the hypnogram, when staging data are present: NREM, REM, and wake are blue, red, and green respectively
-
a lower representation of the currently included (i.e. unmasked) epochs at the bottom
Pan/zoom navigation
You navigate across signals by clicking on this top panel. The white bar (here around 10pm or 22:00) marks the interval shown in the lower panel.
As well as using the mouse, you can use the cursor keys:
-
left/right : move one epoch (30 seconds) backward or forward in time
-
shift + left/right : move multiple epochs backward or forward
-
up/down : zoom in/out to change the span of the lower panel; unless you've Rendered the data (see below), the maximum span is 30 seconds
-
click-and-drag : if you've rendered the data, you can click and drag to select a larger time window; if you double-click within the selected region, it will return to a single-epoch view; you can also resize or drag the selected interval
Zoom and pan controls enable precise inspection of signal segments.
For continuous signals (those with more than 20 discrete values), when zooming out, at a certain point Lunascope will show the min/max per "pixel-timepoint" (i.e. the interval of time that corresponds to a single pixel on the screen); when zooming out even further, to prevent saturation, Luna will show the interquartile range (25th/75th) as approximated by a robust estimate of the standard deviation.
Rendering data
The main panel also contains some widgets for altering the view, including a Render button.
Internally, the view operates in two modes:
-
on first attaching an EDF, Lunascope loads signals directly from the in-memory EDF on an as needed basis to plot them; signals and annotations can be included or excluded from the view by clicking on the respective signal or annotation dock. In this mode, however, there is a restriction that no more than 30 seconds of signal data can be viewed at a time (there is no restriction for annotation-only views).
-
on pressing Render, Lunascope effectively takes a snapshot of the currently selected signals and annotations, then processes those data for more efficient viewing; subsequently, all items displayed are from the cached or rendered data store.
Rendering involves generating decimated (downsampled) versions of the data, with anti-alias filtering, and allows for subsequent further downsampling to enable large intervals of time to be displayed (i.e. hours) without Lunascope trying to plot millions of sample points directly (which would slow plotting).
There are three main advantages to rendering signals:
-
it allows for larger windows to be viewed efficiently
-
it allows for better Y-axis scaling of signals (see below)
-
it precomputes various summary statistics and other things that can enhance visualization (although these are not yet included in the alpha release of Lunascope)
Three things to be mindful of when using the rendering option:
-
Although rendering speeds up subsequent viewing, the process itself can take a few moments because it has to pre-process the entire dataset. Especially for large studies with many signals and high sampling rates, use this function only when needed.
-
Rendering takes a snapshot of the currently selected signals and annotations. If you want to add a new signal to the view, you need to press Render again after selecting that signal or annotation. (You can still drop, remove, and re-add already rendered signals/annotations without re-rendering.)
-
If you change the underlying signal data, for example via filtering, referencing, or rescaling in the console, those changes will not be shown directly in the rendered view. Unlike the initial unrendered view, which pulls data directly from the in-memory EDF representation, the rendered view must be refreshed manually. To indicate this, Lunascope always sets the Render button to orange after running any Luna script, as a reminder that the underlying data may have changed. If in doubt, press Render again to update the view.
Y-scaling
After rendering, the button turns from white to green to indicate that display items will now be drawn from the current snapshot. As noted, rendering also allows for different y-axis scaling:

-
by default, unrendered signals autoscale within the view window - i.e. each track will be scaled such that the minimum and maximum signal values are at the bottom/top of each track; as one scrolls left or right, the scale can change; extreme values will implicitly squash the rest of the signal to a near flat line
-
Empiric Y : after rendering, the bottom/top of each track is set to the 10th and 90th percentile of the signal value; this fixes the scale and gives a generally sensible view of most signals, which can make it more intuitive to see changes in signal amplitude while scrolling left/right; extreme values will now be drawn below or above the actual track, which means tracks can overlap
-
Clip Y : this stops overlap across channels with empiric scaling, by clipping the signal to the top/bottom of each track
Examples are these three views for the same interval and set of signals:
Default (autoscaling):

Empiric scaling:

Empiric scaling with clipping:

Other viewing options
You can also:
-
hide/show the labels for signals and annotations, through the Labels checkbox
-
set fixed Y-axis minimum and maximum values, by selecting Fixed Y and adjusting the min./max. values; note this currently applies to all signals
-
alter the scaling and spacing of each signal track;
-
spacing controls whether tracks are typically spaced (value of 1.0) versus, at the other extreme, completely overlapping (value of 0.0); it can sometimes be useful to overlay two signals to see the differences between them more clearly
-
scaling controls how many pixels each track takes up, thereby altering the display Y-axes rather than the physical-unit scaling per se; this can be useful primarily in the hd-EEG case, where one wants to view multiple interrelated signals
-
change the colors of the main view, by selecting options from the top Palette menu