Changeset 4571
- Timestamp:
- Sep 17, 2020 3:50:24 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIimage.py
r4570 r4571 1217 1217 #prepare masked arrays of bins with pixels for interpolation setup 1218 1218 H2msk = [ma.array(H2[:-1],mask=np.logical_not(nst)) for nst in NST] 1219 H0msk = [ma.array(np.divide(h0,nst),mask=np.logical_not(nst)) for nst,h0 in zip(NST,H0)] 1219 # H0msk = [ma.array(np.divide(h0,nst),mask=np.logical_not(nst)) for nst,h0 in zip(NST,H0)] 1220 H0msk = [ma.array(h0/nst,mask=np.logical_not(nst)) for nst,h0 in zip(NST,H0)] 1220 1221 #make linear interpolators; outside limits give NaN 1221 1222 H0 = [] … … 1512 1513 ''' 1513 1514 from scipy.optimize import minimize_scalar 1514 Arc = [arcTth,[45.,135.],2.0] 1515 print(' Polarization fit for mask at %.1f deg 2-theta'%arcTth) 1516 data = copy.deepcopy(imageData) 1517 data['IOtth'] = [arcTth-2.,arcTth+2.] 1518 data['fullIntegrate'] = True 1519 data['LRazimuth'] = [0.,360.] 1520 data['outChannels'] = 200 1521 data['outAzimuths'] = 1 1522 Arc = [arcTth,[85.,95.],2.0] 1523 print(' Integration 2-theta test range %.1f - %.1f in 200 steps'%(data['IOtth'][0],data['IOtth'][1])) 1515 1524 Masks = {'Points':[],'Rings':[],'Arcs':[],'Polygons':[],'Frames':[], 1516 1525 'Thresholds':imageData['range'],'SpotMask':{'esdMul':3.,'spotMask':None}} 1517 1526 AMasks = {'Points':[],'Rings':[],'Arcs':[Arc,],'Polygons':[],'Frames':[], 1518 1527 'Thresholds':imageData['range'],'SpotMask':{'esdMul':3.,'spotMask':None}} 1519 data = copy.deepcopy(imageData)1520 1528 1521 1529 def func(p): … … 1524 1532 H0 = ImageIntegrate(ImageZ,data,Masks)[0] 1525 1533 H0A = ImageIntegrate(ImageZ,data,AMasks)[0] 1526 M = np.sum(H0 -H0A)1527 print(' polarization %.4f, fxn: %.1f'%(p,M))1534 M = np.sum(H0)-np.sum(H0A) 1535 print(' Polarization %.4f, fxn: %.1f'%(p,M)) 1528 1536 return M**2 1529 1537 -
trunk/GSASIIimgGUI.py
r4570 r4571 137 137 138 138 def OnPolaCalib(event): 139 IOtth = [data['IOtth'][0]+2.,data['IOtth'][1]-2.] 139 if data['IOtth'][1] < 34.: 140 G2G.G2MessageBox(G2frame,'Maximum 2-theta not greater than 34 deg', 141 'Polarization Calibration Error') 142 return 143 IOtth = [32.,data['IOtth'][1]-2.] 140 144 dlg = G2G.SingleFloatDialog(G2frame,'Polarization test arc mask', 141 145 ''' Do not use if pattern has uneven absorption 142 Set 2-theta max in image controls to be fully inside image 143 Enter 2-theta position for arc mask ( %.1f-%.1f) '''%(IOtth[0],IOtth[1]),IOtth[1],IOtth,format='%.2f')146 Set 2-theta max in image controls to be fully inside image 147 Enter 2-theta position for arc mask (32-%.1f) '''%IOtth[1],IOtth[1],IOtth,format='%.2f') 144 148 if dlg.ShowModal() == wx.ID_OK: 145 149 arcTth = dlg.GetValue() -
trunk/GSASIIpwd.py
r4536 r4571 237 237 238 238 """ 239 cazm = npcosd(Azm) 240 sazm = npsind(Azm) 241 pola = ((1.0-Pola)*cazm**2+Pola*npsind(Azm)**2)*npcosd(Tth)**2+ \ 242 (1.0-Pola)*sazm**2+Pola*cazm**2 243 dpdPola = -npsind(Tth)**2*(sazm**2-cazm**2) 239 cazm = npcosd(Azm)**2 240 sazm = npsind(Azm)**2 241 pola = ((1.0-Pola)*cazm+Pola*sazm)*npcosd(Tth)**2+(1.0-Pola)*sazm+Pola*cazm 242 dpdPola = -npsind(Tth)**2*(sazm-cazm) 244 243 return pola,dpdPola 245 244
Note: See TracChangeset
for help on using the changeset viewer.