Changeset 4032 for trunk/GSASIIimage.py


Ignore:
Timestamp:
Jun 19, 2019 4:13:00 PM (2 years ago)
Author:
vondreele
Message:

fix 'Resolution' in old gpx to 'GridStep?'
fix to bad logical operator in MakeFrameMask?
apply polarization pixel by pixel in integration; then put back on for azm=0 for powder diffraction
remove a wasted busycursor
add Xlines & Ylines to masks to mask whole row/columns of pixels (not quite complete)
make picktype = None for unknown picks ('?' causes crash)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r4026 r4032  
    548548            tamp = ma.make_mask_none((1024*1024))
    549549            tamp = ma.make_mask(pm.polymask(nI*nJ,tax.flatten(),
    550                 tay.flatten(),len(frame),frame,tamp)[:nI*nJ])-True  #switch to exclude around frame
     550                tay.flatten(),len(frame),frame,tamp)[:nI*nJ])^True  #switch to exclude around frame
    551551            if tamp.shape:
    552552                tamp = np.reshape(tamp[:nI*nJ],(nI,nJ))
     
    10241024            Block = image[iBeg:iFin,jBeg:jFin]
    10251025            tax,tay,taz,tad,tabs = Fill2ThetaAzimuthMap(Masks,TA,tam,Block)    #and apply masks
     1026            pol = G2pwd.Polarization(data['PolaVal'][0],tay,tax-90.)[0]         #for pixel pola correction
    10261027            times[0] += time.time()-t0
    10271028            t0 = time.time()
     
    10401041            times[2] += time.time()-t0
    10411042            t0 = time.time()
    1042             taz = np.array((taz*tad/tabs),dtype='float32')
     1043            taz = np.array((taz*tad/tabs),dtype='float32')/pol
    10431044            if any([tax.shape[0],tay.shape[0],taz.shape[0]]):
    10441045                NST,H0 = h2d.histogram2d(len(tax),tax,tay,taz,
    10451046                    numAzms,numChans,LRazm,lutth,Dazm,dtth,NST,H0)
    10461047            times[3] += time.time()-t0
    1047 #            print('done block %d %d %d %d %d %d %d %d'%(iBlk,iBeg,iFin,jBlk,jBeg,jFin,np.min(Block),np.max(Block)))
    10481048    G2fil.G2Print('End integration loops')
    10491049    t0 = time.time()
    1050 #    H2 = np.array([tth for tth in np.linspace(lutth[0],lutth[1],numChans+1)])
    1051 #    NST = np.array(NST,dtype=np.float32)
    10521050    #prepare masked arrays of bins with pixels for interpolation setup
    10531051    H2msk = [ma.array(H2[:-1],mask=np.logical_not(nst)) for nst in NST]
     
    10661064    else:
    10671065        H1 = LRazm
     1066    if 'SASD' not in data['type']:
     1067        H0 *= np.array(G2pwd.Polarization(data['PolaVal'][0],H2[:-1],0.)[0])
    10681068    H0 /= npcosd(H2[:-1])           #**2? I don't think so, **1 is right for powders
    10691069    if 'SASD' in data['type']:
     
    10711071    if data['Oblique'][1]:
    10721072        H0 /= G2pwd.Oblique(data['Oblique'][0],H2[:-1])
    1073     if 'SASD' in data['type'] and data['PolaVal'][1]:
    1074         #NB: in G2pwd.Polarization azm is defined from plane of polarization, not image x axis!
    1075         H0 /= np.array([G2pwd.Polarization(data['PolaVal'][0],H2[:-1],Azm=azm-90.)[0] for azm in (H1[:-1]+np.diff(H1)/2.)])
    10761073    times[4] += time.time()-t0
    10771074    G2fil.G2Print ('Step times: \n apply masks  %8.3fs xy->th,azm   %8.3fs fill map     %8.3fs \
Note: See TracChangeset for help on using the changeset viewer.