def parseOutput(self, _strFileName): """ This method parses the output of dozor """ xsDataResultDozor = XSDataResultDozor() strOutput = EDUtilsFile.readFile(_strFileName) # Skip the four first lines listOutput = strOutput.split("\n")[6:] for strLine in listOutput: xsDataImageDozor = XSDataImageDozor() # Remove "|" listLine = shlex.split(strLine.replace("|", " ")) # print listLine if listLine != []: xsDataImageDozor.number = XSDataInteger(listLine[0]) if listLine[4].startswith("-"): xsDataImageDozor.spots_num_of = XSDataInteger(listLine[1]) xsDataImageDozor.spots_int_aver = self.parseDouble(listLine[2]) xsDataImageDozor.spots_resolution = self.parseDouble(listLine[3]) xsDataImageDozor.score = self.parseDouble(listLine[7]) else: xsDataImageDozor.spots_num_of = XSDataInteger(listLine[1]) xsDataImageDozor.spots_int_aver = self.parseDouble(listLine[2]) xsDataImageDozor.spots_resolution = self.parseDouble(listLine[3]) xsDataImageDozor.powder_wilson_scale = self.parseDouble(listLine[4]) xsDataImageDozor.powder_wilson_bfactor = self.parseDouble(listLine[5]) xsDataImageDozor.powder_wilson_resolution = self.parseDouble(listLine[6]) xsDataImageDozor.powder_wilson_correlation = self.parseDouble(listLine[7]) xsDataImageDozor.powder_wilson_rfactor = self.parseDouble(listLine[8]) xsDataImageDozor.score = self.parseDouble(listLine[9]) # print xsDataImageDozor.marshal() xsDataResultDozor.addImageDozor(xsDataImageDozor) return xsDataResultDozor
def __init__(self): EDPluginExecProcessScript.__init__(self) self.setXSDataInputClass(XSDataInputDozor) self.setDataOutput(XSDataResultDozor()) self.strImageLinkSubDirectory = "img" self.defaultFractionPolarization = 0.99 self.defaultImageStep = 1 self.startingAngle = 0.0
def parseOutput(self, _strFileName): """ This method parses the output of dozor """ xsDataResultDozor = XSDataResultDozor() strOutput = EDUtilsFile.readFile(_strFileName) # Skip the four first lines self.DEBUG('***** Dozor raw output ***** ') self.DEBUG(strOutput) listOutput = strOutput.split("\n")[14:] for strLine in listOutput: xsDataImageDozor = XSDataImageDozor() # Remove "|" listLine = shlex.split(strLine.replace("|", " ")) #print listLine if listLine != [] and not listLine[0].startswith("-"): xsDataImageDozor.number = XSDataInteger(listLine[0]) # Fix for xaloc-ALBA #if listLine[5].startswith("-") or len(listLine) < 11: if len(listLine) < 11: xsDataImageDozor.spots_num_of = XSDataInteger(listLine[1]) xsDataImageDozor.spots_int_aver = self.parseDouble(listLine[2]) try: xsDataImageDozor.spots_resolution = self.parseDouble(listLine[3]) except IndexError as e: xsDataImageDozor.spots_resolution = XSDataDouble(0.0) xsDataImageDozor.score = XSDataDouble(0.0) #self.parseDouble(listLine[4]) else: xsDataImageDozor.spots_num_of = XSDataInteger(listLine[1]) xsDataImageDozor.spots_int_aver = self.parseDouble(listLine[2]) xsDataImageDozor.spots_resolution = self.parseDouble(listLine[3]) xsDataImageDozor.powder_wilson_scale = self.parseDouble(listLine[4]) xsDataImageDozor.powder_wilson_bfactor = self.parseDouble(listLine[5]) xsDataImageDozor.powder_wilson_resolution = self.parseDouble(listLine[6]) xsDataImageDozor.powder_wilson_correlation = self.parseDouble(listLine[7]) xsDataImageDozor.powder_wilson_rfactor = self.parseDouble(listLine[8]) xsDataImageDozor.score = self.parseDouble(listLine[9]) # print xsDataImageDozor.marshal() xsDataResultDozor.addImageDozor(xsDataImageDozor) return xsDataResultDozor
def __init__(self): EDPluginExecProcessScript.__init__(self) self.setXSDataInputClass(XSDataInputDozor) self.setDataOutput(XSDataResultDozor()) self.strImageLinkSubDirectory = "img" self.defaultFractionPolarization = 0.99 self.defaultImageStep = 1 self.startingAngle = 0.0 self.firstImageNumber = None self.oscillationRange = None self.overlap = 0.0 self.ixMin = None self.iyMin = None self.ixMax = None self.iyMax = None # Default values for ESRF Pilatus6M id30b: 1,1230; 1228,1298 self.ixMinPilatus6m = 1 self.ixMaxPilatus6m = 1230 self.iyMinPilatus6m = 1228 self.iyMaxPilatus6m = 1298 # Default values for ESRF Pilatus2M : ID30a1: 1,776; 826,894 self.ixMinPilatus2m = 1 self.ixMaxPilatus2m = 776 self.iyMinPilatus2m = 826 self.iyMaxPilatus2m = 894 # Default values for ESRF Eiger4M : ID30a3: 1,1120; 1025,1140 self.ixMinEiger4m = 1 self.ixMaxEiger4m = 1120 self.iyMinEiger4m = 1025 self.iyMaxEiger4m = 1140 # Default values for ESRF Eiger16M : ID23eh1: 1, 2159, 2087, 2312 self.ixMinEiger16m = 1 self.ixMaxEiger16m = 2159 self.iyMinEiger16m = 2087 self.iyMaxEiger16m = 2312 # Bad zones self.strBad_zona = None
def __init__(self): EDPluginExecProcessScript.__init__(self) self.setXSDataInputClass(XSDataInputDozor) self.setDataOutput(XSDataResultDozor()) self.strImageLinkSubDirectory = "img" self.defaultFractionPolarization = 0.99 self.defaultImageStep = 1 self.startingAngle = 0.0 self.defaultPixelMean = -1 self.defaultPixelMax = 64000 self.ix_min = None self.iy_min = None self.ix_max = None self.iy_max = None # Default values for ESRF Pilatus6M self.ix_min_pilatus6m = 1 self.ix_max_pilatus6m = 1270 self.iy_min_pilatus6m = 1190 self.iy_max_pilatus6m = 1310 # Default values for ESRF Pilatus2M self.ix_min_pilatus2m = 1 self.ix_max_pilatus2m = 840 self.iy_min_pilatus2m = 776 self.iy_max_pilatus2m = 852
def parseOutput(self, _strFileName): """ This method parses the output of dozor """ xsDataResultDozor = XSDataResultDozor() strOutput = EDUtilsFile.readFile(_strFileName) # Skip the four first lines listOutput = strOutput.split("\n")[6:] strWorkingDir = os.path.dirname(_strFileName) for strLine in listOutput: # Remove "|" listLine = shlex.split(strLine.replace("|", " ")) if len(listLine) > 0 and listLine[0].isdigit(): xsDataImageDozor = XSDataImageDozor() imageNumber = int(listLine[0]) angle = self.startingAngle + ( imageNumber - self.firstImageNumber) * ( self.oscillationRange - self.overlap) + self.oscillationRange / 2.0 xsDataImageDozor.number = XSDataInteger(imageNumber) xsDataImageDozor.angle = XSDataAngle(angle) xsDataImageDozor.spotsNumOf = XSDataInteger(0) xsDataImageDozor.spotsIntAver = XSDataDouble(0) xsDataImageDozor.spotsResolution = XSDataDouble(0) xsDataImageDozor.mainScore = XSDataDouble(0) xsDataImageDozor.spotScore = XSDataDouble(0) xsDataImageDozor.visibleResolution = XSDataDouble(40) try: if listLine[5].startswith("-") or len(listLine) < 11: xsDataImageDozor.spotsNumOf = XSDataInteger( listLine[1]) xsDataImageDozor.spotsIntAver = self.parseDouble( listLine[2]) xsDataImageDozor.spotsRfactor = self.parseDouble( listLine[3]) xsDataImageDozor.spotsResolution = self.parseDouble( listLine[4]) xsDataImageDozor.mainScore = self.parseDouble( listLine[8]) xsDataImageDozor.spotScore = self.parseDouble( listLine[9]) xsDataImageDozor.visibleResolution = self.parseDouble( listLine[10]) else: xsDataImageDozor.spotsNumOf = XSDataInteger( listLine[1]) xsDataImageDozor.spotsIntAver = self.parseDouble( listLine[2]) xsDataImageDozor.spotsRfactor = self.parseDouble( listLine[3]) xsDataImageDozor.spotsResolution = self.parseDouble( listLine[4]) xsDataImageDozor.powderWilsonScale = self.parseDouble( listLine[5]) xsDataImageDozor.powderWilsonBfactor = self.parseDouble( listLine[6]) xsDataImageDozor.powderWilsonResolution = self.parseDouble( listLine[7]) xsDataImageDozor.powderWilsonCorrelation = self.parseDouble( listLine[8]) xsDataImageDozor.powderWilsonRfactor = self.parseDouble( listLine[9]) xsDataImageDozor.mainScore = self.parseDouble( listLine[10]) xsDataImageDozor.spotScore = self.parseDouble( listLine[11]) xsDataImageDozor.visibleResolution = self.parseDouble( listLine[12]) except: pass # Dozor spot file if strWorkingDir is not None: strSpotFile = os.path.join( strWorkingDir, "%05d.spot" % xsDataImageDozor.number.value) if os.path.exists(strSpotFile): xsDataImageDozor.spotFile = XSDataFile( XSDataString(strSpotFile)) # #print xsDataImageDozor.marshal() xsDataResultDozor.addImageDozor(xsDataImageDozor) elif strLine.startswith("h"): xsDataResultDozor.halfDoseTime = XSDataDouble( strLine.split("=")[1].split()[0]) # Check if mtv plot file exists mtvFileName = "dozor_rd.mtv" mtvFilePath = os.path.join(strWorkingDir, mtvFileName) if os.path.exists(mtvFilePath): xsDataResultDozor.plotmtvFile = XSDataFile( XSDataString(mtvFilePath)) xsDataResultDozor.pngPlots = self.generatePngPlots( mtvFilePath, strWorkingDir) return xsDataResultDozor