Changeset 1006
- Timestamp:
- Jul 22, 2013 8:57:37 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r1000 r1006 362 362 primaryReaders = [] 363 363 secondaryReaders = [] 364 for r eaderin readerlist:365 flag = r eader.ExtensionValidator(filename)364 for r in readerlist: 365 flag = r.ExtensionValidator(filename) 366 366 if flag is None: 367 secondaryReaders.append(r eader)367 secondaryReaders.append(r) 368 368 elif flag: 369 primaryReaders.append(r eader)369 primaryReaders.append(r) 370 370 if len(secondaryReaders) + len(primaryReaders) == 0: 371 371 self.ErrorDialog('No Format','No matching format for file '+filename) … … 437 437 break # success reading 438 438 else: 439 self.ErrorDialog('Read Error','No reader is able to read from file '+filename+msg) 439 if reader: 440 self.ErrorDialog('Read Error','The '+ rd.formatName+ 441 ' reader was not able to read file '+filename+msg) 442 else: 443 self.ErrorDialog('Read Error','No reader is able to read file '+filename+msg) 440 444 except: 441 445 import traceback … … 2247 2251 2248 2252 :param str PWDRname: a powder histogram name as obtained from 2249 :m od:`GSASIIstruct.GetHistogramNames`2253 :meth:`GSASIIstruct.GetHistogramNames` 2250 2254 2251 2255 :returns: PWDRdata = powder data dictionary with … … 2274 2278 :param str HKLFname: a single crystal histogram name as obtained 2275 2279 from 2276 :m od:`GSASIIstruct.GetHistogramNames`2280 :meth:`GSASIIstruct.GetHistogramNames` 2277 2281 2278 2282 :returns: HKLFdata = single crystal data list of reflections … … 2290 2294 def GetPhaseData(self): 2291 2295 '''Returns a list of defined phases. Used only in GSASIIgrid 2292 Note routine :m od:`GSASIIstruct.GetPhaseData` also exists.2296 Note routine :meth:`GSASIIstruct.GetPhaseData` also exists. 2293 2297 ''' 2294 2298 phaseData = {} … … 2344 2348 class ViewParmDialog(wx.Dialog): 2345 2349 '''Window to show all parameters in the refinement. 2346 Called from :m od:`OnViewLSParms`2350 Called from :meth:`OnViewLSParms` 2347 2351 ''' 2348 2352 def __init__(self,parent,title,parmDict): -
trunk/GSASIIIO.py
r981 r1006 1682 1682 '''Defines a base class for the reading of files with tables 1683 1683 of structure factors 1684 1685 Note that the default controls are stored in self.Controls and the 1686 default instrument parameters are stored in self.Parameters. 1687 These can be changed, but any changes will be the defaults for all 1688 subsequent uses of the :class:`ImportStructFactor` derived classes 1689 until :meth:`InitControls` and :meth:`InitParameters` are 1690 called. Probably better to use :meth:`UpdateControls` and 1691 :meth:`UpdateControls` (adding new args if needed) to change 1692 values. 1684 1693 ''' 1685 1694 def __init__(self,formatName,longFormatName=None,extensionlist=[], … … 1689 1698 1690 1699 # define contents of Structure Factor entry 1700 self.InitParameters() 1701 self.InitControls() 1702 self.RefList = [] 1703 1704 def InitControls(self): 1705 'initialize the controls structure' 1691 1706 self.Controls = { # dictionary with plotting controls 1692 1707 'Type' : 'Fosq', … … 1700 1715 'log-lin' : 'lin', 1701 1716 } 1702 self.Parameters = [ # list with data collection parameters 1703 ('SXC',0.70926), 1704 ['SXC',0.70926], 1705 ['Type','Lam'] 1706 ] 1707 self.RefList = [] 1717 1718 def InitParameters(self): 1719 'initialize the instrument parameters structure' 1720 Lambda = 0.70926 1721 HistType = 'SXC' 1722 self.Parameters = [{'Type':[HistType,HistType], # create the structure 1723 'Lam':[Lambda,Lambda] 1724 }, {}] 1708 1725 1709 1726 def UpdateParameters(self,Type=None,Wave=None): 1710 HistType = self.Parameters[0][0] 1711 HistWave = self.Parameters[0][1] 1727 'Revise the ' 1712 1728 if Type is not None: 1713 HistType = Type1729 self.Parameters[0]['Type'] = [Type,Type] 1714 1730 if Wave is not None: 1715 HistWave = Wave 1716 self.Parameters = [{'Type':[HistType,HistType],'Lam':[HistWave,HistWave]},{}] # overwrite entire list 1731 self.Parameters[0]['Lam'] = [HistWave,HistWave] 1717 1732 1718 1733 def UpdateControls(self,Type='Fosq',FcalcPresent=False): -
trunk/GSASIIphsGUI.py
r1001 r1006 73 73 '''Create the data display window contents when a phase is clicked on 74 74 in the man (data tree) window. 75 Called only from :m od:`GSASIIgrid.MovePatternTreeToGrid`,76 which in turn is called from :m od:`GSASII.GSASII.OnPatternTreeSelChanged`75 Called only from :meth:`GSASIIgrid.MovePatternTreeToGrid`, 76 which in turn is called from :meth:`GSASII.GSASII.OnPatternTreeSelChanged` 77 77 when a tree item is selected. 78 78 -
trunk/imports/G2phase_CIF.py
r850 r1006 113 113 choice[-1] += fmt % cif.get_number_with_esd( 114 114 cf[blknm].get(key))[0] 115 sg = cf[blknm].get("_symmetry_space_group_name_H-M") 115 sg = cf[blknm].get("_symmetry_space_group_name_H-M",'') 116 if not sg: sg = cf[blknm].get("_space_group_name_H-M_alt",'') 116 117 if sg: choice[-1] += ', (' + sg.strip() + ')' 117 118 selblk = self.PhaseSelector( … … 127 128 blk = cf[str_blklist[selblk]] 128 129 E = True 129 SpGrp = blk.get("_symmetry_space_group_name_H-M") 130 # try normalizing the space group, see if we can pick the space group out of a table 130 SpGrp = blk.get("_symmetry_space_group_name_H-M",'') 131 if not SpGrp: 132 SpGrp = blk.get("_space_group_name_H-M_alt",'') 133 # try normalizing the space group, to see if we can pick the space group out of a table 131 134 SpGrpNorm = G2spc.StandardizeSpcName(SpGrp) 132 135 if SpGrpNorm: … … 136 139 E,SGData = G2spc.SpcGroup(SpGrp) 137 140 if E: 138 self.warnings += 'ERROR in space group symbol '+SpGrp 139 self.warnings += '\nAre there spaces separating axial fields?\n\nError msg: ' 140 self.warnings += G2spc.SGErrors(E) 141 if not SpGrp: 142 self.warnings += 'No space group name was found in the CIF.' 143 self.warnings += '\nThe space group has been set to "P 1". ' 144 self.warnings += "Change this in phase's General tab." 145 else: 146 self.warnings += 'ERROR in space group symbol '+SpGrp 147 self.warnings += '\nThe space group has been set to "P 1". ' 148 self.warnings += "Change this in phase's General tab." 149 self.warnings += '\nAre there spaces separating axial fields?\n\nError msg: ' 150 self.warnings += G2spc.SGErrors(E) 141 151 SGData = G2IO.SGData # P 1 142 152 self.Phase['General']['SGData'] = SGData
Note: See TracChangeset
for help on using the changeset viewer.