def testFtInverse(self): importOp("Ft") importOp("Gen") size = 1024 v = self.genSpectrum(size) vSave = Vec(size, True) v.copy(vSave) op = Ft(False, False) op.eval(v) iop = op.getInverseOp() iop.eval(v) v.subtract(vSave) self.isAlmostEqualTo(v.getList(), 0.0) vSave.copy(v) op = Ft(True, False) op.eval(v) iop = op.getInverseOp() iop.eval(v) v.subtract(vSave) self.isAlmostEqualTo(v.getList(), 0.0) vSave.copy(v) op = Ft(False, True) op.eval(v) iop = op.getInverseOp() iop.eval(v) v.subtract(vSave) self.isAlmostEqualTo(v.getList(), 0.0)
def testIft(self): importOp("Ft") importOp("Ift") importOp("Gen") size = 1024 v = Vec(size, True) vSave = Vec(size, True) sw = 1000.0 dwell = 1.0 / sw v.setDwellTime(dwell) op = Gen(1000.0, 10.0, 100.0, 0.0) op.eval(v) v.copy(vSave) op = Ft(False, False) op.eval(v) op = Ift() op.eval(v) v.subtract(vSave) self.isAlmostEqualTo(v.getList(), 0.0)