Changeset 630 for trunk/GSASII.py


Ignore:
Timestamp:
May 21, 2012 3:44:17 PM (10 years ago)
Author:
vondreele
Message:

major mods for HKLF data
remove some dead code
mark more code as dead (#)
implement cif data style as 'val(esd)' for f & f_squared
continue implementation of HKLF data in refinement
HKLF now OK in Fourier & charge flip calcs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r623 r630  
    387387                                   'Phase')
    388388        submenu = wx.Menu()
    389         item = parent.AppendMenu(wx.ID_ANY, 'Import Phase',
     389        item = parent.AppendMenu(wx.ID_ANY, 'Phase',
    390390            submenu, help='Import phase data')
    391391        for reader in self.ImportPhaseReaderlist:
     
    441441                                   'Struct_Factor')
    442442        submenu = wx.Menu()
    443         item = parent.AppendMenu(wx.ID_ANY, 'Import Structure Factor',
     443        item = parent.AppendMenu(wx.ID_ANY, 'Structure Factor',
    444444            submenu, help='Import Structure Factor data')
    445445        for reader in self.ImportSfactReaderlist:
     
    449449            self.Bind(wx.EVT_MENU, self.OnImportSfact, id=item.GetId())
    450450        item = submenu.Append(wx.ID_ANY,
    451                               help='Import Structure Factor, use file to try to determine format',
    452                               kind=wx.ITEM_NORMAL,
    453                               text='guess format from file')
     451            help='Import Structure Factor, use file to try to determine format',
     452            kind=wx.ITEM_NORMAL,
     453            text='guess format from file')
    454454        self.Bind(wx.EVT_MENU, self.OnImportSfact, id=item.GetId())
    455455
     
    475475            Id = self.PatternTree.AppendItem(parent=self.root,
    476476                                             text='HKLF '+HistName)
    477             self.PatternTree.SetItemPyData(Id,rd.RefList)
     477            self.PatternTree.SetItemPyData(Id,['HKLF '+HistName,rd.RefList])
    478478            Sub = self.PatternTree.AppendItem(Id,text='Instrument Parameters')
    479479            self.PatternTree.SetItemPyData(Sub,rd.Parameters)
     
    481481                self.PatternTree.AppendItem(Id,text='HKL Plot Controls'),
    482482                rd.Controls)
     483            self.PatternTree.SetItemPyData(
     484                self.PatternTree.AppendItem(Id,text='Reflection List'),[])  #dummy entry for GUI use
    483485            self.PatternTree.SelectItem(Id)
    484486            self.PatternTree.Expand(Id)
     
    494496            'Powder_Data')
    495497        submenu = wx.Menu()
    496         item = parent.AppendMenu(wx.ID_ANY, 'Import Powder Data',
     498        item = parent.AppendMenu(wx.ID_ANY, 'Powder Data',
    497499            submenu, help='Import Powder data')
    498500        for reader in self.ImportPowderReaderlist:
     
    10921094            dlg.Destroy()
    10931095
    1094     # this will be removed eventually
    1095 #    def OnSnglRead(self,event):
    1096 #        self.CheckNotebook()
    1097 #        dlg = wx.FileDialog(self, 'Choose file', '.', '',
    1098 #            'hkl files (*.hkl)|*.hkl|All files (*.*)|*.*',
    1099 #            wx.OPEN|wx.CHANGE_DIR)
    1100 #        try:
    1101 #            if dlg.ShowModal() == wx.ID_OK:
    1102 #                filename = dlg.GetPath()
    1103 #                wx.BeginBusyCursor()
    1104 #                try:
    1105 #                    Data = {}
    1106 #                    names = ['Type','Lam']
    1107 #                    HKLref,HKLmin,HKLmax,FoMax,ifFc = G2IO.GetHKLData(filename)
    1108 #                    Id = self.PatternTree.AppendItem(parent=self.root,text='HKLF '+os.path.basename(filename))
    1109 #                    self.PatternTree.SetItemPyData(Id,HKLref)
    1110 #                    Sub = self.PatternTree.AppendItem(Id,text='Instrument Parameters')
    1111 #                    data = ['SXC',1.5428,]
    1112 #                    self.PatternTree.SetItemPyData(Sub,[tuple(data),data,names])
    1113 #                    Data['Type'] = 'Fosq'
    1114 #                    Data['ifFc'] = ifFc
    1115 #                    Data['HKLmax'] = HKLmax
    1116 #                    Data['HKLmin'] = HKLmin
    1117 #                    Data['FoMax'] = FoMax
    1118 #                    Data['Zone'] = '001'
    1119 #                    Data['Layer'] = 0
    1120 #                    Data['Scale'] = 1.0
    1121 #                    Data['log-lin'] = 'lin'                   
    1122 #                    self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='HKL Plot Controls'),Data)
    1123 #                    self.PatternTree.SelectItem(Id)
    1124 #                    self.PatternTree.Expand(Id)
    1125 #                    self.Sngl = Id
    1126 #                finally:
    1127 #                    wx.EndBusyCursor()   
    1128 #        finally:
    1129 #            dlg.Destroy()
    1130            
    11311096    def CheckNotebook(self):
    11321097        '''Make sure the data tree has the minimally expected controls
     
    19271892        return:
    19281893            HKLFdata = single crystal data list of reflections: for each reflection:
    1929                 HKLF = [np.array([h,k,l]),FoSq,sigFoSq,FcSq,Fcp,Fcpp,phase]
     1894                HKLF =
    19301895        '''
    1931         HKLFdata = []
    1932         while True:
    1933             data = self.PatternTree.GetItemPyData(HKLFname)
    1934             datum = data[0]
    1935             if datum[0] == HKLFname:
    1936                 HKLFdata = datum[1:][0]
     1896        HKLFdata = {}
     1897        HKLFdata['Data'] = self.PatternTree.GetItemPyData(HKLFname)[1]
     1898        HKLFdata['Instrument Parameters'] = self.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(self,HKLFname,'Instrument Parameters'))
    19371899        return HKLFdata
    19381900                   
     
    20011963        parmDict = {}
    20021964        Histograms,Phases = self.GetUsedHistogramsAndPhasesfromTree()
     1965        print Histograms.keys()
    20031966        Natoms,phaseVary,phaseDict,pawleyLookup,FFtable,BLtable = G2str.GetPhaseData(Phases,Print=False)       
    20041967        hapVary,hapDict,controlDict = G2str.GetHistogramPhaseData(Phases,Histograms,Print=False)
Note: See TracChangeset for help on using the changeset viewer.