Changeset 246


Ignore:
Timestamp:
Feb 13, 2011 6:20:15 PM (11 years ago)
Author:
vondreele
Message:

fix copy controls for images - needed deepcopy
multi frame GE detector images now automatically summed when read.
also earlier commit - image calibration will compute a "suggested" new wavelength - not imposed however as it may be wrong.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r244 r246  
    467467   
    468468def GetGEsumData(filename,imageOnly=False):
     469    import struct as st
    469470    import array as ar
    470471    if not imageOnly:
     
    479480    else:
    480481        head = ['GE detector raw data from APS 1-ID',]
     482        File.seek(18)
     483        size,nframes = st.unpack('<ih',File.read(6))
    481484        sizexy = [2048,2048]
    482485        pos = 8192
     
    489492    else:
    490493        image = np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32)
     494        while nframes > 1:
     495            image += np.array(ar.array('H',File.read(2*Npix)),dtype=np.int32)
     496            nframes -= 1
    491497    image = np.reshape(image,(sizexy[1],sizexy[0]))
    492498    data = {'pixelSize':(200,200),'wavelength':0.15,'distance':250.0,'center':[204.8,204.8],'size':sizexy} 
  • trunk/GSASIIimgGUI.py

    r245 r246  
    259259           
    260260    def OnCopyControls(event):
     261        import copy
    261262        TextList = []
    262263        Names = []
     
    269270                    if id == self.Image:
    270271                        Source = name
    271                         Data = self.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(self,id, 'Image Controls'))
     272                        Data = copy.deepcopy(self.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(self,id, 'Image Controls')))
    272273                        Data['showLines'] = True
    273274                        Data['ring'] = []
    274275                        Data['rings'] = []
    275                         Data['cutoff'] = 10
    276                         Data['pixLimit'] = 20
    277276                        Data['ellipses'] = []
    278                         Data['calibrant'] = ''
    279277                        Data['setDefault'] = False
    280278                    else:
     
    291289                        ifcopy,name,id = item
    292290                        if ifcopy:
    293                             oldData = self.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(self,id, 'Image Controls'))
     291                            oldData = copy.deepcopy(self.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(self,id, 'Image Controls')))
    294292                            Data['range'] = oldData['range']
    295293                            Data['size'] = oldData['size']                               
Note: See TracChangeset for help on using the changeset viewer.