Changeset 4571 for trunk/GSASIIimage.py


Ignore:
Timestamp:
Sep 17, 2020 3:50:24 PM (13 months ago)
Author:
vondreele
Message:

Improvements to polarization stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r4570 r4571  
    12171217    #prepare masked arrays of bins with pixels for interpolation setup
    12181218    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)]
    12201221    #make linear interpolators; outside limits give NaN
    12211222    H0 = []
     
    15121513    '''
    15131514    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]))
    15151524    Masks = {'Points':[],'Rings':[],'Arcs':[],'Polygons':[],'Frames':[],
    15161525        'Thresholds':imageData['range'],'SpotMask':{'esdMul':3.,'spotMask':None}}
    15171526    AMasks = {'Points':[],'Rings':[],'Arcs':[Arc,],'Polygons':[],'Frames':[],
    15181527        'Thresholds':imageData['range'],'SpotMask':{'esdMul':3.,'spotMask':None}}
    1519     data = copy.deepcopy(imageData)
    15201528   
    15211529    def func(p):
     
    15241532        H0 = ImageIntegrate(ImageZ,data,Masks)[0]
    15251533        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))
    15281536        return M**2
    15291537   
Note: See TracChangeset for help on using the changeset viewer.