Changeset 98 for trunk/GSASIIimage.py
 Timestamp:
 Jul 1, 2010 11:32:40 AM (12 years ago)
 File:

 1 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 2theta,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((taxX)**2+(tayY)**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 #2theta & azimuth arrays & position mask 478 483
Note: See TracChangeset
for help on using the changeset viewer.