Changeset 3151


Ignore:
Timestamp:
Nov 6, 2017 4:32:17 PM (4 years ago)
Author:
vondreele
Message:

male all default image pixel sizes [200.,200.] so ValidatedTxtCtrl? treats them as floats.
Fix crash when data is deleted from tree.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r3137 r3151  
    42944294            if var == 'Contour_color':
    42954295                if self.vars[var][1] is None:
    4296                     self.vars[var][1] = 'paired'
     4296                    self.vars[var][1] = 'Paired'
    42974297                colorList = sorted([m for m in mpl.cm.datad.keys() ],key=lambda s: s.lower())   #if not m.endswith("_r")
    42984298                self.colSel = wx.ComboBox(self,value=self.vars[var][1],choices=colorList,
  • trunk/GSASIIdataGUI.py

    r3139 r3151  
    72967296            parentID = G2frame.GPXtree.GetItemParent(item)
    72977297            # save name of calling tree item for help. N.B. may want to override this later
    7298             prfx = G2frame.GPXtree.GetItemText(item).split()[0].upper()
     7298            prfx = G2frame.GPXtree.GetItemText(item)
     7299            if prfx:
     7300                prfx = prfx.split()[0].upper()
     7301            else:   #just deleted item - escape!!
     7302                return
    72997303            prfx1 = G2frame.GPXtree.GetItemText(parentID).split()[0]
    73007304            if prfx in ('IMG','PKS','PWDR','SASD','HKLF','PDF','REFD',):
     
    73127316            G2frame.dataWindow.helpKey = ''
    73137317            if GSASIIpath.GetConfigValue('debug'):
    7314                 print ('bug: why here?')
     7318                print ('bug: why here? prfx=%s prfx1=%s'%(prfx,prfx1))
    73157319                G2obj.HowDidIgetHere()
    73167320       
  • trunk/GSASIIobj.py

    r3137 r3151  
    21872187        data items are needed:
    21882188
    2189          * 'pixelSize': size of each pixel in microns (such as ``[200,200]``.
     2189         * 'pixelSize': size of each pixel in microns (such as ``[200.,200.]``.
    21902190         * 'wavelength': wavelength in Angstoms.
    21912191         * 'distance': distance of detector from sample in cm.
  • trunk/GSASIIplot.py

    r3150 r3151  
    51325132                    ToggleMultiSpotMask(G2frame)
    51335133                else:
     5134                    #TODO - try a fit of spot to image?
    51345135                    spot = [Xpos,Ypos,G2frame.spotSize]
    51355136                    Masks['Points'].append(spot)
  • trunk/imports/G2img_1TIF.py

    r3143 r3151  
    7474                self.SciPy = True
    7575                self.Comments = ['no metadata']
    76                 self.Data = {'wavelength': 0.1, 'pixelSize': [200, 200], 'distance': 100.0}
     76                self.Data = {'wavelength': 0.1, 'pixelSize': [200., 200.], 'distance': 100.0}
    7777                self.Data['size'] = list(self.Image.shape)
    7878                self.Data['center'] = [int(i/2) for i in self.Image.shape]
  • trunk/imports/G2img_GE.py

    r3136 r3151  
    180180            filename = os.path.splitext(filename)[0]+'.G2img'
    181181            File = open(filename,'wb')
    182             Data = {'pixelSize':[200,200],'wavelength':0.15,'distance':250.0,'center':[204.8,204.8],'size':sizexy}
     182            Data = {'pixelSize':[200.,200.],'wavelength':0.15,'distance':250.0,'center':[204.8,204.8],'size':sizexy}
    183183            image = np.reshape(image,(sizexy[1],sizexy[0]))
    184184            cPickle.dump([head,Data,Npix,image],File,1)
     
    188188            sum = False
    189189    image = np.reshape(image,(sizexy[1],sizexy[0]))
    190     data = {'pixelSize':[200,200],'wavelength':0.15,'distance':250.0,'center':[204.8,204.8],'size':sizexy}
     190    data = {'pixelSize':[200.,200.],'wavelength':0.15,'distance':250.0,'center':[204.8,204.8],'size':sizexy}
    191191    File.close()
    192192    print ('Image read time %.2fs'%(time.time()-time0))
Note: See TracChangeset for help on using the changeset viewer.