Skip to content

Instantly share code, notes, and snippets.

nathanathan / FastieEmissionAbsorbtion.js
Last active Dec 28, 2015 — forked from jywarren/smooth.js
Implementation of Fastie's macro for identifying emission or absorption lines. see:
View FastieEmissionAbsorbtion.js
//Implementation of Fastie's macro for identifying emission or absorption lines
To objectively determine the wavelengths of emission or absorption lines,
you have to separate signal from noise in a graph of wavelength intensities.
Especially when looking for peaks or valleys that disrupt a continuous (black body radiation) spectrum,
the low frequency (maybe > 20 nm) information becomes noise.
To eliminate it, fit a cubic spline or other easily adjustable curve to each color channel separately.
Compute the deviations of each channel from its curve and average the three new curves into a single curve,
View XLSForm.js
/* Requires underscore.js */
var SERVER_URL = "";
//The ideal approach would be to send the workbook as an xlsx blob
//and process it the same way as user uploads.
//Unfortunately I can't figure out how to generate such a blob.
function sendBlob() {
var file = DocsList.getFileById(SpreadsheetApp.getActiveSpreadsheet().getId());