def testIO(self): """Test basic FSC object""" xList = [0.00, 0.05, 0.10, 0.15, 0.2] yList = [1.00, 0.95, 0.90, 0.85, 0.2] fsc = emobj.FSC() fsc.setData(xList, yList) # fsc.printAll() x, y = fsc.getData() self.assertEqual(xList, x) self.assertEqual(yList, y)
def createOutputStep(self): fscSet = self._createSetOfFSCs() fscSet.setObjLabel("setOfFSCs") dataStringList = self.fscValues.get().split("|") labelStringList = self.fscLabels.get().split("|") for fsc, label in zip(dataStringList, labelStringList): _fsc = emobj.FSC(objLabel=loads(label)) freq, value = loads(fsc) _fsc.setData(freq, value) fscSet.append(_fsc) self._defineOutputs(outputFSCs=fscSet)
def testMd(self): """test create FSC from metdata""" xList = [0.00, 0.05, 0.10, 0.15, 0.2] yList = [1.00, 0.95, 0.90, 0.85, 0.2] md1 = emlib.MetaData() for freq, fscValue in zip(xList, yList): id = md1.addObject() md1.setValue(emlib.MDL_RESOLUTION_FREQ, freq, id) md1.setValue(emlib.MDL_RESOLUTION_FRC, fscValue, id) fsc = emobj.FSC() fsc.loadFromMd(md1, emlib.MDL_RESOLUTION_FREQ, emlib.MDL_RESOLUTION_FRC) x, y = fsc.getData() self.assertEqual(xList, x) self.assertEqual(yList, y)