def plotXY(self, aduRange=[120, 180], npix=0): dX = self.__dict__['detSize'][0] dY = self.__dict__['detSize'][1] allX = self.__dict__['X'][self.__dict__['adu'] > aduRange[0]] allY = self.__dict__['Y'][self.__dict__['adu'] > aduRange[0]] alladu = self.__dict__['adu'][self.__dict__['adu'] > aduRange[0]] if npix != 0: allNpix = self.__dict__['npix'][self.__dict__['adu'] > aduRange[0]] if aduRange[1] > aduRange[0]: allX = allX[alladu < aduRange[1]] allY = allY[alladu < aduRange[1]] if npix != 0: allNpix = allNpix[alladu < aduRange[1]] alladu = alladu[alladu < aduRange[1]] if npix != 0: if npix > 0: allX = allX[allNpix == npix] allY = allY[allNpix == npix] alladu = alladu[allNpix == npix] else: allX = allX[allNpix >= abs(npix)] allY = allY[allNpix >= abs(npix)] alladu = alladu[allNpix >= abs(npix)] plt.figure() ndrop_int = max(1, 490000. / allX.shape[0]) hist2d(allX, allY, numBins=[int(dX / ndrop_int), int(dY / ndrop_int)])
def plotAduX(self, aduRange=[120, 180], maxLim=99.5): #self.__dict__['detSize'] = [dX, dY] #708, 772 or epix dX = self.__dict__['detSize'][0] dY = self.__dict__['detSize'][1] if len(self.__dict__['X'].shape) > 1: self.flattenDropArray() plt.figure() hist2d(self.__dict__['X'][self.__dict__['Y'] <= dY], self.__dict__['adu'][self.__dict__['Y'] <= dY], numBins=[dX, 180], histLims=[0, dX, aduRange[0], aduRange[1]], limits=[1, maxLim])
def plotAduY(self, aduRange=[120, 180], maxLim=99.5): dX = self.__dict__['detSize'][0] dY = self.__dict__['detSize'][1] if len(self.__dict__['Y'].shape) > 1: self.flattenDropArray() plt.figure() if self._detName.find('epix') >= 0 or self._detName.find('Epix') >= 0: plt.subplot(211) hist2d(self.__dict__['Y'][self.__dict__['X'] < 351], self.__dict__['adu'][self.__dict__['X'] < 351], numBins=[dY, 180], histLims=[0, dY, aduRange[0], aduRange[1]], limits=[1, maxLim]) plt.subplot(212) hist2d(self.__dict__['Y'][self.__dict__['X'] > 353], self.__dict__['adu'][self.__dict__['X'] > 353], numBins=[dY, 180], histLims=[0, dY, aduRange[0], aduRange[1]], limits=[1, maxLim]) else: hist2d(self.__dict__['Y'][self.__dict__['X'] <= dX], self.__dict__['adu'][self.__dict__['X'] <= dX], numBins=[dY, 180], histLims=[0, dY, aduRange[0], aduRange[1]], limits=[1, maxLim])