Changeset 98
- Timestamp:
- Jul 1, 2010 11:32:40 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r94 r98 5 5 import numpy as np 6 6 import numpy.linalg as nl 7 import GSASIIpath 7 8 import GSASIIplot as G2plt 8 9 import GSASIIlattice as G2lat … … 460 461 def Make2ThetaAzimuthMap(data,masks,imageN): 461 462 import numpy.ma as ma 463 import polymask as pm 462 464 #transforms 2D image from x,y space to 2-theta,azimuth space based on detector orientation 463 465 pixelSize = data['pixelSize'] … … 471 473 polygons = masks['Polygons'] 472 474 tam = ma.make_mask_none((imageN,imageN)) 475 for polygon in polygons: 476 tamp = ma.make_mask_none((imageN*imageN)) 477 tam = ma.mask_or(tam.flatten(),ma.make_mask(pm.polymask(imageN*imageN, 478 tax.flatten(),tay.flatten(),len(polygon),polygon,tamp))) 479 tam = np.reshape(tam,(imageN,imageN)) 473 480 for X,Y,diam in spots: 474 481 tam = ma.mask_or(tam,ma.getmask(ma.masked_less((tax-X)**2+(tay-Y)**2,(diam/2.)**2))) 475 for polygon in polygons:476 tam = ma.mask_or(tam.flatten(),ma.make_mask([pointInPolygon(polygon,xy) for xy in zip(tax.flatten(),tay.flatten())]))477 482 return GetTthAzm(tax,tay,data),tam #2-theta & azimuth arrays & position mask 478 483 -
trunk/GSASIIimgGUI.py
r94 r98 589 589 spotText = wx.TextCtrl(parent=self.dataDisplay,value=("%.2f,%.2f" % (x,y)), 590 590 style=wx.TE_READONLY) 591 spotText azmText591 spotText.SetBackgroundColour(VERY_LIGHT_GREY) 592 592 littleSizer.Add(spotText,0,wx.ALIGN_CENTER_VERTICAL) 593 593 spotText.Bind(wx.EVT_ENTER_WINDOW,OnTextMsg)
Note: See TracChangeset
for help on using the changeset viewer.