Spectral Workbench Operations
A major change in Spectral Workbench 2 is a system called Operations (previously known as PowerTags). When you save a spectrum, you usually have to perform additional operations, sometimes setting a cross section, certainly calibrating, and sometimes then smoothing or otherwise manipulating the data. But for various reasons, you often want to record and even revert some of those changes. Maybe you want to do them differently, or to recalibrate.
Operations are the new way to do this. Each time you apply an operation, the resulting dataset is saved in a snapshot, so that a copy is archived and available in the database without having to run each calculation every time. operations typically feature a
How to use operations
Creating operations is easy; the Tools menu below each spectrum guides you through creating them with simple toolpanes. Learn about using Spectral Workbench 2's tools here.
Watch this video about using Operations via the toolpanes:
calibrate:<id> - Copies calibration from spectrum with given
linearCalibration:<b2>,<g2> - Manually calibrated with two reference points
<g2>, which correspond to known positions 435.83 and 546.07, respectively. This should be the first operation, as it works best on sharp, full-width data that has not been range-limited or smoothed. However, if a
forked operation precedes it, that's acceptable.
range:<min>-<max> - Limits wavelength range to specified
<min>-<max>, in nanometers, or if data is uncalibrated, then in pixels.
smooth:<amount> - Rolling average smoothing by given #
<amount> of pixels.
subtract:<id> - Subtracts spectrum with given
<id> from the current spectrum. Should point at a specific snapshot with syntax
crossSection:<height> - Sets the row of pixels, counting
crossSection:20 would measure the brightness of each pixel in the 21st row down from the top (since we begin counting at 0). Please read this section about what the cross section represents, as it may vary based on how you are capturing.
transform:<expression> - Filters this spectrum with a math
<expression>, by running the brightness of each pixel through the math expression. More on this soon.
blend:<expression> - Filters this spectrum with a math
transform:, but in combination with data from a given second spectrum. This allows for, for example, multiplying or dividing two spectra.
Some operations don't affect the data at all; it's not clear if we're going to make these appear in the Tags listing instead. For now, these are generated automatically at various steps, and provide metadata about the spectrum, but aren't used to change the data:
forked:<id> - Spectrum is a forked copy of the Spectrum with given
<id>. Generated automatically when you fork a spectrum.
error:<amount> - Scores a calibration 'fit' by comparison to a known reference; lower is better, zero is perfect. Generated by the linear calibration tool.
calibrationQuality:<quality> - Roughly indicates how good a calibration 'fit' is, in qualitative terms
good for <12,
medium for <16 and
poor for anything higher/worse. Generated by the linear calibration tool.
The Operations framework is designed to be flexible and extensible, as we add more abilities to Spectral Workbench. Please contact the developers list with ideas and suggestions for new features and future versions, and check out Spectral Workbench on Github at https://github.com/publiclab/spectral-workbench.
Also check out our Contributing to Public Lab Software page.