Skip to content

Command Reference

Below is 1) a list of command domains, and 2) a full list of all commands.

The pages that are linked to describe the Luna command language, which can be used either via the terminal-based lunaC tool or the R extension library lunaR. Under each section, we tabulate the relevant commands, along with their input parameters and output variables. We give examples using a mixture of lunaC and lunaR; also see lunaC's help function.


Domain/Section Description
Summaries Basic summary commands
Annotations Adding and displaying annotations
Expressions Evaluating more advanced annotation-based expressions
Epochs Epoching signals and epoch-level annotations
Masks Masking epochs based on annotations and other criteria
Freezes Working with dataset freezes (snaphots)
Canonical signals Harmonizing EDFs through canonical signal specification
Manipulations Manipulating signal data
Alignment Utilities to align data across EDFs
Outputs Commands to output signals in different formats
FIR filters FIR filter design and application
Artifacts Artifacts detection/correction routines
Hypnograms Characterizations of hypnograms
POPS Sleep staging & evaluation
Time/frequency analyses Power spectral density estimation and other T/F decompositions
Spindles and SO Spindles and slow oscillations
Coupling/connectivity Phase/amplitude coupling, coherence and other multi-signal analyses
Interval-based Time/event-locked signal averaging, peak detection, enrichment
Spatial/topographical Channel locations, spatial filtering and interpolation
PSC Principal spectral components
ICA/PCA Independent components and principal components analyses
MS EEG microstate analysis
Clustering Time-series clustering
Association Association analysis (linear models)
Prediction Prediction models
Simulation Simulation of time-series data
Helpers Auxiliary helper commands
Experimental Experimental features, under heavy development / for internal use only

All commands

Summaries: DESC: simple EDF description, SUMMARY: EDF description, HEADERS: EDF header information; CONTAINS: Indicate whether signals present, ALIASES: show channel/annotation aliases, TYPES: show channel types, VARS: show individual-level variables, TAG: add output tags, STATS: basic signal statistics, SIGSTATS: signal Hjorth parameters, TABULATE: tabulate signal values, DUPES: check for signal duplicates. Annotations: Formats: overview of annotations, --xml & --xml2: view NSRR XMLs, REMAP: remap annotations, ANNOTS: tabulate annotations, MAKE-ANNOTS: make new annotations, WRITE-ANNOTS: write annotation files, SPANNING: annotation coverage stats, A2S: make signal from annotation, S2A: make annotation from signal. Expressions: Expressions: overview of expressions, EVAL: annotation-based expressions, TRANS: channel-based expressions. Epochs: EPOCH: specify epochs, EPOCH-ANNOT: attach epoch annotations. Masks: MASK: mask epochs, DUMP-MASK: output epoch masks, RESTRUCTURE: remove masked epochs, CHEP: channel/epoch masks. Freezes & caches: FREEZE: freeze snapshot, THAW: revive a prior freeze, CACHE: cache operations. Canonical signals: CANONICAL: make canonical signals. Manipulations: SIGNALS: drop signals, RENAME: rename signals, COPY: copy signals, RESAMPLE: resample signals, ENFORCE-SR: check for sufficient sample rate, REFERENCE: re-reference signals, DEREFERENCE: de-reference signals, MINMAX: set channel min/max, uV: force microvolts, mV: force millivolts, TIME-TRACK: add time-track, FLIP: flip signal, ZC: zero-center signal, ROBUST-NORM: robust normalization, EDF: force basic EDF, RECORD-SIZE: change record size, ALIGN: realign records, ANON: anonymize EDF, SET-HEADERS: set EDF headers, SET-VAR: set Luna variables, SET-TIMESTAMPS: set EDF record time, RECTIFY: rectify a signal, REVERSE: reverse a signal, MOVING-AVERAGE: moving average filters. Alignment: ALIGN-EPOCHS: align two EDFs, ALIGN-ANNOTS: align annotations, INSERT: insert new channels. Outputs: WRITE: write EDF, MATRIX: signals to text, HEAD: signals snippet to text, DUMP-RECORDS: dump by record, RECS: info on EDF record structure, SEGMENTS: continuous intervals, SEDF: write summary EDF, Filters: FILTER: apply FIR, FILTER-DESIGN: FIR properties. Artifacts: CHEP-MASK: CHannel/EPoch masking, ARTIFACTS: bad EEG epochs, LINE-DENOISE: line denoising, SUPPRESS-ECG: correct ECG artifact, ALTER: correct artifacts, EDGER: identify leading/trailing noise. Hypnograms: HYPNO: stage summaries, STAGE: dump stages. SOAP: SOAP: single observation & probabilities, REBASE: change epoch length, PLACE: align stages, POPS: POPS: predict sleep stages, EVAL-STAGES: evaluate external stages, --eval-stages: evaluate external stages, --pops: train model. Time/frequency analysis: PSD: Welch PSD, MTM: Multi-taper PSD, FFT: Fourier transform, IRASA: IRASA spectral analysis, HILBERT: Hilbert transform, CWT: wavelet transform, CWT-DESIGN: CWT properties, EMD: Empirical mode decompositon, MSE: Multi-scale entropy, LZW: LZW compression, 1FNORM: remove the 1/f trend, TV: total variation denoiser, ACF: autocorrelation function Spindles and SO: SPINDLES: spindles, SO: slow oscillations. Coupling/connectivity: COH: coherence, CORREL: correlation, CC: phase-amplitude coupling & phase lag, PSI: phase slope index, MI: mutual information, XCORR: cross-correlation, TSYNC: cross-correlation & phase delay, GP: Granger prediction. Interval-based: OVERLAP: single-sample overlap analysis, --overlap: multi-sample overlap analysis, MEANS: signal mean by annotation, PEAKS: detect/cache peaks, Z-PEAKS: detect/cache peaks (Z method), TLOCK: time-locked averaging. PSC: --psc: estimate components, PSC: project new samples. Spatial/topographical: CLOCS: set channel locations, SL: surface Laplacian, INTERPOLATE: epoch/channel interpolation. ICA: ICA: fit ICA, ADJUST: adjust given ICs, SVD: fit SVD/PCA. Microstates: MS: EEG microstates, --kmer: sequence motifs, --cmp-maps: group/indiv map spatial analysis, --label-maps: label maps given a template, --correl-maps: spatial correlations. Clustering: EXE: time-series clustering. Association: CPT: association models. Prediction: PREDICT: prediction models. Simulation: SIMUL: simulate signals, SIGGEN: basic signal simulation. Helpers: --build: build sample-lists, --repath: alter sample-lists, --merge: merge EDFs, --xml: view XMLs, --xml2: dump EDFs (raw), --otsu: Otsu thresholding (file), OTSU: Otsu thresholding (EDF). Experimental: Various: misc. experimental commands.


to add


POL polarity



to add/remove?



Back to top