library(cluster) # pam
#library(flexclust) # kcca
source("aux.r") # auxiliary clustering functions
+
+#TODO: [plus tard] alternative à sowa (package disparu) : cwt..
source("sowas-superseded.r") # auxiliary CWT functions
## 1. Read auxiliar data files ####
#synchros09 <- t(as.matrix(read.table("~/tmp/2009_synchros200-random.txt")))
nas <- which(is.na(synchros09)[, 1]) # some 1/1/2009 are missing
-synchros09[nas, 1] <- rowMeans(synchros09[nas, 2:4])
+synchros09[nas, 1] <- rowMeans(synchros09[nas, 2:4]) #valeurs après 1er janvier
+#moyenne pondérée pour compléter deux demi-heures manquantes
imput09 <- synchros09[, 4180:4181] %*% matrix(c(2/3, 1/3, 1/3, 2/3), 2)
synchros09 <- cbind(synchros09[, 1:4180], imput09, synchros09[, 4181:17518])
# scalevector4 <- 2^(4:(noctave4 * nvoice) / nvoice) * 2
# lscvect4 <- length(scalevector4)
# lscvect <- lscvect4 # i should clean my code: werFam demands a lscvect
+
+
+#17000 colonnes coeff 1, puis 17000 coeff 2... [non : dans chaque tranche du cube]
+
+#TODO: une fonction qui fait lignes 59 à 91
+
+#cube:
# Xcwt4 <- toCWT(conso, noctave = noctave4, dt = 1,
# scalevector = scalevector4,
# lt = delta, smooth = FALSE,
# nvoice = nvoice) # observations node with CWT
#
-# #Xcwt2 <- matrix(0.0, nrow= n, ncol= 2 + delta * lscvect)
+# #matrix:
+# ############Xcwt2 <- matrix(0.0, nrow= n, ncol= 2 + delta * lscvect)
# #Xcwt2 <- matrix(NA_complex_, nrow= n, ncol= 2 + length((c(Xcwt4[,,1]))))
#
+# #NOTE: delta et lscvect pourraient etre gardés à part (communs)
# for(i in 1:n)
# Xcwt2[i,] <- c(delta, lscvect, Xcwt4[,,i] / max(Mod(Xcwt4[,,i])) )
#