def initData(self,fname=None): "initData(self,fname=None) - initialized data array loaded in from fname " self.minY = 0 self.minX = 0 if os.path.isfile(fname): da = readArray(fname) da = transposeA(da) # column oriented else: da = indgen([100,50]) print '***Test data: indgen([100,50]) used' v1,v2 = minmax(da) self.vmax = v2 self.vmin = v1 self.steps = len(da[0]) #100 self.rows = len(da) #30 #10 self.maxX = self.steps self.maxY = self.rows self.data = da self.extractSubArray(da) self.data0 = self.data self.spectrum = Pmw.Color.spectrum(self.steps, saturation=0.8, intensity=0.8, extraOrange=1) self.lineColor = 'gray80' self.lowThresh = 0 # 30 self.highThresh = 255 # 70
def initData(self, fname=None): "initData(self,fname=None) - initialized data array loaded in from fname " self.minY = 0 self.minX = 0 if os.path.isfile(fname): da = readArray(fname) da = transposeA(da) # column oriented else: da = indgen([100, 50]) print '***Test data: indgen([100,50]) used' v1, v2 = minmax(da) self.vmax = v2 self.vmin = v1 self.steps = len(da[0]) #100 self.rows = len(da) #30 #10 self.maxX = self.steps self.maxY = self.rows self.data = da self.extractSubArray(da) self.data0 = self.data self.spectrum = Pmw.Color.spectrum(self.steps, saturation=0.8, intensity=0.8, extraOrange=1) self.lineColor = 'gray80' self.lowThresh = 0 # 30 self.highThresh = 255 # 70
def CRFresetArray(self): 'CRFresetArray(self) - extract and display ROI from array in memory' import string i1 = self.CRW[0].get() i2 = self.CRW[1].get() j1 = self.CRW[2].get() j2 = self.CRW[3].get() if i1 == i2 or j1 == j2: return if i2 < i1: tp = i1 i1 = i2 i2 = tp if j2 < j1: tp = j1 j1 = j2 j2 = tp if i1 <1 : i1=1 if j1 <1 : j1=1 da = self.data0 data=[] for j in range(j1-1,j2): ls = da[j] data.append(da[j][i1-1:i2]) self.data = data v1,v2 = minmax(data) self.vmax = v2 self.vmin = v1 self.clearcanvas() self.maxX = len(data[0]) self.maxY = len(data) self.steps = len(data[0]) self.rows = len(data) self.createAxis() self.draw()
def CRFresetArray(self): 'CRFresetArray(self) - extract and display ROI from array in memory' import string i1 = self.CRW[0].get() i2 = self.CRW[1].get() j1 = self.CRW[2].get() j2 = self.CRW[3].get() if i1 == i2 or j1 == j2: return if i2 < i1: tp = i1 i1 = i2 i2 = tp if j2 < j1: tp = j1 j1 = j2 j2 = tp if i1 < 1: i1 = 1 if j1 < 1: j1 = 1 da = self.data0 data = [] for j in range(j1 - 1, j2): ls = da[j] data.append(da[j][i1 - 1:i2]) self.data = data v1, v2 = minmax(data) self.vmax = v2 self.vmin = v1 self.clearcanvas() self.maxX = len(data[0]) self.maxY = len(data) self.steps = len(data[0]) self.rows = len(data) self.createAxis() self.draw()