Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.
Daniel Patrick Foose edited this page Oct 18, 2016 · 6 revisions

The Vespucci macro system allows for the automation and reproduction of common processing and analysis techniques. Analysis methods can only be applied to one dataset.

Dataset History

History Viewer

The history of operations performed on the active dataset is displayed in the History Viewer. This can be accessed from the Window menu in the menu bar.

Macro Language

The names of Vespucci macro commands mirror those of the VespucciDataset class in the C++ API. In the list of valid commands below, the parameters are preceeded by their types. UInt refers to an unsigned integer, Int refers to a signed integer, String refers to a string (an array of characters), Bool refers to a boolean value (either true or false), and Double refers to a double-precision floating point number (a real, rational number that may or may not be an integer). Presenting a function with an invalid type will prevent the entire macro from executing. If a macro function call is incorrect, a dialog box will explain which parameter of which line is incorrect.

Macro Syntax

Each line must consist of one function call. Lines are not ended in semicolons. Commas separate parameters. You should not use quotes around string literals.

Normalization

MinMaxNormalize()
MeanCenter()
ZScoreNormalize()
AbsoluteValue()
VectorNormalize(UInt p)
PeakIntensityNormalize(Double lower, Double upper)
Scale(Double a)

Smoothing

MedianFilter(UInt window)
SavitzkyGolay(UInt derivOrder, UInt polyOrder, UInt windowSize)
LinearMovingAverage(UInt windowSize)

Baseline

MFBaseline(UInt windowSize, UInt iterations)
IModPolyBaseline(UInt polyOrder, UInt maxIterations, Double threshold)

Other pre-processing

QUIC_SVD(Double alpha)
SingularValue(UInt new_rank)
ShedSpectrum(UInt ind)
ZeroSpectrum(UInt ind)
ShedZeroSpectra()
ShedZeroWavelengths()
Booleanize(Double min, Double max, Bool keepInside, Bool oneify)
Clamp(Double min, Double max)
ZeroFlatSpectra(Double threshold)
ZeroClippedSpectra(Double threshold)
RemoveClippedSpectra(Double threshold)
RemoveFlatSpectra(Double threshold)

Analysis

Univariate(String name, Double min, Double max, UInt searchWindow)
BandRatio(String name, Double firstMin, Double firstMax, Double secondMin, Double secondMax, UInt searchWindow)
PartialLeastSquares(String name, UInt components)
VertexComponents(String name, UInt components)
PrincipalComponents(String name)
KMeans(String name, UInt components)

Editing, Importing, and Exporting Macros

Macro Editor Macros can be run on the active dataset or on all datasets in the workspace. Macros are saved as raw .txt files. Vespucci will save macros with Unix line endings ("\n") on all platforms, which may make editing macros in the "text editor" that comes with Windows difficult. Check out Notepad++, Atom, Visual Studio Code or, if you're really serious, Vim. Vespucci can load files with the wrong line endings, so it isn't really a big deal.