Changeset 167


Ignore:
Timestamp:
Oct 29, 2010 3:04:03 PM (15 years ago)
Author:
vondreele
Message:

image fixes for offset detector
drawing/phase fixes

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASII.py

    r166 r167  
    1919import GSASIIpwdGUI as G2pdG
    2020import GSASIIspc as G2spc
     21import GSASIIstruct as G2str
    2122import OpenGL as ogl
    2223
     
    2930print "OpenGL:     ",ogl.__version__
    3031
    31 __version__ = '0.1.4'
     32__version__ = '0.1.5'
    3233
    3334# useful degree trig functions
     
    4647
    4748[wxID_FILECLOSE, wxID_FILEEXIT, wxID_FILEOPEN,
    48  wxID_FILESAVE, wxID_FILESAVEAS, wxID_UNDO,
    49 ] = [wx.NewId() for _init_coll_File_Items in range(6)]
     49 wxID_FILESAVE, wxID_FILESAVEAS, wxID_UNDO, wxID_REFINE,
     50] = [wx.NewId() for _init_coll_File_Items in range(7)]
    5051
    5152[wxID_PWDRREAD,wxID_SNGLREAD,wxID_ADDPHASE,wxID_DELETEPHASE,
     
    125126               
    126127    def _init_coll_Calculate_Items(self,parent):
     128        self.Refine = parent.Append(help='', id=wxID_REFINE, kind=wx.ITEM_NORMAL,
     129            text='Refine')
     130        self.Refine.Enable(False)
     131        self.Bind(wx.EVT_MENU, self.OnRefine, id=wxID_REFINE)
    127132        self.UnDo = parent.Append(help='', id=wxID_UNDO, kind=wx.ITEM_NORMAL,
    128133            text='UnDo')
     
    259264            G2IO.ProjFileOpen(self)
    260265            self.PatternTree.Expand(self.root)
     266            self.Refine.Enable(True)
    261267
    262268    def OnSize(self,event):
     
    389395        'MAR345 (*.mar3450;*.mar2300)|*.mar3450;*.mar2300|ADSC Image (*.img)\
    390396        |*.img|Detector tif (*.tif;*.tiff)|*.tif;*.tiff|GE Image sum (*.sum)\
    391         |*.sum|GE Image avg (*.avg)|*.avg|All files (*.*)|*.*',wx.OPEN | wx.MULTIPLE)
     397        |*.sum|GE Image avg (*.avg)|*.avg|GE Image raw (*)|*|All files (*.*)|*.*',wx.OPEN | wx.MULTIPLE)
    392398        if self.dirname:
    393399            dlg.SetDirectory(self.dirname)
     
    486492            self.PatternTree.SetItemPyData(sub,[''])
    487493            sub = self.PatternTree.AppendItem(parent=self.root,text='Controls')
    488             self.PatternTree.SetItemPyData(sub,[0])
     494            self.PatternTree.SetItemPyData(sub,{})
    489495               
    490496    class CopyDialog(wx.Dialog):
     
    926932                    while item and not Id:
    927933                        name = self.PatternTree.GetItemText(item)
    928                         if 'PWDR' in name or 'HKLF' in name or 'IMG' in name:
     934                        if name[:4] in ['PWDR','HKLF','IMG']:
    929935                            Id = item
     936                        elif name == 'Controls':
     937                            data = self.PatternTree.GetItemPyData(item)
     938                            if data != [0] and data != {}:
     939                                self.Refine.Enable(True)
    930940                        item, cookie = self.PatternTree.GetNextChild(self.root, cookie)               
    931941                    if Id:
     
    11231133        self.UnDo.Enable(False)
    11241134       
     1135    def OnRefine(self,event):
     1136        #works - but it'd be better if it could restore plots
     1137        G2str.Refine(self.GSASprojectfile)
     1138        dlg = wx.MessageDialog(self,'Load new result?','Refinement results',wx.OK|wx.CANCEL)
     1139        try:
     1140            if dlg.ShowModal() == wx.ID_OK:
     1141                self.PatternTree.DeleteChildren(self.root)
     1142                if self.HKL: self.HKL = []
     1143                if self.G2plotNB.plotList:
     1144                    self.G2plotNB.clear()
     1145                G2IO.ProjFileOpen(self)
     1146        finally:
     1147            dlg.Destroy()
     1148       
    11251149    def DoUnDo(self):
    11261150        print 'Undo last refinement'
  • TabularUnified trunk/GSASIIIO.py

    r166 r167  
    392392    elif ext == '.mar3450' or ext == '.mar2300':
    393393        Comments,Data,Size,Image = GetMAR345Data(imagefile)
    394     elif ext in ['.sum','.avg']:
     394    elif ext in ['.sum','.avg','']:
    395395        Comments,Data,Size,Image = GetGEsumData(imagefile)
    396396    elif ext == '.G2img':
     
    419419    File = open(filename,'rb')
    420420    size = 2048
     421    row = 0
     422    pos = 0
    421423    if '.sum' in filename:
    422424        head = ['GE detector sum data from APS 1-ID',]
    423425    if '.avg' in filename:
    424426        head = ['GE detector avg data from APS 1-ID',]
     427    else:
     428        head = ['GE detector raw data from APS 1-ID',]
     429        pos = 8192
    425430    image = np.zeros(shape=(size,size),dtype=np.int32)
    426     row = 0
    427     pos = 0
    428431    while row < size:
    429432        File.seek(pos)
     
    432435            pos += 4*size
    433436        elif '.avg' in filename:
     437            line = ar.array('H',File.read(2*size))
     438            pos += 2*size
     439        else:
    434440            line = ar.array('H',File.read(2*size))
    435441            pos += 2*size
     
    700706            self.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(self,Id,'Background'),[['chebyschev',1,3,1.0,0.0,0.0]])
    701707            self.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(self,Id,'Instrument Parameters'),[tuple(parms),parms,codes,names])
    702             self.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(self,Id,'Sample Parameters'),Sample)
    703708            self.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(self,Id,'Peak List'),[])
    704709            self.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(self,Id,'Index Peak List'),[])
     
    710715            self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Background'),[['chebyschev',1,3,1.0,0.0,0.0]])
    711716            self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Instrument Parameters'),[tuple(parms),parms,codes,names])
    712             self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(self,Id,'Sample Parameters'),Sample)
     717            self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Sample Parameters'),Sample)
    713718            self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Peak List'),[])
    714719            self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Index Peak List'),[])
  • TabularUnified trunk/GSASIIgrid.py

    r164 r167  
    405405           
    406406def UpdateControls(self,data):
    407     if data:
    408         self.dataFrame.SetLabel('Controls')
    409        
     407    '''
     408    #Fourier controls
     409    'mapType':'Fobs','d-max':100.,'d-min':0.2,'histograms':[],
     410    'stepSize':[0.5,0.5,0.5],'minX':[0.,0.,0.],'maxX':[1.0,1.0,1.0],
     411    #distance/angle controls
     412    'distMax':0.0,'angleMax':0.0,'useMapPeaks':False}
     413    '''
     414       
     415    def SetStatusLine(text):
     416        Status.SetStatusText(text)
     417                                     
     418    def OnNumCycles(event):
     419        try:
     420            value = max(0,min(200,int(Ncyc.GetValue())))
     421        except ValueError:
     422            value = 3
     423        data['Ncycles'] = value
     424        Ncyc.SetValue('%d'%(value))
     425       
     426    def OnConvergence(event):
     427        try:
     428            value = max(0.01,min(100.,float(Cnvrg.GetValue())))
     429        except ValueError:
     430            value = 0.01
     431        data['minSumShftESD'] = value
     432        Cnvrg.SetValue('%.2f'%(value))
     433       
     434    def OnAtomShift(event):
     435        try:
     436            value = max(0.1,min(5.,float(AtShft.GetValue())))
     437        except ValueError:
     438            value = 2.0
     439        data['maxShift'] = value
     440        AtShft.SetValue('%.1f'%(value))
     441       
     442    def OnMarquardt(event):
     443        try:
     444            value = max(1.0,min(10.0,float(Marq.GetValue())))
     445        except ValueError:
     446            value = 1.0
     447        data['Marquardt'] = value
     448        Marq.SetValue('%.2f'%(value))
     449       
     450    def OnBandWidth(event):
     451        try:
     452            value = max(0,min(200,int(Band.GetValue())))
     453        except ValueError:
     454            value = 0
     455        data['bandWidth'] = value
     456        Band.SetValue('%d'%(value))
     457       
     458    def OnRestraint(event):
     459        data['restraintWeight'] = Restraint.GetValue()
     460
     461    if self.dataDisplay:
     462        self.dataDisplay.Destroy()
     463    if not self.dataFrame.GetStatusBar():
     464        Status = self.dataFrame.CreateStatusBar()
     465    SetStatusLine('')
     466    self.dataFrame.SetLabel('Controls')
     467    self.dataDisplay = wx.Panel(self.dataFrame)
     468    self.dataFrame.SetMenuBar(self.dataFrame.BlankMenu)
     469    mainSizer = wx.BoxSizer(wx.VERTICAL)
     470    mainSizer.Add((5,5),0)
     471    mainSizer.Add(wx.StaticText(self.dataDisplay,label=' Refinement Controls:'),0,wx.ALIGN_CENTER_VERTICAL)
     472    LSSizer = wx.FlexGridSizer(cols=4,vgap=5,hgap=5)
     473    LSSizer.Add(wx.StaticText(self.dataDisplay,label=' Max cycles: '),0,wx.ALIGN_CENTER_VERTICAL)
     474    Ncyc = wx.TextCtrl(self.dataDisplay,-1,value='%d'%(data['Ncycles']),style=wx.TE_PROCESS_ENTER)
     475    Ncyc.Bind(wx.EVT_TEXT_ENTER,OnNumCycles)
     476    Ncyc.Bind(wx.EVT_KILL_FOCUS,OnNumCycles)
     477    LSSizer.Add(Ncyc,0,wx.ALIGN_CENTER_VERTICAL)
     478    LSSizer.Add(wx.StaticText(self.dataDisplay,label=' Min sum(shift/esd)^2: '),0,wx.ALIGN_CENTER_VERTICAL)
     479    Cnvrg = wx.TextCtrl(self.dataDisplay,-1,value='%.2f'%(data['minSumShftESD']),style=wx.TE_PROCESS_ENTER)
     480    Cnvrg.Bind(wx.EVT_TEXT_ENTER,OnConvergence)
     481    Cnvrg.Bind(wx.EVT_KILL_FOCUS,OnConvergence)
     482    LSSizer.Add(Cnvrg,0,wx.ALIGN_CENTER_VERTICAL)
     483    LSSizer.Add(wx.StaticText(self.dataDisplay,label=' Max atom shift: '),0,wx.ALIGN_CENTER_VERTICAL)
     484    AtShft = wx.TextCtrl(self.dataDisplay,-1,value='%.1f'%(data['maxShift']),style=wx.TE_PROCESS_ENTER)
     485    AtShft.Bind(wx.EVT_TEXT_ENTER,OnAtomShift)
     486    AtShft.Bind(wx.EVT_KILL_FOCUS,OnAtomShift)
     487    LSSizer.Add(AtShft,0,wx.ALIGN_CENTER_VERTICAL)
     488    LSSizer.Add(wx.StaticText(self.dataDisplay,label=' Marquardt factor: '),0,wx.ALIGN_CENTER_VERTICAL)
     489    Marq = wx.TextCtrl(self.dataDisplay,-1,value='%.2f'%(data['Marquardt']),style=wx.TE_PROCESS_ENTER)
     490    Marq.Bind(wx.EVT_TEXT_ENTER,OnMarquardt)
     491    Marq.Bind(wx.EVT_KILL_FOCUS,OnMarquardt)
     492    LSSizer.Add(Marq,0,wx.ALIGN_CENTER_VERTICAL)
     493    LSSizer.Add(wx.StaticText(self.dataDisplay,label=' Matrix band width: '),0,wx.ALIGN_CENTER_VERTICAL)
     494    Band = wx.TextCtrl(self.dataDisplay,-1,value='%d'%(data['bandWidth']),style=wx.TE_PROCESS_ENTER)
     495    Band.Bind(wx.EVT_TEXT_ENTER,OnBandWidth)
     496    Band.Bind(wx.EVT_KILL_FOCUS,OnBandWidth)
     497    LSSizer.Add(Band,0,wx.ALIGN_CENTER_VERTICAL)
     498    Restraint = wx.CheckBox(self.dataDisplay,-1,label='Modify restraint weights?')
     499    Restraint.Bind(wx.EVT_CHECKBOX, OnRestraint)
     500    Restraint.SetValue(data['restraintWeight'])
     501    LSSizer.Add(Restraint,0,wx.ALIGN_CENTER_VERTICAL)
     502   
     503   
     504    mainSizer.Add(LSSizer)
     505    mainSizer.Add((5,5),0)
     506    mainSizer.Add(wx.StaticText(self.dataDisplay,label=' Density Map Controls:'),0,wx.ALIGN_CENTER_VERTICAL)
     507
     508    mainSizer.Add((5,5),0)
     509    mainSizer.Add(wx.StaticText(self.dataDisplay,label=' Distance/angle Controls:'),0,wx.ALIGN_CENTER_VERTICAL)
     510       
     511    mainSizer.Layout()   
     512    self.dataDisplay.SetSizer(mainSizer)
     513    self.dataDisplay.SetSize(mainSizer.Fit(self.dataFrame))
     514    self.dataFrame.setSizePosLeft(mainSizer.Fit(self.dataFrame))
    410515     
    411516def UpdateComments(self,data):                   
    412     if data:
    413         self.dataFrame.SetLabel('Comments')
    414         self.dataDisplay = wx.TextCtrl(parent=self.dataFrame,size=self.dataFrame.GetClientSize(),
    415             style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER | wx.TE_DONTWRAP)
    416         for line in data:
    417             self.dataDisplay.AppendText(line+"\n")
     517    self.dataFrame.SetLabel('Comments')
     518    self.dataDisplay = wx.TextCtrl(parent=self.dataFrame,size=self.dataFrame.GetClientSize(),
     519        style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER | wx.TE_DONTWRAP)
     520    for line in data:
     521        self.dataDisplay.AppendText(line+"\n")
    418522             
    419523def UpdateHKLControls(self,data):
     
    554658            self.ExportPattern.Enable(False)
    555659            data = self.PatternTree.GetItemPyData(item)
     660            if data == [0] or data == {}:           #fill in defaults
     661                data = {
     662                    #least squares controls
     663                    'Ncycles':3,'maxShift':2.0,'bandWidth':0,'Marquardt':1.0,'restraintWeight':False,
     664                    'minSumShftESD':0.01,
     665                    #Fourier controls
     666                    'mapType':'Fobs','d-max':100.,'d-min':0.2,'histograms':[],
     667                    'stepSize':[0.5,0.5,0.5],'minX':[0.,0.,0.],'maxX':[1.0,1.0,1.0],
     668                    #distance/angle controls
     669                    'distMax':0.0,'angleMax':0.0,'useMapPeaks':False}
     670                self.PatternTree.SetItemPyData(item,data)                             
     671            self.Refine.Enable(True)
    556672            UpdateControls(self,data)
    557673        elif 'IMG' in self.PatternTree.GetItemText(item):
  • TabularUnified trunk/GSASIIimage.py

    r140 r167  
    166166            Y /= scaley
    167167            ring.append([X,Y,dsp])
    168     if len(ring) < 45:             #want more than 1/4 of a circle
     168    if len(ring) < 20:             #want more than 1/4 of a circle
    169169        return []
    170170    return ring
     
    299299    scalex = 1000./pixelSize[0]
    300300    scaley = 1000./pixelSize[1]
     301    pixLimit = data['pixLimit']
    301302    cutoff = data['cutoff']
    302303    if len(ring) < 5:
     
    314315       
    315316    #setup 180 points on that ring for "good" fit
    316     Ring = makeRing(1.0,ellipse,20,cutoff,scalex,scaley,self.ImageZ)
     317    Ring = makeRing(1.0,ellipse,pixLimit,cutoff,scalex,scaley,self.ImageZ)
    317318    if Ring:
    318319        ellipse = FitRing(Ring)
    319         Ring = makeRing(1.0,ellipse,20,cutoff,scalex,scaley,self.ImageZ)    #do again
     320        Ring = makeRing(1.0,ellipse,pixLimit,cutoff,scalex,scaley,self.ImageZ)    #do again
    320321        ellipse = FitRing(Ring)
    321322    else:
     
    338339    wave = data['wavelength']
    339340    cent = data['center']
    340     pixLimit = data['pixLimit']
    341341    elcent,phi,radii = ellipse
    342342    HKL = G2lat.GenHBravais(limits[0],Bravais,A)[skip:]
  • TabularUnified trunk/GSASIIphsGUI.py

    r166 r167  
    632632                    SetupGeneral()
    633633                elif Atoms.GetColLabelValue(c) == 'I/A':            #note use of text color to make it vanish!
    634                     atomData[r][c] = Atoms.GetCellValue(r,c)
    635634                    if atomData[r][c] == 'I':
    636635                        Uij = atomData[r][c+2:c+8]
     
    638637                        Atoms.SetCellStyle(r,c+1,WHITE,False)
    639638                        Atoms.SetCellTextColour(r,c+1,BLACK)
    640                         Atoms.SetCellRenderer(r,c+1,wg.GridCellFloatRenderer(10,4))
    641639                        for i in range(6):
    642640                            ci = i+colLabels.index('U11')
     
    648646                        CSI = G2spc.GetCSuinel(atomData[r][colLabels.index('site sym')])
    649647                        atomData[r][c+1] =  0.0
    650                         Atoms.SetCellRenderer(r,c+1,wg.GridCellFloatRenderer(10,4))
    651648                        Atoms.SetCellStyle(r,c+1,VERY_LIGHT_GREY,True)
    652649                        Atoms.SetCellTextColour(r,c+1,VERY_LIGHT_GREY)
     
    656653                            Atoms.SetCellStyle(r,ci,VERY_LIGHT_GREY,True)
    657654                            Atoms.SetCellTextColour(r,ci,BLACK)
    658                             Atoms.SetCellRenderer(r,ci,wg.GridCellFloatRenderer(10,4))
    659655                            if CSI[2][i]:
    660656                                Atoms.SetCellStyle(r,ci,WHITE,False)
     
    668664                if 'Atoms' in data['Drawing']:
    669665                    DrawAtomsReplaceByID(data['Drawing'],atomData[r],ID)
     666                    FindBonds()
    670667                   
    671668        def AtomTypeSelect(event):
     
    743740        colU11 = colLabels.index('U11')
    744741        colUiso = colLabels.index('Uiso')
    745         attr = wg.GridCellAttr()                                #to set Uij defaults
    746         attr.SetBackgroundColour(VERY_LIGHT_GREY)
    747         attr.SetReadOnly(True)
    748         for i in range(colU11,colU11+6):
    749             Atoms.SetColAttr(i,attr)
    750742        for i in range(colU11-1,colU11+6):
    751743            Atoms.SetColSize(i,50)           
     
    755747            Atoms.SetReadOnly(row,colSS+1,True)                       #Mult
    756748            if Atoms.GetCellValue(row,colIA) == 'A':
    757                 Atoms.SetCellRenderer(row,colUiso,wg.GridCellStringRenderer())
    758                 Atoms.SetCellValue(row,colUiso,'')
    759749                CSI = G2spc.GetCSuinel(atomData[row][colLabels.index('site sym')])
    760750                Atoms.SetCellStyle(row,colUiso,VERY_LIGHT_GREY,True)
     751                Atoms.SetCellTextColour(row,colUiso,VERY_LIGHT_GREY)
    761752                for i in range(6):
    762753                    ci = colU11+i
     754                    Atoms.SetCellTextColour(row,ci,BLACK)
     755                    Atoms.SetCellStyle(row,ci,VERY_LIGHT_GREY,True)
    763756                    if CSI[2][i]:
    764757                        Atoms.SetCellStyle(row,ci,WHITE,False)
    765758            else:
     759                Atoms.SetCellStyle(row,colUiso,WHITE,False)
     760                Atoms.SetCellTextColour(row,colUiso,BLACK)
    766761                for i in range(6):
    767                     Atoms.SetCellRenderer(row,colU11+i,wg.GridCellStringRenderer())
    768                     Atoms.SetCellValue(row,colU11+i,'')
     762                    ci = colU11+i
     763                    Atoms.SetCellStyle(row,ci,VERY_LIGHT_GREY,True)
     764                    Atoms.SetCellTextColour(row,ci,VERY_LIGHT_GREY)
    769765
    770766    def OnAtomAdd(event):
     
    797793            atomData.append(['UNK','H','',x,y,z,1,Sytsym,Mult,0,'I',0.01,0,0,0,0,0,0,0,0,0,atId])
    798794        SetupGeneral()
    799         if 'Drawing' in data:           
     795        if 'Atoms' in data['Drawing']:           
    800796            DrawAtomAdd(data['Drawing'],atomData[-1])
    801797            G2plt.PlotStructure(self,data)
     
    18871883            except ValueError:
    18881884                pass
    1889             Obj.SetValue("%.1f"%(UseList[hist]['Mustrain'][1][pid]))          #reset in case of error
     1885            Obj.SetValue("%.3f"%(UseList[hist]['Mustrain'][1][pid]))          #reset in case of error
    18901886           
    18911887        def OnStrainAxis(event):
     
    19371933            except ValueError:
    19381934                pass
    1939             Obj.SetValue("%.4f"%(UseList[Indx[Obj.GetId()]]['Extinction'][0]))          #reset in case of error
     1935            Obj.SetValue("%.2f"%(UseList[Indx[Obj.GetId()]]['Extinction'][0]))          #reset in case of error
    19401936           
    19411937        def checkAxis(axis):
     
    20512047                    strainSizer.Add(strainRef,0,wx.ALIGN_CENTER_VERTICAL)
    20522048                    strainVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,
    2053                         '%.4f'%(UseList[item]['Mustrain'][1][0]),style=wx.TE_PROCESS_ENTER)
     2049                        '%.3f'%(UseList[item]['Mustrain'][1][0]),style=wx.TE_PROCESS_ENTER)
    20542050                    Indx[strainVal.GetId()] = [item,0]
    20552051                    strainVal.Bind(wx.EVT_TEXT_ENTER,OnStrainVal)
     
    20782074                        strainRef.Bind(wx.EVT_CHECKBOX, OnStrainRef)
    20792075                        strainSizer.Add(strainRef,0,wx.ALIGN_CENTER_VERTICAL)
    2080                         strainVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,'%.4f'%(val),style=wx.TE_PROCESS_ENTER)
     2076                        strainVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,'%.3f'%(val),style=wx.TE_PROCESS_ENTER)
    20812077                        Indx[strainVal.GetId()] = [item,id]
    20822078                        strainVal.Bind(wx.EVT_TEXT_ENTER,OnStrainVal)
     
    21032099                        strainRef.Bind(wx.EVT_CHECKBOX, OnStrainRef)
    21042100                        strainSizer.Add(strainRef,0,wx.ALIGN_CENTER_VERTICAL)
    2105                         strainVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,'%.4f'%(val),style=wx.TE_PROCESS_ENTER)
     2101                        strainVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,'%.3f'%(val),style=wx.TE_PROCESS_ENTER)
    21062102                        Indx[strainVal.GetId()] = [item,id]
    21072103                        strainVal.Bind(wx.EVT_TEXT_ENTER,OnStrainVal)
     
    21412137                extSizer.Add(extRef,0,wx.ALIGN_CENTER_VERTICAL)
    21422138                extVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,
    2143                     '%.4f'%(UseList[item]['Extinction'][0]),style=wx.TE_PROCESS_ENTER)
     2139                    '%.2f'%(UseList[item]['Extinction'][0]),style=wx.TE_PROCESS_ENTER)
    21442140                Indx[extVal.GetId()] = item
    21452141                extVal.Bind(wx.EVT_TEXT_ENTER,OnExtVal)
  • TabularUnified trunk/GSASIIplot.py

    r166 r167  
    746746        scalex = 1000./pixelSize[0]
    747747        scaley = 1000./pixelSize[1]
     748        pixLimit = Data['pixLimit']
    748749        if self.itemPicked is None and PickName == 'Image Controls':
    749750            size = len(self.ImageZ)
     
    756757                    Xpix = Xpos*scalex
    757758                    Ypix = Ypos*scaley
    758                     xpos,ypos,I,J = G2img.ImageLocalMax(self.ImageZ,20,Xpix,Ypix)
     759                    xpos,ypos,I,J = G2img.ImageLocalMax(self.ImageZ,pixLimit,Xpix,Ypix)
    759760                    if I and J:
    760761                        xpos += .5                              #shift to pixel center
     
    12401241            if event.RightIsDown():
    12411242                SetTestPos(newxy)
     1243            if event.LeftIsDown():
     1244                SetNewPos(newxy)
    12421245        if event.Dragging():
    12431246            if event.LeftIsDown():
     
    12971300        drawingData['testPos'] =  Tx,Ty,Tz
    12981301                             
     1302    def SetNewPos(newxy):
     1303       
     1304        Tx,Ty,Tz = drawingData['testPos']
     1305        anglex,angley,anglez,oldxy = drawingData['Rotation']
     1306        Rx = G2lat.rotdMat(anglex,0)
     1307        Ry = G2lat.rotdMat(angley,1)
     1308        Rz = G2lat.rotdMat(anglez,2)
     1309        dxy = list(newxy-oldxy)+[0,]
     1310        dxy = np.inner(Rz,np.inner(Ry,np.inner(Rx,dxy)))
     1311        Tx += dxy[0]*0.001
     1312        Ty -= dxy[1]*0.001
     1313        Tz += dxy[2]*0.001
     1314#        drawingData['Rotation'][3] = newxy
     1315#        drawingData['testPos'] =  Tx,Ty,Tz
     1316
    12991317    def SetRotation(newxy):       
    13001318        anglex,angley,anglez,oldxy = drawingData['Rotation']
  • TabularUnified trunk/GSASIIspc.py

    r166 r167  
    137137    NPol = (NP[0]+NP[1]+NP[2]+NPZ[0]*NPZ[1])*(1-int(SGData['SGInv']))
    138138    SGText = []
    139     SGText.append('Space Group '+SGData['SpGrp'])
     139    SGText.append(' Space Group: '+SGData['SpGrp'])
    140140    CentStr = 'centrosymmetric'
    141141    if not SGData['SGInv']:
    142142        CentStr = 'non'+CentStr
    143143    if SGData['SGLatt'] in 'ABCIFR':
    144         SGText.append('The lattice is '+CentStr+' '+SGData['SGLatt']+'-centered '+SGData['SGSys'].lower())
     144        SGText.append(' The lattice is '+CentStr+' '+SGData['SGLatt']+'-centered '+SGData['SGSys'].lower())
    145145    else:
    146         SGText.append('The lattice is '+CentStr+' '+'primitive '+SGData['SGSys'].lower())       
    147     SGText.append('Multiplicity of a general site is '+str(Mult))
    148     SGText.append('The Laue symmetry is '+SGData['SGLaue'])
     146        SGText.append(' The lattice is '+CentStr+' '+'primitive '+SGData['SGSys'].lower())       
     147    SGText.append(' Multiplicity of a general site is '+str(Mult))
     148    SGText.append(' The Laue symmetry is '+SGData['SGLaue'])
    149149    if SGData['SGUniq'] in ['a','b','c']:
    150         SGText.append('The unique monoclinic axis is '+SGData['SGUniq'])
     150        SGText.append(' The unique monoclinic axis is '+SGData['SGUniq'])
    151151    if SGData['SGInv']:
    152         SGText.append('The inversion center is located at 0,0,0')
     152        SGText.append(' The inversion center is located at 0,0,0')
    153153    if NPol:
    154         SGText.append('The location of the origin is arbitrary in '+POL[NPol])
    155     SGText.append('\n'+'The equivalent positions are:')
     154        SGText.append(' The location of the origin is arbitrary in '+POL[NPol])
     155    SGText.append('\n'+' The equivalent positions are:')
    156156    if SGData['SGLatt'] != 'P':
    157         SGText.append('\n('+Latt2text(SGData['SGLatt'])+')+')
     157        SGText.append('\n ('+Latt2text(SGData['SGLatt'])+')+')
    158158    if SGData['SGLaue'] in ['-1','2/m','mmm','4/m','4/mmm']:
    159159        Ncol = 2
    160160    else:
    161161        Ncol = 3
    162     line = ''
     162    line = ' '
    163163    for iop,[M,T] in enumerate(SGData['SGOps']):
    164164        if iop % Ncol == 0:
    165165            SGText.append(line)       
    166             line = ''
     166            line = ' '
    167167        Fld = '(%2i) ' % (iop+1)+MT2text(M,T)+'\t'
    168168        line += Fld
  • TabularUnified trunk/ImageCalibrants.py

    r138 r167  
    1313'Ni   @ 298K':(0,(3.52475,3.52475,3.52475,90,90,90),0,(0.5,20,10)),
    1414'NaCl @ 298K':(0,(5.6402,5.6402,5.6402,90,90,90),0,(0.5,20,10)),
     15'CeO2  SRM674b skip 8':(0,(5.411651,5.411651,5.411651,90,90,90),8,(0.5,2,1)),
    1516    }
Note: See TracChangeset for help on using the changeset viewer.