def loadData(self, magneticData, direction = 1):
     self.standard   = magneticData[0]
     self.sampleSize = len(self.standard)
     data            = []
     for line in magneticData:
         diff, path = dtwDistance(self.standard, line)
         lineData   = dtwExtend(line, path)
         data.append(lineData)
     self.data = data
    def load(self, fileList):
        loader          = DataLoader()
        self.standard   = loader.read(fileList[0])
        self.sampleSize = len(self.standard)
        data            = []
        # extend all data to same length
        for dataFile in fileList:
            line       = loader.read(dataFile)
            dist, path = dtwDistance(self.standard, line)
            lineData   = dtwExtend(line, path)
            data.append(lineData)

        self.data = data
Esempio n. 3
0
def testGraphing():
    testdata = config.data['datafile']['test']
    dl = DataLoader()
    l = dl.read(testdata[0])
    l2 = dl.read(testdata[1])
    l3 = dl.read(testdata[2])
    ml = MagneticLine()
    dist, path = dtwDistance(l, l2)
    lineData = dtwExtend(l2, path)

    print path
   # l = np.array(l)
    # l1 = np.kron(l, [0.5, 0.5])
    # l2 = np.kron(l, [1, 1])
    # l3 = np.kron(l, [1.5, 1.5])

    # l2 = np.array(l2)
    # l2 = np.kron(l2, [1,2])
    ml.addLine(l, "a0")
    # ml.addLine(l1, "a1")
    ml.addLine(l2, "a1")
    ml.addLine(lineData, "b0")
    ml.show()