Changeset 123


Ignore:
Timestamp:
Jul 19, 2010 8:08:57 AM (11 years ago)
Author:
vondreel
Message:

Integrate All fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r114 r123  
    501501            ma.getmask(ma.masked_inside(tax.flatten(),azm[0],azm[1])))
    502502    taz = ma.masked_greater(ma.masked_less(image,Zlim[0]),Zlim[1]).flatten()
    503     tam = ma.mask_or(tam,ma.getmask(taz))
     503    tam = ma.mask_or(tam.flatten(),ma.getmask(taz))
    504504    tax = ma.compressed(ma.array(tax.flatten(),mask=tam))
    505505    tay = ma.compressed(ma.array(tay.flatten(),mask=tam))
    506     taz = ma.compressed(ma.array(taz,mask=tam))
     506    taz = ma.compressed(ma.array(taz.flatten(),mask=tam))
    507507    del(tam)
    508508    return tax,tay,taz
    509509   
    510 def ImageIntegrate(self,data,masks):
     510def ImageIntegrate(image,data,masks):
    511511    import histogram2d as h2d
    512512    print 'Begin image integration'
     
    522522    NST = np.zeros(shape=(numAzms,numChans),dtype=np.int,order='F')
    523523    H0 = np.zeros(shape=(numAzms,numChans),order='F',dtype=np.float32)
    524     imageN = len(self.ImageZ)
     524    imageN = len(image)
    525525    nBlks = (imageN-1)/1024+1
    526526    dlg = wx.ProgressDialog("Elapsed time","2D image integration",nBlks*nBlks*3+3,
     
    540540                Nup += 1
    541541                dlg.Update(Nup)
    542                 Block = self.ImageZ[iBeg:iFin,jBeg:jFin]
     542                Block = image[iBeg:iFin,jBeg:jFin]
    543543                tax,tay,taz = Fill2ThetaAzimuthMap(masks,TA,tam,Block)    #and apply masks
    544                 del TA
     544                del TA,tam
    545545                Nup += 1
    546546                dlg.Update(Nup)
    547547                NST,H0 = h2d.histogram2d(len(tax),tax,tay,taz,numAzms,numChans,LRazm,LUtth,Dazm,Dtth,NST,H0)
     548                del tax,tay,taz
    548549                Nup += 1
    549550                dlg.Update(Nup)
     
    558559        else:
    559560            H1 = LRazm
    560         self.Integrate = [H0,H1,H2]
    561         print 'Binning complete'
    562561        Nup += 1
    563562        dlg.Update(Nup)
    564563        t1 = time.time()
    565         print "Elapsed time:","%8.3f"%(t1-t0), "s"
    566         print 'Integration complete'
    567564    finally:
    568565        dlg.Destroy()
     566    print 'Integration complete'
     567    print "Elapsed time:","%8.3f"%(t1-t0), "s"
     568    return H0,H1,H2
Note: See TracChangeset for help on using the changeset viewer.