Changeset 5335
- Timestamp:
- Sep 18, 2022 11:02:46 AM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIscriptable.py
r5320 r5335 2360 2360 return self.histogram(histname) 2361 2361 2362 def add_phase(self, phasefile, phasename=None, histograms=[], fmthint=None): 2362 def add_phase(self, phasefile, phasename=None, histograms=[], 2363 fmthint=None, mag=False): 2363 2364 """Loads a phase into the project from a .cif file 2364 2365 … … 2372 2373 importers consistent with the file extension will be tried 2373 2374 (equivalent to "guess format" in menu). 2375 :param bool mag: Set to True to read a magCIF 2374 2376 2375 2377 :returns: A :class:`G2Phase` object representing the … … 2384 2386 phasereader = phasereaders[0] 2385 2387 2386 phasename = phasename or phasereader.Phase['General']['Name'] 2388 if phasereader.MPhase and mag: 2389 phObj = phasereader.MPhase 2390 else: 2391 phObj = phasereader.Phase 2392 2393 phasename = phasename or phObj['General']['Name'] 2387 2394 phaseNameList = [p.name for p in self.phases()] 2388 2395 phasename = G2obj.MakeUniqueLabel(phasename, phaseNameList) 2389 ph asereader.Phase['General']['Name'] = phasename2396 phObj['General']['Name'] = phasename 2390 2397 2391 2398 if 'Phases' not in self.data: 2392 2399 self.data[u'Phases'] = { 'data': None } 2393 2400 assert phasename not in self.data['Phases'], "phase names should be unique" 2394 self.data['Phases'][phasename] = ph asereader.Phase2401 self.data['Phases'][phasename] = phObj 2395 2402 2396 2403 # process constraints, currently generated only from ISODISTORT CIFs
Note: See TracChangeset
for help on using the changeset viewer.