Changeset 2613


Ignore:
Timestamp:
Jan 6, 2017 9:34:29 AM (5 years ago)
Author:
vondreele
Message:

auto spot mask work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r2604 r2613  
    3030import GSASIIpwd as G2pwd
    3131import GSASIIspc as G2spc
     32import GSASIImath as G2mth
    3233
    3334# trig functions in degrees
     
    11411142            cent[1,1] = mag
    11421143            msk = np.array(Image[ind[0]-1:ind[0]+2,ind[1]-1:ind[1]+2])
    1143             msk = msk-cent
    1144             if mag > 1.5*np.mean(msk):
     1144            msk = ma.array(msk,mask=(msk==mag))
     1145            if mag > 1.33*ma.mean(msk):
    11451146                jndx.append([ind[1]+.5,ind[0]+.5])
     1147    print 'Spots found: ',len(jndx)
    11461148    if len(jndx) > 100:
    11471149        txt = 'Found: %d. Too many spots found; are rings spotty?'%(len(jndx))
     
    11501152    peaks = jndx*pixelSize/1000.
    11511153    tth = GetTth(peaks.T[0],peaks.T[1],Controls)
    1152     histo = np.histogram(tth,2500)
     1154    Peakarray = np.vstack((tth,peaks.T)).T
     1155    Peakarray = np.array(G2mth.sortArray(Peakarray,0))  #now in 2theta order
    11531156    Points = np.ones((peaks.shape[0],3))
    1154     Points[:,:2] = peaks
     1157    Points[:,:2] = Peakarray[:,1:]
    11551158    Masks['Points'] = Points
    11561159    return None
Note: See TracChangeset for help on using the changeset viewer.