def createPlot2D(self, volPrefix, md):

        import xmipp

        figurePath = self._getExtraPath(volPrefix +
                                        'softAlignmentValidation2D.png')
        figureSize = (8, 6)

        #alignedMovie = mic.alignMetaData
        plotter = Plotter(*figureSize)
        figure = plotter.getFigure()

        ax = figure.add_subplot(111)
        ax.grid()
        ax.set_title('Soft alignment validation map')
        ax.set_xlabel('Angular Precision')
        ax.set_ylabel('Angular Accuracy')

        for objId in md:
            x = md.getValue(xmipp.MDL_SCORE_BY_ALIGNABILITY_PRECISION, objId)
            y = md.getValue(xmipp.MDL_SCORE_BY_ALIGNABILITY_ACCURACY, objId)
            ax.plot(x, y, 'r.', markersize=1)

        ax.grid(True, which='both')
        ax.autoscale_view(True, True, True)

        plotter.savefig(figurePath)
        plotter.show()
        return plotter
    def createPlot2D(self,volPrefix,md):
        
        import xmipp
        
        figurePath = self._getExtraPath(volPrefix + 'softAlignmentValidation2D.png')
        figureSize = (8, 6)
    
        #alignedMovie = mic.alignMetaData
        plotter = Plotter(*figureSize)
        figure = plotter.getFigure()
    
        ax = figure.add_subplot(111)
        ax.grid()
        ax.set_title('Soft alignment validation map')
        ax.set_xlabel('Angular Precision')
        ax.set_ylabel('Angular Accuracy')

        for objId in md:
            x = md.getValue(xmipp.MDL_SCORE_BY_ALIGNABILITY_PRECISION, objId)
            y = md.getValue(xmipp.MDL_SCORE_BY_ALIGNABILITY_ACCURACY, objId)
            ax.plot(x, y, 'r.',markersize=1)

        ax.grid(True, which='both')
        ax.autoscale_view(True,True,True)
                
        plotter.savefig(figurePath)
        plotter.show()
        return plotter    
    def _visualizeLLPlot(self, e=None):
        """ Plot -LL vs cycle :N:1,5:
                """
        headerList, dataList, msg, title = self.parseFile.retrievemLLPlot()
        if not dataList:
            errorWindow(self.getTkRoot(), msg)
            return

        xplotter = Plotter(windowTitle=title)
        a = xplotter.createSubPlot(title, headerList[0], '-LL', yformat=False)
        # see
        # https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.plot.html
        a.plot(dataList[0], dataList[1], 'bx-')
        xplotter.showLegend(headerList[1:])
        xplotter.show()
Beispiel #4
0
 def visualize(self, obj, **args):
     cls = type(obj)
     if issubclass(cls, AtsasProtConvertPdbToSAXS):
         if obj.experimentalSAXS.empty():
             fnInt=obj._getPath("pseudoatoms00.int")
         else:
             fnInt=obj._getPath("pseudoatoms00.fit")
         
         import numpy
         x=numpy.loadtxt(fnInt,skiprows=1)
         xplotter = Plotter(windowTitle="SAXS Curves")
         a = xplotter.createSubPlot('SAXS curves', 'Angstrongs^-1', 'log(SAXS)', yformat=False)
         a.plot(x[:,0], numpy.log(x[:,1]))
         a.plot(x[:,0], numpy.log(x[:,2]))
         if obj.experimentalSAXS.empty():
             xplotter.showLegend(['SAXS in solution','SAXS in vacuo'])
         else:
             xplotter.showLegend(['Experimental SAXS','SAXS from volume'])
         xplotter.show()
    def _visualizeRFactorPlot(self, e=None):
        """ Plot Rfactor and Rfree vs cycle :N:[1,3]:
        """
        headerList, dataList, msg, title = self.parseFile.retrieveRFactorPlot()
        if not dataList:
            errorWindow(self.getTkRoot(), msg)
            return

        xplotter = Plotter(windowTitle=title)
        a = xplotter.createSubPlot(title,
                                   headerList[0],
                                   'Rfactor',
                                   yformat=False)
        # see
        # https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.plot.html
        # for plot options
        a.plot(dataList[0], dataList[1], 'bx-', dataList[0], dataList[2],
               'gx-')  # plot start over line  in blue
        xplotter.showLegend(headerList[1:])
        xplotter.show()
    def _visualizeGeometryPlot(self, e=None):
        """ Plot rmsBOND,zBOND, rmsANGL, zANGL and rmsCHIRALvs cycle :
        N:1,7,8,9,10,11:
        """
        headerList, dataList, msg, title = \
            self.parseFile.retrieveGeometryPlot()
        if not dataList:
            errorWindow(self.getTkRoot(), msg)
            return

        xplotter = Plotter(windowTitle=title)
        a = xplotter.createSubPlot(title,
                                   headerList[0],
                                   'geometry',
                                   yformat=False)
        # see
        # https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.plot.html
        # for plot options
        a.plot(
            dataList[0],
            dataList[1],
            'bx-',
            dataList[0],
            dataList[2],
            'gx-',
            dataList[0],
            dataList[3],
            'rx-',
            dataList[0],
            dataList[4],
            'cx-',
            dataList[0],
            dataList[5],
            'mx-',
        )  # plot start over line  in blue
        xplotter.showLegend(headerList[1:])
        xplotter.show()