'linear_calibration' by warren


Report abuse

Created on August 13, 2013 15:53 | Updated over 6 years ago

Link: https://gist.github.com/jywarren/6222616

A macro for linear calibration based on Chris Fastie's: http://spectralworkbench.org/macro/cfastie/CalibrateTemplate. Enter the pixel distance to each peak (zero left), and the known wavelengths for the 2 peaks.

setup: function() { 
  // code to run on startup 
  $W.calibrate($W.spectrum_id,prompt("Enter pixel position A, counting from the left:"),prompt("Enter wavelength at pixel position A:"),prompt("Enter pixel position B, counting from the left:"),prompt("Enter wavelength at pixel position A:")) 
}, 
draw: function() { 
  // code to run every frame 
}