Changeset 623


Ignore:
Timestamp:
May 18, 2012 12:51:55 PM (9 years ago)
Author:
vondreele
Message:

remove powder read from Data menu
remove 'menu' from import menus
use longFormatName as help for import menu items
remove _init_coll_Import_Items
added updateHKLFdata to process HKLF data sets

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r622 r623  
    111111] = [wx.NewId() for _init_coll_Data_Items in range(10)]
    112112
    113 [wxID_IMPORT, wxID_IMPORTPATTERN, wxID_IMPORTHKL
    114 #, wxID_IMPORTPHASE,
    115 #wxID_IMPORTCIF, wxID_IMPORTPDB, 
    116 ] = [wx.NewId() for _init_coll_Import_Items in range(3)]
    117 
    118113[wxID_EXPORT, wxID_EXPORTPATTERN, wxID_EXPORTHKL, wxID_EXPORTPHASE,
    119114wxID_EXPORTCIF, wxID_EXPORTPEAKLIST, wxID_EXPORTPDF,
     
    150145       
    151146    def _init_coll_Data_Items(self,parent):
    152         parent.Append(help='', id=wxID_PWDRREAD, kind=wx.ITEM_NORMAL,
    153             text='Read powder data...')
     147#        parent.Append(help='', id=wxID_PWDRREAD, kind=wx.ITEM_NORMAL,
     148#            text='Read powder data...')
    154149        parent.Append(help='',id=wxID_IMGREAD, kind=wx.ITEM_NORMAL,
    155150            text='Read image data...')
     
    392387                                   'Phase')
    393388        submenu = wx.Menu()
    394         item = parent.AppendMenu(wx.ID_ANY, 'Import Phase menu',
     389        item = parent.AppendMenu(wx.ID_ANY, 'Import Phase',
    395390            submenu, help='Import phase data')
    396391        for reader in self.ImportPhaseReaderlist:
    397             item = submenu.Append(wx.ID_ANY,
    398                 help='Import specific format phase data',
     392            item = submenu.Append(wx.ID_ANY,help=reader.longFormatName,
    399393                kind=wx.ITEM_NORMAL,text='from '+reader.formatName+' file')
    400394            self.ImportMenuId[item.GetId()] = reader
     
    447441                                   'Struct_Factor')
    448442        submenu = wx.Menu()
    449         item = parent.AppendMenu(wx.ID_ANY, 'Import Structure Factor menu',
     443        item = parent.AppendMenu(wx.ID_ANY, 'Import Structure Factor',
    450444            submenu, help='Import Structure Factor data')
    451445        for reader in self.ImportSfactReaderlist:
    452             item = submenu.Append(wx.ID_ANY,
    453                 help='Import specific format Structure Factor data',
     446            item = submenu.Append(wx.ID_ANY,help=reader.longFormatName,               
    454447                kind=wx.ITEM_NORMAL,text='from '+reader.formatName+' file')
    455448            self.ImportMenuId[item.GetId()] = reader
     
    498491        '''
    499492        self.ImportPowderReaderlist = []
    500         self._init_Import_routines(parent,'pwd',
    501                                    self.ImportPowderReaderlist,
    502                                    'Powder_Data')
     493        self._init_Import_routines(parent,'pwd',self.ImportPowderReaderlist,
     494            'Powder_Data')
    503495        submenu = wx.Menu()
    504         item = parent.AppendMenu(wx.ID_ANY, 'Import Powder Data menu',
     496        item = parent.AppendMenu(wx.ID_ANY, 'Import Powder Data',
    505497            submenu, help='Import Powder data')
    506498        for reader in self.ImportPowderReaderlist:
    507             item = submenu.Append(wx.ID_ANY,
    508                                   help='Import specific format powder data',
    509                                   kind=wx.ITEM_NORMAL,
    510                                   text='from '+reader.formatName+' file')
     499            item = submenu.Append(wx.ID_ANY,help=reader.longFormatName,
     500                kind=wx.ITEM_NORMAL,text='from '+reader.formatName+' file')
    511501            self.ImportMenuId[item.GetId()] = reader
    512502            self.Bind(wx.EVT_MENU, self.OnImportPowder, id=item.GetId())
    513503        item = submenu.Append(wx.ID_ANY,
    514                               help='Import powder data, use file to try to determine format',
    515                               kind=wx.ITEM_NORMAL,
    516                               text='guess format from file')
     504            help='Import powder data, use file to try to determine format',
     505            kind=wx.ITEM_NORMAL,text='guess format from file')
    517506        self.Bind(wx.EVT_MENU, self.OnImportPowder, id=item.GetId())
    518507           
     
    756745        return # success
    757746
    758     def _init_coll_Import_Items(self,parent):
    759         self.ImportPattern = parent.Append(help='',id=wxID_IMPORTPATTERN, kind=wx.ITEM_NORMAL,
    760             text='Import Powder Pattern...')
    761         self.ImportHKL = parent.Append(help='',id=wxID_IMPORTHKL, kind=wx.ITEM_NORMAL,
    762             text='Import HKLs...')
    763         self.Bind(wx.EVT_MENU, self.OnImportPattern, id=wxID_IMPORTPATTERN)
    764         self.Bind(wx.EVT_MENU, self.OnImportHKL, id=wxID_IMPORTHKL)
    765 
    766747    def _init_coll_Export_Items(self,parent):
    767748        self.ExportPattern = parent.Append(help='Select PWDR item to enable',id=wxID_EXPORTPATTERN, kind=wx.ITEM_NORMAL,
     
    806787        self._init_Import_powder(self.Import)
    807788        self._init_Import_Sfact(self.Import)
    808         self._init_coll_Import_Items(self.Import)
    809789        self._init_coll_Export_Items(self.Export)
    810790       
  • trunk/GSASIIphsGUI.py

    r620 r623  
    770770                try:
    771771                    res = float(kFactor.GetValue())
    772                     if 0.2 <= res <= 1.2:
     772                    if 0.1 <= res <= 1.2:
    773773                        Flip['k-factor'] = res
    774774                except ValueError:
     
    795795            flipRes.Bind(wx.EVT_KILL_FOCUS,OnResVal)
    796796            line2Sizer.Add(flipRes,0,wx.ALIGN_CENTER_VERTICAL)
    797             line2Sizer.Add(wx.StaticText(dataDisplay,label=' k-Factor (0.2-1.2): '),0,wx.ALIGN_CENTER_VERTICAL)
     797            line2Sizer.Add(wx.StaticText(dataDisplay,label=' k-Factor (0.1-1.2): '),0,wx.ALIGN_CENTER_VERTICAL)
    798798            kFactor =  wx.TextCtrl(dataDisplay,value='%.3f'%(Flip['k-factor']),style=wx.TE_PROCESS_ENTER)
    799799            kFactor.Bind(wx.EVT_TEXT_ENTER,OnkFactor)       
     
    33943394                            'Extinction':['Lorentzian','Secondary Type I',{'Eg':[0.0,False]},]}                       
    33953395                    data['Histograms'] = UseList
     3396                    wx.BeginBusyCursor()
     3397                    UpdateHKLFdata(histoName)
     3398                    wx.EndBusyCursor()
    33963399                    wx.CallAfter(UpdateDData)
    33973400            finally:
    33983401                dlg.Destroy()
     3402               
     3403    def UpdateHKLFdata(histoName):
     3404        generalData = data['General']
     3405        Id = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,histoName)
     3406        reflData = G2frame.PatternTree.GetItemPyData(Id)
     3407        SGData = generalData['SGData']
     3408        Cell = generalData['Cell'][1:7]
     3409        G,g = G2lat.cell2Gmat(Cell)
     3410        for ref in reflData:
     3411            H = ref[:3]
     3412            ref[4] = np.sqrt(1./G2lat.calc_rDsq2(H,G))
     3413            iabsnt,mulp,Uniq,phi = G2spc.GenHKLf(H,SGData,Friedel=False)
     3414            ref[3] = mulp/2             #convert from powder mulp.
     3415            ref[11] = Uniq
     3416            ref[12] = phi
     3417        G2frame.PatternTree.SetItemPyData(Id,reflData)
    33993418       
    34003419    def OnPwdrAdd(event):
  • trunk/GSASIIplot.py

    r620 r623  
    260260    HKL = []
    261261    HKLF = []
    262     for refl in HKLref:   
     262    for refl in HKLref:
    263263        H = np.array(refl[:3])
    264264        sig,Fosq,Fcsq = refl[7:10]
  • trunk/imports/G2sfact.py

    r621 r623  
    2020            strictExtension=False,
    2121            formatName = 'HKL',
    22             longFormatName = 'Simple (hkl Fo sig(Fo)) Structure factor file'
     22            longFormatName = 'Simple (hkl Fo sig(Fo)) Structure factor text file'
    2323            )
    2424    # Validate the contents
     
    4343                if S[0] == '#': continue       #ignore comments, if any
    4444                h,k,l,Fo,sigFo = S.split()
    45                 HKL = np.array([int(h),int(k),int(l)])
     45                h,k,l = [int(h),int(k),int(l)]
    4646                Fo = float(Fo)
    4747                sigFo = float(sigFo)
  • trunk/imports/G2sfact_CIF.py

    r621 r623  
    2323            strictExtension=False,
    2424            formatName = 'CIF',
    25             longFormatName = 'Reflections from CIF'
     25            longFormatName = 'CIF format structure factor file (.cif or .hkl)'
    2626            )
    2727    # Validate the contents
Note: See TracChangeset for help on using the changeset viewer.