@@ -732,7 +732,7 @@ def test_LaminarCurrentSourceDensity_02(self):
732732
733733 np .testing .assert_allclose (M_gt , M )
734734
735- def test_LaminarCurrentSourceDensity_3 (self ):
735+ def test_LaminarCurrentSourceDensity_03 (self ):
736736 '''test LaminarCurrentSourceDensity implementation'''
737737 cell = get_cell (n_seg = 3 )
738738 cell .z = cell .z * 10
@@ -754,7 +754,7 @@ def test_LaminarCurrentSourceDensity_3(self):
754754
755755 np .testing .assert_allclose (M_gt , M )
756756
757- def test_LaminarCurrentSourceDensity_4 (self ):
757+ def test_LaminarCurrentSourceDensity_04 (self ):
758758 '''test LaminarCurrentSourceDensity implementation'''
759759 cell = get_cell (n_seg = 4 )
760760 cell .z = cell .z * 10
@@ -826,6 +826,55 @@ def test_LaminarCurrentSourceDensity_06(self):
826826
827827 np .testing .assert_allclose (M_gt , M )
828828
829+
830+ def test_LaminarCurrentSourceDensity_07 (self ):
831+ '''test LaminarCurrentSourceDensity implementation
832+
833+ Issue #196 (https://github.com/LFPy/LFPykit/issues/196)
834+ '''
835+ cell = lfp .CellGeometry (x = np .array ([[50 , 50 ], [50 , - 50 ]]),
836+ y = np .array ([[0 , 0 ], [0 , 0 ]]),
837+ z = np .array ([[- 100 , - 50 ], [- 50 , 50 ]]),
838+ d = np .array ([1 , 1 ]))
839+
840+ h = 150.
841+ r = 200.
842+ M_gt = np .array ([[1. , 0.5 ],
843+ [0. , 0.5 ]]) / (np .pi * r ** 2 * h )
844+
845+ z = np .array ([[- h , 0. ], [0. , h ]])
846+ r = np .array ([r , r ])
847+
848+ # instantiate electrode, get linear response matrix
849+ csd_lam = lfp .LaminarCurrentSourceDensity (cell = cell , z = z , r = r )
850+ M = csd_lam .get_transformation_matrix ()
851+
852+ np .testing .assert_allclose (M_gt , M )
853+
854+ def test_LaminarCurrentSourceDensity_08 (self ):
855+ '''test LaminarCurrentSourceDensity implementation
856+
857+ Issue #196 (https://github.com/LFPy/LFPykit/issues/196)
858+ '''
859+ cell = lfp .CellGeometry (x = np .array ([[0 , 0 ], [0 , 100 ]]),
860+ y = np .array ([[0 , 0 ], [0 , 0 ]]),
861+ z = np .array ([[- 100 , - 50 ], [- 50 , 50 ]]),
862+ d = np .array ([1 , 1 ]))
863+
864+ h = 150.
865+ r = 200.
866+ M_gt = np .array ([[1. , 0.5 ],
867+ [0. , 0.5 ]]) / (np .pi * r ** 2 * h )
868+
869+ z = np .array ([[- h , 0. ], [0. , h ]])
870+ r = np .array ([r , r ])
871+
872+ # instantiate electrode, get linear response matrix
873+ csd_lam = lfp .LaminarCurrentSourceDensity (cell = cell , z = z , r = r )
874+ M = csd_lam .get_transformation_matrix ()
875+
876+ np .testing .assert_allclose (M_gt , M )
877+
829878 def test_VolumetricCurrentSourceDensity_00 (self ):
830879 cell = get_cell (n_seg = 1 )
831880 cell .z = cell .z * 10.
0 commit comments