def test_envelope_gof(self): """ Tests all tf gofs """ S1 = self.S1 t = self.t dt = self.dt fmin = self.fmin fmax = self.fmax nf = self.nf npts = self.npts tol = 1e-5 TFEG = tfeg(S1(t), S1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) TFPG = tfpg(S1(t), S1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) TEG = teg(S1(t), S1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) TPG = tpg(S1(t), S1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) FEG = feg(S1(t), S1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) FPG = fpg(S1(t), S1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) EG = eg(S1(t), S1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) PG = pg(S1(t), S1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) self.assertTrue(np.allclose(TFEG, np.ones((nf, npts)) * 10., rtol=tol)) self.assertTrue(np.allclose(TFPG, np.ones((nf, npts)) * 10., rtol=tol)) self.assertTrue(np.allclose(TEG, np.ones(npts) * 10., rtol=tol)) self.assertTrue(np.allclose(TPG, np.ones(npts) * 10., rtol=tol)) self.assertTrue(np.allclose(FEG, np.ones(nf) * 10., rtol=tol)) self.assertTrue(np.allclose(FPG, np.ones(nf) * 10., rtol=tol)) self.assertTrue(np.allclose(EG, 10., rtol=tol)) self.assertTrue(np.allclose(PG, 10., rtol=tol))
def test_envelope_gof(self, state): """ Tests all tf gofs """ s1 = state['s1'] t = state['t'] dt = state['dt'] fmin = state['fmin'] fmax = state['fmax'] nf = state['nf'] npts = state['npts'] tol = 1e-5 _tfeg = tfeg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _tfpg = tfpg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _teg = teg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _tpg = tpg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _feg = feg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _fpg = fpg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _eg = eg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _pg = pg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) assert np.allclose(_tfeg, np.ones((nf, npts)) * 10., rtol=tol) assert np.allclose(_tfpg, np.ones((nf, npts)) * 10., rtol=tol) assert np.allclose(_teg, np.ones(npts) * 10., rtol=tol) assert np.allclose(_tpg, np.ones(npts) * 10., rtol=tol) assert np.allclose(_feg, np.ones(nf) * 10., rtol=tol) assert np.allclose(_fpg, np.ones(nf) * 10., rtol=tol) assert np.allclose(_eg, 10., rtol=tol) assert np.allclose(_pg, 10., rtol=tol)
def test_envelope_gof(self): """ Tests all tf gofs """ s1 = self.s1 t = self.t dt = self.dt fmin = self.fmin fmax = self.fmax nf = self.nf npts = self.npts tol = 1e-5 _tfeg = tfeg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _tfpg = tfpg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _teg = teg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _tpg = tpg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _feg = feg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _fpg = fpg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _eg = eg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) _pg = pg(s1(t), s1(t), dt=dt, fmin=fmin, fmax=fmax, nf=nf) self.assertTrue(np.allclose(_tfeg, np.ones((nf, npts)) * 10., rtol=tol)) self.assertTrue(np.allclose(_tfpg, np.ones((nf, npts)) * 10., rtol=tol)) self.assertTrue(np.allclose(_teg, np.ones(npts) * 10., rtol=tol)) self.assertTrue(np.allclose(_tpg, np.ones(npts) * 10., rtol=tol)) self.assertTrue(np.allclose(_feg, np.ones(nf) * 10., rtol=tol)) self.assertTrue(np.allclose(_fpg, np.ones(nf) * 10., rtol=tol)) self.assertTrue(np.allclose(_eg, 10., rtol=tol)) self.assertTrue(np.allclose(_pg, 10., rtol=tol))