Esempio n. 1
0
    def test_ConvolveGaussian(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')

        analysis = libHrlAnalysis.HrlNeuralAnalysisHRLSim(
            0, 4000, 26200, 28199, fileNames)
Esempio n. 2
0
    def test_ConvolveGaussian(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')

        analysis = libHrlAnalysis.HrlNeuralAnalysisHRLSim(0,4000,26200,28199,
                                                          fileNames)
Esempio n. 3
0
 def __init__(self, startTime, endTime, spkFile, posFile):
     libHrlAnalysis.HrlNeuralAnalysis.__init__(self,0,0,0,0,libHrlAnalysis.vector_string())
     self.paramsIn().startTime = startTime
     self.paramsIn().endTime = endTime
     self.spkFile = spkFile
     self.posFile = posFile
     self.x_pos = []
     self.y_pos = []
     self.t_pos = []
Esempio n. 4
0
 def __init__(self, startTime, endTime, spkFile, posFile):
     libHrlAnalysis.HrlNeuralAnalysis.__init__(
         self, 0, 0, 0, 0, libHrlAnalysis.vector_string())
     self.paramsIn().startTime = startTime
     self.paramsIn().endTime = endTime
     self.spkFile = spkFile
     self.posFile = posFile
     self.x_pos = []
     self.y_pos = []
     self.t_pos = []
Esempio n. 5
0
    def test_getCOV(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')

        analysis = libHrlAnalysis.HrlNeuralAnalysisHRLSim(
            0, 4000, 26200, 28199, fileNames)
        covInfo = analysis.getCOV()

        data = libHrlAnalysisData.AnalysisData()
        self.assertTrue(data.fillCOV('../../test/data/CA1/CA1_cov.dat'))
        self.assertTrue(data.compareCOV(covInfo.cov))
Esempio n. 6
0
    def test_getCOV(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')
           
        analysis = libHrlAnalysis.HrlNeuralAnalysisHRLSim(0,4000,26200,28199,
                                                          fileNames)
        covInfo = analysis.getCOV()

        data = libHrlAnalysisData.AnalysisData()
        self.assertTrue(data.fillCOV('../../test/data/CA1/CA1_cov.dat'))
        self.assertTrue(data.compareCOV(covInfo.cov))
Esempio n. 7
0
    def test_serialize(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')

        analysisIn = libHrlAnalysis.HrlNeuralAnalysisHRLSim(
            0, 4000, 26200, 28199, fileNames)
        analysisIn.buildDataStructures()
        analysisIn.save("./ser.bin")

        analysisOut = libHrlAnalysis.HrlNeuralAnalysisHRLSim(
            0, 0, 0, 0, libHrlAnalysis.vector_string())
        analysisOut.load("./ser.bin")

        spikes = analysisOut.getSpikeTimes()

        data = libHrlAnalysisData.AnalysisData()
        data.fillRasterData('../../test/data/CA1/CA1_raster.dat')

        self.assertTrue(data.compareRasterDataDim(spikes.time, 1))
        self.assertTrue(data.compareRasterDataDim(spikes.spikes, 2))
Esempio n. 8
0
    def test_serialize(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')
              
        analysisIn = libHrlAnalysis.HrlNeuralAnalysisHRLSim(0,4000,26200,28199,
                                                          fileNames)
        analysisIn.buildDataStructures()
        analysisIn.save("./ser.bin")
        
        analysisOut = libHrlAnalysis.HrlNeuralAnalysisHRLSim(
                                                0,0,0,0,
                                                libHrlAnalysis.vector_string())
        analysisOut.load("./ser.bin")

        spikes = analysisOut.getSpikeTimes()
        
        data = libHrlAnalysisData.AnalysisData()
        data.fillRasterData('../../test/data/CA1/CA1_raster.dat')

        self.assertTrue(data.compareRasterDataDim(spikes.time,1))
        self.assertTrue(data.compareRasterDataDim(spikes.spikes,2))
Esempio n. 9
0
    def test_getRasterResult(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')

        analysis = libHrlAnalysis.HrlNeuralAnalysisHRLSim(
            0, 4000, 26200, 28199, fileNames)
        spikes = analysis.getSpikeTimes()

        data = libHrlAnalysisData.AnalysisData()
        data.fillRasterData('../../test/data/CA1/CA1_raster.dat')

        self.assertTrue(data.compareRasterDataDim(spikes.time, 1))
        self.assertTrue(data.compareRasterDataDim(spikes.spikes, 2))
Esempio n. 10
0
    def test_GetGaussWindowRates(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')

        analysis = libHrlAnalysis.HrlNeuralAnalysisHRLSim(0,4000,26200,28199,
                                                          fileNames)
        rates = analysis.getGaussWindowRate(10,10)
        
        data = libHrlAnalysisData.AnalysisData()
        self.assertTrue(data.fillWindowRates(
                            '../../test/data/CA1/CA1_gauss_window_rates.dat'))

        self.assertTrue(data.compareWindowRates_double(rates.rates))
Esempio n. 11
0
    def test_getRasterResult(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')
              
        analysis = libHrlAnalysis.HrlNeuralAnalysisHRLSim(0,4000,26200,28199,
                                                          fileNames)
        spikes = analysis.getSpikeTimes()
        
        data = libHrlAnalysisData.AnalysisData()
        data.fillRasterData('../../test/data/CA1/CA1_raster.dat')

        self.assertTrue(data.compareRasterDataDim(spikes.time,1))
        self.assertTrue(data.compareRasterDataDim(spikes.spikes,2))
Esempio n. 12
0
    def test_GetWindowRates(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')

        analysis = libHrlAnalysis.HrlNeuralAnalysisHRLSim(
            0, 4000, 26200, 28199, fileNames)
        rates = analysis.getWindowRate(10, 10)

        data = libHrlAnalysisData.AnalysisData()
        self.assertTrue(
            data.fillWindowRates('../../test/data/CA1/CA1_window_rates.dat'))

        self.assertTrue(data.compareWindowRates_double(rates.rates))
Esempio n. 13
0
    def test_GetRateBins(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')

        analysis = libHrlAnalysis.HrlNeuralAnalysisHRLSim(0,4000,26200,28199,
                                                          fileNames)
        rateBinInfo = analysis.getRateBins(100)

        data = libHrlAnalysisData.AnalysisData()
        self.assertTrue(data.fillSpikeBins(
                                    '../../test/data/CA1/CA1_spike_bins.dat'))

        self.assertTrue(data.compareSpikeBinsAt(rateBinInfo.counts,0))
        self.assertTrue(data.compareSpikeBinsAt(rateBinInfo.counts,1)) 
Esempio n. 14
0
    def test_GetRateBins(self):
        fileNames = libHrlAnalysis.vector_string()
        fileNames.append('../../test/data/CA1/spikes_0001.bin')
        fileNames.append('../../test/data/CA1/spikes_0002.bin')

        analysis = libHrlAnalysis.HrlNeuralAnalysisHRLSim(
            0, 4000, 26200, 28199, fileNames)
        rateBinInfo = analysis.getRateBins(100)

        data = libHrlAnalysisData.AnalysisData()
        self.assertTrue(
            data.fillSpikeBins('../../test/data/CA1/CA1_spike_bins.dat'))

        self.assertTrue(data.compareSpikeBinsAt(rateBinInfo.counts, 0))
        self.assertTrue(data.compareSpikeBinsAt(rateBinInfo.counts, 1))
Esempio n. 15
0
    def test_Voltages(self):
        fileNames = libHrlAnalysis.vector_string()
        for i in range(20):
            fileNames.append("../../test/data/VOLT/voltages_%04d.dat"%(i+1))

        data = libHrlAnalysisData.AnalysisData()
        self.assertTrue(data.fillVoltageData(
                                        "../../test/data/VOLT/VOLT_TEST.dat"))

        analysis = libHrlAnalysis.HrlNeuralAnalysisVoltage(
                                                0, 2000, 0, 61, 
                                                fileNames, 62,False,-49.0)

        voltageInfo = analysis.voltages()
        #print "\n\n",len(voltageInfo.voltage),"\n\n"
        self.assertTrue(data.compareVoltageData(voltageInfo.voltage, 0.0001))
Esempio n. 16
0
    def test_Voltages(self):
        fileNames = libHrlAnalysis.vector_string()
        for i in range(20):
            fileNames.append("../../test/data/VOLT/voltages_%04d.dat" %
                             (i + 1))

        data = libHrlAnalysisData.AnalysisData()
        self.assertTrue(
            data.fillVoltageData("../../test/data/VOLT/VOLT_TEST.dat"))

        analysis = libHrlAnalysis.HrlNeuralAnalysisVoltage(
            0, 2000, 0, 61, fileNames, 62, False, -49.0)

        voltageInfo = analysis.voltages()
        #print "\n\n",len(voltageInfo.voltage),"\n\n"
        self.assertTrue(data.compareVoltageData(voltageInfo.voltage, 0.0001))
Esempio n. 17
0
    def test_GetSPIKESynchrony(self):
        fileNames = libHrlAnalysis.vector_string()
        tester = HrlNeuralAnalysisPythonSynchrony(0,1300,0,1,fileNames)

        S = tester.getPairSynchrony(0,1)

        import numpy as np   
        if( os.path.exists("../../test/data/synchrony/synchrony_data.dat") ):
            values = np.loadtxt("../../test/data/synchrony/synchrony_data.dat")
            self.assertTrue(len(S.S) == len(values))
            for i in range(len(S.S)):
                self.assertTrue( abs(S.S[i]-values[i]) < 0.00000001)   
             
            self.assertTrue( abs(
                        tester.calcSPIKEDistance(S)-0.274376) < 0.000001)
            self.assertTrue( abs(
                        tester.calcSPIKEDistanceAvg(S)-0.211059) < 0.000001)

        else:
            self.fail("Could not open file: ../../test/data/synchrony/synchrony_data.dat")
Esempio n. 18
0
    def test_GetSPIKESynchrony(self):
        fileNames = libHrlAnalysis.vector_string()
        tester = HrlNeuralAnalysisPythonSynchrony(0, 1300, 0, 1, fileNames)

        S = tester.getPairSynchrony(0, 1)

        import numpy as np
        if (os.path.exists("../../test/data/synchrony/synchrony_data.dat")):
            values = np.loadtxt("../../test/data/synchrony/synchrony_data.dat")
            self.assertTrue(len(S.S) == len(values))
            for i in range(len(S.S)):
                self.assertTrue(abs(S.S[i] - values[i]) < 0.00000001)

            self.assertTrue(
                abs(tester.calcSPIKEDistance(S) - 0.274376) < 0.000001)
            self.assertTrue(
                abs(tester.calcSPIKEDistanceAvg(S) - 0.211059) < 0.000001)

        else:
            self.fail(
                "Could not open file: ../../test/data/synchrony/synchrony_data.dat"
            )
Esempio n. 19
0
 def __init__(self, neoObj):
     libHrlAnalysis.HrlNeuralAnalysis.__init__(
         self, 0, 0, 0, 0, libHrlAnalysis.vector_string())
     self.neoObj = neoObj
Esempio n. 20
0
 def __init__(self,neoObj):
     libHrlAnalysis.HrlNeuralAnalysis.__init__(
                                 self,0,0,0,0,libHrlAnalysis.vector_string())
     self.neoObj = neoObj