Skip to content

Instantly share code, notes, and snippets.

@jywarren
jywarren / peaks.js
Last active July 25, 2016 23:43
Peak detection by Peter Davidowicz, additions by jywarren
/* Sample data:
$W.spectrum_data = {"lines":[
{"wavelength":842.3466875,"b":21,"g":13,"r":30,"average":21},
{"wavelength":841.455655089628,"b":13,"g":5,"r":22,"average":13},
{"wavelength":840.564622679257,"b":0,"g":0,"r":27,"average":9},
]
}
Now, setup a Spectral Workbench macro (although we'll keep it commented out until we're ready to deploy it):
@sixtenbe
sixtenbe / analytic_wfm.py
Last active May 1, 2024 02:29 — forked from endolith/peakdet.m
Peak detection in Python
#!/usr/bin/python2
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
#
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See