Skip to content

Instantly share code, notes, and snippets.

@jywarren
Created August 13, 2013 15:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jywarren/6222616 to your computer and use it in GitHub Desktop.
A macro for linear calibration based on Chris Fastie's: http://spectralworkbench.org/macro/cfastie/CalibrateTemplate, https://gist.github.com/Fastie/5109944. 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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment