Changeset 38


Ignore:
Timestamp:
Mar 7, 2010 9:02:24 AM (12 years ago)
Author:
vondreel
Message:

convert to python 2.6 from Enthought
small fixes to plotting ellipses

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r36 r38  
    253253        if self.PickId:
    254254            if self.PatternTree.GetItemText(self.PickId) in ['Peak List','Limits','Peak Index List','Unit Cell List','Background']:
    255                 ax = self.pdplot.gca()
    256                 self.plotView = [ax.get_xlim(),ax.get_ylim()]
     255                self.plotView = self.getPlotLimits()
    257256        item = event.GetItem()
    258257        G2gd.MovePatternTreeToGrid(self,item)
     
    10121011        file.close()
    10131012        self.UnDo.Enable(True)
     1013       
     1014    def getPlotLimits(self):
     1015        ax = self.pdplot.gca()
     1016        return [ax.get_xlim(),ax.get_ylim()]
     1017
    10141018         
    10151019    def ClearEventList(self,eventList):
     
    12631267        ax.set_xlabel('Image x-axis, mm',fontsize=12)
    12641268        ax.set_ylabel('Image y-axis, mm',fontsize=12)
     1269        A = G2cmp.ImageCompress(self.ImageZ,imScale)
    12651270        self.Img = ax.imshow(self.ImageZ[::imScale,::imScale], \
    12661271            aspect='equal',cmap=acolor, \
    1267             interpolation='nearest',vmin=Imin,vmax=Imax,picker=1, \
     1272            interpolation='nearest',vmin=Imin,vmax=Imax, \
    12681273            extent=[0,Xmax,Xmax,0])
    12691274        ax.text(xcent,ycent,'+',ha='center',va='center',picker=3)
     
    12961301        for ellipse in Data['ellipses']:
    12971302            cent,phi,[width,height] = ellipse
    1298             ax.add_artist(Ellipse([cent[0],cent[1]],2*width,2*height,phi,ec='r',fc=None))
    1299             ax.text(cent[0],cent[1],'+',color='b',ha='center',va='center',picker=3)
     1303            ax.add_artist(Ellipse([cent[0],cent[1]],2*width,2*height,phi,ec='r',fc='none'))
     1304            ax.text(cent[0],cent[1],'+',color='b',ha='center',va='center')
    13001305        self.Img.axes.set_xlim(xlim)
    13011306        self.Img.axes.set_ylim(ylim)
     
    14541459            LimitId = 0
    14551460            if PickId:
    1456                 ifpicked = Pattern[2] in self.PatternTree.GetItemText(PatternId)
     1461                ifpicked = Pattern[2] == self.PatternTree.GetItemText(PatternId)
    14571462                LimitId = G2gd.GetPatternTreeItemId(self,PatternId, 'Limits')
    14581463            xye = Pattern[1]
  • trunk/GSASIIIO.py

    r37 r38  
    473473        line = ar.array('H',File.read(2*size))
    474474        image[row] = np.asarray(line)
    475         if row == 3390: print len(line)
    476475        row += 1
    477476        pos += 2*size
  • trunk/GSASIIcomp.py

    r36 r38  
    13161316    elcent = [cent[0]-zdis*sinp,cent[1]+zdis*cosp]
    13171317    return elcent,phi,radii
     1318   
     1319def ImageCompress(image,scale):
     1320    if scale == 1:
     1321        return image
     1322    else:
     1323        return image[::scale,::scale]
    13181324       
    13191325def ImageCalibrate(self,data):
Note: See TracChangeset for help on using the changeset viewer.