Changeset 101
 Timestamp:
 Jul 1, 2010 2:50:32 PM (13 years ago)
 Files:

 1 added
 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIimage.py
r98 r101 473 473 polygons = masks['Polygons'] 474 474 tam = ma.make_mask_none((imageN,imageN)) 475 if polygons: 476 print 'Generate polygon mask' 475 477 for polygon in polygons: 476 478 tamp = ma.make_mask_none((imageN*imageN)) 477 479 tam = ma.mask_or(tam.flatten(),ma.make_mask(pm.polymask(imageN*imageN, 478 480 tax.flatten(),tay.flatten(),len(polygon),polygon,tamp))) 481 if spots: 482 print 'Generate spot mask' 479 483 tam = np.reshape(tam,(imageN,imageN)) 480 484 for X,Y,diam in spots: … … 491 495 TA = np.dstack((ma.getdata(TA[1]),ma.getdata(TA[0]))) #azimuth, 2theta 492 496 tax,tay = np.dsplit(TA,2) #azimuth, 2theta 497 if rings: 498 print 'Generate ring mask' 493 499 for tth,thick in rings: 494 500 tam = ma.mask_or(tam.flatten(),ma.getmask(ma.masked_inside(tay.flatten(),max(0.01,tththick/2.),tth+thick/2.))) 501 if arcs: 502 print 'Generate arc mask' 495 503 for tth,azm,thick in arcs: 496 504 tam = ma.mask_or(tam.flatten(),ma.getmask(ma.masked_inside(tay.flatten(),max(0.01,tththick/2.),tth+thick/2.))* \ … … 506 514 def Bin2ThetaAzimuthMap(data,tax,tay,taz): 507 515 import numpy.ma as ma 516 import histogram2d as h2d 508 517 LUtth = data['IOtth'] 509 518 if data['fullIntegrate']: … … 513 522 numAzms = data['outAzimuths'] 514 523 numChans = data['outChannels'] 515 NST = np.histogram2d(tax,tay,normed=False,bins=(numAzms,numChans),range=[LRazm,LUtth]) 516 HST = np.histogram2d(tax,tay,normed=False,bins=(numAzms,numChans),range=[LRazm,LUtth],weights=taz) 524 NST = np.zeros(shape=(numAzms,numChans),dtype=int,order='F') 525 H0 = np.zeros(shape=(numAzms,numChans),order='F') 526 H1 = np.zeros(shape=(numAzms+1,)) 527 H2 = np.zeros(shape=(numChans+1,)) 528 NST,H0,H1,H2 = h2d.histogram2d(len(tax),tax,tay,taz,numAzms,numChans,LRazm,LUtth,NST,H0,H1,H2) 529 HST = [H0,H1,H2] 517 530 return NST,HST 518 531
Note: See TracChangeset
for help on using the changeset viewer.