From 6a312409c32a7e53e26ae9f80e417c59c7ded54b Mon Sep 17 00:00:00 2001 From: Taha Ahmed Date: Fri, 15 Apr 2011 11:53:23 +0200 Subject: [PATCH] Removed re-calc to evenly spaced shift from Raman2df(). The first test showed that such an approach would not work (see comment in Raman2df()). --- Renishaw.R | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Renishaw.R b/Renishaw.R index 555f545..a9af43b 100644 --- a/Renishaw.R +++ b/Renishaw.R @@ -36,12 +36,10 @@ Raman2df <- function(datafilename) { ff <- ff[order(ff$shift), ] # And fix the row.names row.names(ff) <- seq(1, dim(ff)[1]) - # Re-calculate the spectrum with evenly spaced points - # (so that the peak-finding algorithms of diffractometry package may be used) - ff$cshift <- approx(x = ff$shift, y = ff$counts, - method = "linear", n = length(ff$shift))$x - ff$ccounts <- approx(x = ff$shift, y = ff$counts, - method = "linear", n = length(ff$shift))$y + # Do not re-calculate the spectrum with evenly spaced points here! + # You must first remove cosmic peaks, and as long as that is done + # manually, re-calculation to evenly spaced shifts must also be + # done manually. ## return(ff) }