def test_ftAxis_time(self): time_max = 10000 # fs Npts = 1024 omega_grid, time_grid = utils.ftAxis_time(Npts, time_max) assert len(omega_grid) == Npts assert len(time_grid) == Npts assert np.max(omega_grid) == (Npts - 1) / 2 * 2 * np.pi / time_max with pytest.raises(TypeError): assert utils.ftAxis_time("40", time_max) with pytest.raises(ValueError): assert utils.ftAxis_time(0, time_max)
def test_ftAxis_time(self): time_max = 10000 # fs Npts = 1024 omega_grid, time_grid = utils.ftAxis_time(Npts, time_max) assert len(omega_grid) == Npts assert len(time_grid) == Npts assert np.max(omega_grid) == (Npts - 1) / 2 * 2 * np.pi / time_max
def calculate_fft(self): ftaxis, axis = ftAxis_time(len(self.xaxis), np.max(self.xaxis) - np.min(self.xaxis)) self.xaxisft = ftaxis / (2 * np.pi) self.data_fft = ft(self.data)