 Timestamp:
 Sep 18, 2020 3:22:51 PM (2 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIimage.py
r4571 r4572 1511 1511 def DoPolaCalib(ImageZ,imageData,arcTth): 1512 1512 ''' Determine image polarization by successive integrations with & without preset arc mask. 1513 After initial search, does a set of five with offset azimuth to get mean(std) result. 1513 1514 ''' 1514 1515 from scipy.optimize import minimize_scalar … … 1522 1523 Arc = [arcTth,[85.,95.],2.0] 1523 1524 print(' Integration 2theta test range %.1f  %.1f in 200 steps'%(data['IOtth'][0],data['IOtth'][1])) 1525 print(' Mask azimuth range: %.1f  %.1f'%(Arc[1][0],Arc[1][1])) 1524 1526 Masks = {'Points':[],'Rings':[],'Arcs':[],'Polygons':[],'Frames':[], 1525 1527 'Thresholds':imageData['range'],'SpotMask':{'esdMul':3.,'spotMask':None}} … … 1535 1537 print(' Polarization %.4f, fxn: %.1f'%(p,M)) 1536 1538 return M**2 1537 1539 time0 = time.time() 1538 1540 res = minimize_scalar(func,bracket=[1.,.999],tol=.0001) 1539 1541 print(res) 1540 1542 pola = min(1.0,max(res.x,.0)) 1541 imageData['PolaVal'][0] = pola 1543 1544 Pola = [] 1545 for arc in [75,80,85,90,95]: 1546 Arc = [arcTth,[arc,arc+10.],2.0] 1547 AMasks = {'Points':[],'Rings':[],'Arcs':[Arc,],'Polygons':[],'Frames':[], 1548 'Thresholds':imageData['range'],'SpotMask':{'esdMul':3.,'spotMask':None}} 1549 res = minimize_scalar(func,bracket=[pola.001,pola],tol=.0001) 1550 print(' Mask azimuth range: %.1f  %.1f'%(Arc[1][0],Arc[1][1])) 1551 print(' pola: %.5f'%res.x) 1552 Pola.append(res.x) 1553 Pola = np.array(Pola) 1554 mean = np.mean(Pola) 1555 std = int(10000*np.std(Pola)) 1556 print(' Polarization: %.4f(%d)'%(mean,std)) 1557 print(' time: %.2fs'%(time.time()time0)) 1558 imageData['PolaVal'][0] = mean 1559
Note: See TracChangeset
for help on using the changeset viewer.