Changeset 2551 for trunk/GSASIIimage.py


Ignore:
Timestamp:
Nov 30, 2016 3:17:17 PM (5 years ago)
Author:
vondreele
Message:

clean up G2imageGUI
Add start on autoSpot mask - not complete
some adjustments of window sizes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIimage.py

    r2546 r2551  
    11221122    return vals,sig
    11231123   
    1124        
     1124def AutoSpotMasks(Image,Masks,Controls):
     1125    rollImage = lambda rho,roll: np.roll(np.roll(rho,roll[0],axis=0),roll[1],axis=1)
     1126    print 'auto spot search'
     1127    spotMask = ma.array(Image,mask=(Image<10.*np.mean(Image)))
     1128    incre = np.array(Image.shape,dtype=np.float)
     1129    indices = (-1,0,1)
     1130    rolls = np.array([[ix,iy] for ix in indices for iy in indices])
     1131    for roll in rolls:
     1132        if np.any(roll):        #avoid [0,0]
     1133            spotMask = ma.array(spotMask,mask=(spotMask-rollImage(Image,roll)<=0.))
     1134    indx = np.transpose(spotMask.nonzero())
     1135    peaks = indx
     1136    mags = spotMask[spotMask.nonzero()]
     1137    print zip(peaks,mags)
     1138   
     1139       
Note: See TracChangeset for help on using the changeset viewer.