Changeset 4180


Ignore:
Timestamp:
Oct 16, 2019 3:46:52 PM (4 years ago)
Author:
vondreele
Message:

reoptimize integration block size; now 128 seems fastest (was 256 but added an array)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r4178 r4180  
    10731073    arcs = masks['Arcs']
    10741074    TA = np.dstack((ma.getdata(TA[1]),ma.getdata(TA[0]),ma.getdata(TA[2]),ma.getdata(TA[3])))    #azimuth, 2-theta, dist, pol
    1075     tax,tay,tad,pol = np.dsplit(TA,4)    #azimuth, 2-theta, dist**2/d0**2
     1075    tax,tay,tad,pol = np.dsplit(TA,4)    #azimuth, 2-theta, dist**2/d0**2, pol
    10761076    for tth,thick in rings:
    10771077        tam = ma.mask_or(tam.flatten(),ma.getmask(ma.masked_inside(tay.flatten(),max(0.01,tth-thick/2.),tth+thick/2.)))
     
    11721172            jFin = min(jBeg+blkSize,Nx)
    11731173            # next is most expensive step!
     1174
    11741175            t0 = time.time()
    11751176            if useTA:
     
    11771178            else:
    11781179                TA = Make2ThetaAzimuthMap(data,(iBeg,iFin),(jBeg,jFin))           #2-theta & azimuth arrays & create position mask
    1179             times[1] += time.time()-t0
     1180            times[1] += time.time()-t0      #xy->th,azm
     1181
    11801182            t0 = time.time()
    11811183            if useMask:
     
    11831185            else:
    11841186                tam = MakeMaskMap(data,Masks,(iBeg,iFin),(jBeg,jFin),tamp)
     1187            times[0] += time.time()-t0      #apply masks
     1188
     1189            t0 = time.time()
    11851190            Block = image[iBeg:iFin,jBeg:jFin]
    11861191            tax,tay,taz,tad,tabs,pol = Fill2ThetaAzimuthMap(Masks,TA,tam,Block)    #and apply masks
    1187 #            pol = TA[3].flatten()     #G2pwd.Polarization(data['PolaVal'][0],tay,tax-90.)[0]         #for pixel pola correction
    1188             times[0] += time.time()-t0
    1189             t0 = time.time()
    11901192            tax = np.where(tax > LRazm[1],tax-360.,tax)                 #put azm inside limits if possible
    11911193            tax = np.where(tax < LRazm[0],tax+360.,tax)
     
    12001202            elif 'q' == data.get('binType','').lower():
    12011203                tay = 4.*np.pi*npsind(tay/2.)/data['wavelength']
    1202             times[2] += time.time()-t0
     1204            times[2] += time.time()-t0          #fill map
     1205
    12031206            t0 = time.time()
    12041207            taz = np.array((taz*tad/tabs),dtype='float32')/pol
     
    12061209                NST,H0 = h2d.histogram2d(len(tax),tax,tay,taz,
    12071210                    numAzms,numChans,LRazm,lutth,Dazm,dtth,NST,H0)
    1208             times[3] += time.time()-t0
     1211            times[3] += time.time()-t0          #binning
    12091212    G2fil.G2Print('End integration loops')
     1213
    12101214    t0 = time.time()
    12111215    #prepare masked arrays of bins with pixels for interpolation setup
     
    12321236    if data['Oblique'][1]:
    12331237        H0 /= G2pwd.Oblique(data['Oblique'][0],H2[:-1])
    1234     times[4] += time.time()-t0
     1238    times[4] += time.time()-t0          #cleanup
     1239
    12351240    G2fil.G2Print ('Step times: \n apply masks  %8.3fs xy->th,azm   %8.3fs fill map     %8.3fs \
    12361241        \n binning      %8.3fs cleanup      %8.3fs'%(times[0],times[1],times[2],times[3],times[4]))
  • trunk/GSASIIimgGUI.py

    r4109 r4180  
    150150##### Image Controls
    151151################################################################################                   
    152 blkSize = 256   #256 seems to be optimal; will break in polymask if >1024
     152blkSize = 128   #128 seems to be optimal; will break in polymask if >1024
    153153def UpdateImageControls(G2frame,data,masks,useTA=None,useMask=None,IntegrateOnly=False):
    154154    '''Shows and handles the controls on the "Image Controls"
Note: See TracChangeset for help on using the changeset viewer.