Changeset 55 for trunk/GSASIIcomp.py


Ignore:
Timestamp:
Apr 29, 2010 12:27:45 PM (13 years ago)
Author:
vondreel
Message:

3rd try - reduce meatrices in integration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIcomp.py

    r54 r55  
    13411341    sphi = sind(phi)
    13421342    ring = []
    1343     for a in range(0,360,2):
     1343    for a in range(-180,180,2):
    13441344        x = radii[0]*cosd(a)
    13451345        y = radii[1]*sind(a)
     
    14361436    return xy
    14371437                   
    1438 def GetTthDspAzm(x,y,data):
     1438def GetTthAzmDsp(x,y,data):
    14391439    wave = data['wavelength']
    14401440    dist = data['distance']
     
    14531453   
    14541454def GetTth(x,y,data):
    1455     return GetTthDspAzm(x,y,data)[0]
     1455    return GetTthAzmDsp(x,y,data)[0]
    14561456   
    14571457def GetTthAzm(x,y,data):
    1458     return GetTthDspAzm(x,y,data)[0:2]
     1458    return GetTthAzmDsp(x,y,data)[0:2]
    14591459   
    14601460def GetDsp(x,y,data):
    1461     return GetTthDspAzm(x,y,data)[2]
     1461    return GetTthAzmDsp(x,y,data)[2]
    14621462       
    14631463def ImageCompress(image,scale):
     
    16621662    self.TA = GetTthAzm(tay,tax,data)           #2-theta & azimuth arrays
    16631663    self.TA = np.reshape(self.TA,(2,imageN,imageN))
    1664     self.TA = np.dstack((self.TA[1],self.TA[0],self.ImageZ))    #azimuth, 2-theta, intensity order
     1664    self.TA = np.dstack((self.TA[1],self.TA[0]))    #azimuth, 2-theta
    16651665    t2 = time.time()
    16661666    print "Elapsed time:","%8.3f"%(t2-t1), "s"
     
    16681668    print 'Form 1-D histograms for ',numAzms,' azimuthal angles'
    16691669    print 'Integration limits:',LUtth,LRazm
    1670     tax,tay,taz = np.dsplit(self.TA,3)    #azimuth, 2-theta, intensity
     1670    tax,tay = np.dsplit(self.TA,2)    #azimuth, 2-theta, intensity
    16711671    NST = np.histogram2d(tax.flatten(),tay.flatten(),normed=False, \
    16721672        bins=(numAzms,numChans),range=[LRazm,LUtth])
    16731673    HST = np.histogram2d(tax.flatten(),tay.flatten(),normed=False, \
    1674         bins=(numAzms,numChans),weights=taz.flatten(),range=[LRazm,LUtth])
     1674        bins=(numAzms,numChans),weights=self.ImageZ.flatten(),range=[LRazm,LUtth])
    16751675    t3 = time.time()
    16761676    print "Elapsed time:","%8.3f"%(t3-t2), "s"
Note: See TracChangeset for help on using the changeset viewer.