def preProcess(self, _edObject=None): EDPluginHDF5.preProcess(self) self.DEBUG("EDPluginHDF5StackImagesv10test.preProcess") for onefile in self.dataInput.inputImageFile: if onefile.path is not None: self.listImageFilenames.append(onefile.path.value) if onefile.date is not None: self.listImageDates.append(onefile.date.value) if onefile.number is not None: self.listForcedPositions.append(onefile.number.value) self.listArray.append(EDUtilsArray.getArray(onefile)) for oneArray in self.dataInput.getInputArray(): self.listArray.append(EDUtilsArray.xsDataToArray(oneArray)) if self.dataInput.index != []: self.listForcedPositions = [i.value for i in self.dataInput.index] if self.dataInput.getDeleteInputImage() is not None: self.bDeleteImage = bool(self.dataInput.deleteInputImage.value) if self.listForcedPositions != []: EDAssert.equal(len(self.listForcedPositions), max(len(self.listImageFilenames), len(self.listArray)), "Forced position list has a good length") if self.listImageDates != []: EDAssert.equal(len(self.listImageDates) , len(self.listImageFilenames), "listImageDates has the same size as listImageFilenames")
def preProcess(self, _edObject=None): EDPluginHDF5.preProcess(self) self.DEBUG("EDPluginHDF5StackImagesv10.preProcess") for onefile in self.dataInput.inputImageFile: if onefile is None: self.ERROR("Please investigate why EDPluginHDF5StackImagesv10.dataInput.inputImageFile is a list containing None !!!!") self.setFailure() continue if onefile.path is not None: self.listImageFilenames.append(onefile.path.value) if onefile.date is not None: self.listImageDates.append(onefile.date.value) if onefile.number is not None: self.listForcedPositions.append(onefile.number.value) self.listArray.append(EDUtilsArray.getArray(onefile)) for oneArray in self.dataInput.inputArray: self.listArray.append(EDUtilsArray.xsDataToArray(oneArray)) if self.dataInput.index != []: self.listForcedPositions = [i.value for i in self.dataInput.index] if self.dataInput.getDeleteInputImage() is not None: self.bDeleteImage = bool(self.dataInput.deleteInputImage.value) if self.listForcedPositions != []: EDAssert.equal(len(self.listForcedPositions), max(len(self.listImageFilenames), len(self.listArray)), "Forced position list has a good length") if self.listImageDates != []: EDAssert.equal(len(self.listImageDates) , len(self.listImageFilenames), "listImageDates has the same size as listImageFilenames") self.hdf5group = EDPluginHDF5.createStructure(self.strHDF5Filename, self.strHDF5Path, self.dictExtraAttributes)
def preProcess(self, _edObject=None): EDPluginHDF5.preProcess(self) self.DEBUG("EDPluginHDF5MapOfSpectrav10.preProcess") for oneSpectrum in self.getDataInput().getInputSpectrumFile(): if oneSpectrum.getPath() is not None: strFileName = oneSpectrum.getPath().getValue() self.DEBUG("getInputSpectrumFile: %s" % strFileName) self.listSpectrumFilenames.append(strFileName) elif oneSpectrum.getArray() is not None: self.DEBUG("getInputArray: %s" % strFileName) self.listArray.append(EDUtilsArray.xsDataToArray()) else: self.ERROR("A spectrum should either contain an image file or an array.") self.setFailure() raise if (oneSpectrum.getFastMotorPosition() is not None) and (oneSpectrum.getSlowMotorPosition() is not None): self.listForcedPositions.append({"Slow":oneSpectrum.getSlowMotorPosition().getValue(), "Fast":oneSpectrum.getFastMotorPosition().getValue()}) if oneSpectrum.getFileType() is not None: self.listSpectrumFileType.append(oneSpectrum.getFileType.getValue()) if oneSpectrum.getMeshScan() is not None: XSDMesh = oneSpectrum.getMeshScan() # self.DEBUG(XSDMesh.marshal()) self.meshScan["FastMotorSteps"] = XSDMesh.getFastMotorSteps().getValue() self.meshScan["FastMotorStart"] = XSDMesh.getFastMotorStart().getValue() self.meshScan["FastMotorStop" ] = XSDMesh.getFastMotorStop().getValue() self.meshScan["SlowMotorSteps"] = XSDMesh.getSlowMotorSteps().getValue() self.meshScan["SlowMotorStart"] = XSDMesh.getSlowMotorStart().getValue() self.meshScan["SlowMotorStop" ] = XSDMesh.getSlowMotorStop().getValue() self.DEBUG("MeshScan= %s" % self.meshScan) if self.getDataInput().getDeleteInputSpectrum() is not None: if self.getDataInput().getDeleteInputSpectrum() in [True, "true", "True", 1, "1"]: self.bDeleteSpectrum = True if len(self.listForcedPositions) > 0 : EDAssert.equal(len(self.listForcedPositions), max(len(self.listSpectrumFilenames), len(self.listArray)), _strComment="list of forced position has the right size") self.hdf5group = self.createStructure(self.strHDF5Filename, self.strHDF5Path, self.dictExtraAttributes)
def preProcess(self, _edObject=None): EDPluginHDF5.preProcess(self) self.DEBUG("EDPluginHDF5MapOfSpectrav10.preProcess") for oneSpectrum in self.getDataInput().getInputSpectrumFile(): if oneSpectrum.getPath() is not None: strFileName = oneSpectrum.getPath().getValue() self.DEBUG("getInputSpectrumFile: %s" % strFileName) self.listSpectrumFilenames.append(strFileName) elif oneSpectrum.getArray() is not None: self.DEBUG("getInputArray: %s" % strFileName) self.listArray.append(EDUtilsArray.xsDataToArray()) else: self.ERROR( "A spectrum should either contain an image file or an array." ) self.setFailure() raise if (oneSpectrum.getFastMotorPosition() is not None) and (oneSpectrum.getSlowMotorPosition() is not None): self.listForcedPositions.append({ "Slow": oneSpectrum.getSlowMotorPosition().getValue(), "Fast": oneSpectrum.getFastMotorPosition().getValue() }) if oneSpectrum.getFileType() is not None: self.listSpectrumFileType.append( oneSpectrum.getFileType.getValue()) if oneSpectrum.getMeshScan() is not None: XSDMesh = oneSpectrum.getMeshScan() # self.DEBUG(XSDMesh.marshal()) self.meshScan["FastMotorSteps"] = XSDMesh.getFastMotorSteps( ).getValue() self.meshScan["FastMotorStart"] = XSDMesh.getFastMotorStart( ).getValue() self.meshScan["FastMotorStop"] = XSDMesh.getFastMotorStop( ).getValue() self.meshScan["SlowMotorSteps"] = XSDMesh.getSlowMotorSteps( ).getValue() self.meshScan["SlowMotorStart"] = XSDMesh.getSlowMotorStart( ).getValue() self.meshScan["SlowMotorStop"] = XSDMesh.getSlowMotorStop( ).getValue() self.DEBUG("MeshScan= %s" % self.meshScan) if self.getDataInput().getDeleteInputSpectrum() is not None: if self.getDataInput().getDeleteInputSpectrum() in [ True, "true", "True", 1, "1" ]: self.bDeleteSpectrum = True if len(self.listForcedPositions) > 0: EDAssert.equal( len(self.listForcedPositions), max(len(self.listSpectrumFilenames), len(self.listArray)), _strComment="list of forced position has the right size") self.hdf5group = self.createStructure(self.strHDF5Filename, self.strHDF5Path, self.dictExtraAttributes)