[chronojump] Fixed bad force/power at end of concentric on inertial signals. Saved reps were ok, signal not. Reas



commit 5d6284fac0fc6ada69e0a5c2721ac6cc387d5d7b
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Dec 18 01:39:03 2015 +0100

    Fixed bad force/power at end of concentric on inertial signals. Saved reps were ok, signal not. Reason: 1 
extra pixel at right

 encoder/graph.R |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 815b547..7692dd7 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -389,6 +389,50 @@ findCurvesNew <- function(displacement, eccon, isInertial, min_height, draw, tit
                for(i in 1:length(startStored)) {
                        startStored[i] = ceiling(startStored[i])
                }
+
+               #When we have this
+               #        _
+               #       / \ 
+               #      /   \
+               #     /     \
+               #- - - - - - - - -
+               #   /         \
+               #  /           \
+               # /             \
+               #getDisplacementInertialBody converts it to:
+               #
+               #
+               #
+               #   AB      CD
+               #- - - - - - - - -
+               #   / \     / \
+               #  /   \   /   \
+               # /     \_/     \
+               #
+               #AB are two points of same position.
+               #note that first ascending phase will be cutted by findCurvesNew in B
+               #and then this will mean a big change in direction at the end (going up to a 
pixel-change-to-horizontal)
+               #splines are very problematic if there are pixel changes at the end
+               #so, make end in A
+
+               for(i in 1:length(endStored)) {
+                       #endStored[i] = floor(endStored[i])
+
+                       #this if does not work because sometimes the difference is very tiny
+                       #       print(position[endStored[i]])
+                       #       [1] -0.29
+                       #       print(position[(endStored[i] -1)])
+                       #       [1] -0.29
+                       #       position[endStored[i]] == position[(endStored[i] -1)]
+                       #       FALSE
+                       #       print(position[endStored[i]] - position[(endStored[i] -1)])
+                       #       [1] 1.965095e-14
+                       #
+                       #if(position[endStored[i]] == position[(endStored[i] -1)]) {
+                       #       endStored[i] = endStored[i] -1
+                       #}
+                       endStored[i] = endStored[i] -1
+               }
        }
 
        if(draw) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]