Ejemplo n.º 1
0
    def __defaultColormapAlt__(self, dataBlockNumber):
        '''the default color map definition'''

        c_min = 0.1
        c_max = 0.9
        c_delta_mag = 1.0 * (c_max - c_min) / dataBlockNumber

        c_map = []
        for i in range(dataBlockNumber):
            c_mag = c_min + i * c_delta_mag
            c_map.append(GangaPlotHelper.floatRgb(c_mag, c_min, c_max))

        return c_map
Ejemplo n.º 2
0
    def __defaultColormapAlt__(self,dataBlockNumber):

        '''the default color map definition'''

        c_min = 0.1
        c_max = 0.9
        c_delta_mag = 1.0*(c_max - c_min) / dataBlockNumber

        c_map = []
        for i in range(dataBlockNumber):
            c_mag = c_min + i * c_delta_mag
            c_map.append(GangaPlotHelper.floatRgb(c_mag,c_min,c_max))

        return c_map
Ejemplo n.º 3
0
    def __setDataProcessor__(self,attr,attrext,dataproc):

        """ set the data processor for attribute values """

        if attrext != None and dataproc != None:
            logger.info('user defined dataproc %s will be used.' % str(dataproc))
        elif attr in ['backend.CE','backend.actualCE']:
            # the build-in data processors 
            if attrext == 'by_queue':
                dataproc = None
            if attrext == 'by_ce':
                dataproc = lambda x:x.split(':2119/')[0]
            if attrext == 'by_country':
                dataproc = lambda x:GangaPlotHelper.tld_country(x.split(':2119/')[0].split('.')[-1])
        return dataproc
Ejemplo n.º 4
0
    def __setDataProcessor__(self, attr, attrext, dataproc):
        """ set the data processor for attribute values """

        if attrext != None and dataproc != None:
            logger.info('user defined dataproc %s will be used.' %
                        str(dataproc))
        elif attr in ['backend.CE', 'backend.actualCE']:
            # the build-in data processors
            if attrext == 'by_queue':
                dataproc = None
            if attrext == 'by_ce':
                dataproc = lambda x: x.split(':2119/')[0]
            if attrext == 'by_country':
                dataproc = lambda x: GangaPlotHelper.tld_country(
                    x.split(':2119/')[0].split('.')[-1])
        return dataproc