DataPipeline/Base.py
def saveEkinPlotstoImages(self, E, filename, groupbylabel=False):
        """Save the ekin plots to png images
           groupbylabel allows commonly labelled datasets
           to be overlayed - useful for viewing processing results"""
        title = os.path.basename(filename)
        filename = os.path.join(self.workingdir, filename)
        filename = filename + '.png'
        #limit to 30 plots per image
        dsets = E.datasets
        if len(dsets) > 30:
            dsets = E.datasets[:30]
        plotopts = self.getPlotOptions()
        #the following functionality should be integrated into ekin plotter
        if groupbylabel == True:
            import itertools
            import pylab as plt
            from mpl_toolkits.axes_grid1 import AxesGrid
            groups = []
            #use iterator to get groups
            iterator = itertools.groupby(sorted(dsets), key=lambda x: x.split('_')[0])
            for i,j in iterator:
                groups.append(list(j))
            #print groups
            fig = plt.figure()
            cols, dim = E.getGeometry(groups, 0)
            c=1
            for g in groups:
                ax=fig.add_subplot(cols,dim,c)
                E.plotDatasets(g,figure=fig,axis=ax,plotoption=3,
                                varyshapes=1,**plotopts)
                c+=1
            #fig.tight_layout(pad=0.8, w_pad=0.8, h_pad=1.0)
            fig.savefig(filename,dpi=plotopts['dpi'])
        else:
            E.plotDatasets(dsets, filename=filename, plotoption=2,
                           size=(10,8), title=title, **plotopts)
        return
Save the ekin plots to png images
           groupbylabel allows commonly labelled datasets
           to be overlayed - useful for viewing processing results
Save the ekin plots to png images
groupbylabel allows commonly labelled datasets
to be overlayed - useful for viewing processing results
Save the ekin plots to png images groupbylabel allows commonly labelled datasets to be overlayed - useful for viewing processing results
def saveEkinPlotstoImages(self, E, filename, groupbylabel=False):
        title = os.path.basename(filename)
        filename = os.path.join(self.workingdir, filename)
        filename = filename + '.png'
        dsets = E.datasets
        if len(dsets) > 30:
            dsets = E.datasets[:30]
        plotopts = self.getPlotOptions()
        if groupbylabel == True:
            import itertools
            import pylab as plt
            from mpl_toolkits.axes_grid1 import AxesGrid
            groups = []
            iterator = itertools.groupby(sorted(dsets), key=lambda x: x.split('_')[0])
            for i,j in iterator:
                groups.append(list(j))
            fig = plt.figure()
            cols, dim = E.getGeometry(groups, 0)
            c=1
            for g in groups:
                ax=fig.add_subplot(cols,dim,c)
                E.plotDatasets(g,figure=fig,axis=ax,plotoption=3,
                                varyshapes=1,**plotopts)
                c+=1
            fig.savefig(filename,dpi=plotopts['dpi'])
        else:
            E.plotDatasets(dsets, filename=filename, plotoption=2,
                           size=(10,8), title=title, **plotopts)
        return
def saveEkinPlotstoImages ( self , E , filename , groupbylabel = False ) : title = os . path . basename ( filename ) filename = os . path . join ( self . workingdir , filename ) filename = filename + '.png' dsets = E . datasets if len ( dsets ) > 30 : dsets = E . datasets [ : 30 ] plotopts = self . getPlotOptions ( ) if groupbylabel == True : import itertools import pylab as plt from mpl_toolkits . axes_grid1 import AxesGrid groups = [ ] iterator = itertools . groupby ( sorted ( dsets ) , key = lambda x : x . split ( '_' ) [ 0 ] ) for i , j in iterator : groups . append ( list ( j ) ) fig = plt . figure ( ) cols , dim = E . getGeometry ( groups , 0 ) c = 1 for g in groups : ax = fig . add_subplot ( cols , dim , c ) E . plotDatasets ( g , figure = fig , axis = ax , plotoption = 3 , varyshapes = 1 , ** plotopts ) c += 1 fig . savefig ( filename , dpi = plotopts [ 'dpi' ] ) else : E . plotDatasets ( dsets , filename = filename , plotoption = 2 , size = ( 10 , 8 ) , title = title , ** plotopts ) return
Save the ekin plots to png images
groupbylabel allows commonly labelled datasets
to be overlayed - useful for viewing processing results
Save the ekin plots to png images groupbylabel allows commonly labelled datasets to be overlayed - useful for viewing processing results
"""Save the ekin plots to png images
           groupbylabel allows commonly labelled datasets
           to be overlayed - useful for viewing processing results""" #limit to 30 plots per image #the following functionality should be integrated into ekin plotter #use iterator to get groups #print groups #fig.tight_layout(pad=0.8, w_pad=0.8, h_pad=1.0)
self
E
filename
groupbylabel