- Timestamp:
- Mar 18, 2022 8:23:49 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIIconstrGUI.py ¶
r5216 r5239 1691 1691 1692 1692 ###### check scale & phase fractions, create constraint if needed ############# 1693 def CheckAllScalePhaseFractions(G2frame ):1693 def CheckAllScalePhaseFractions(G2frame,refine=True): 1694 1694 '''Check if scale factor and all phase fractions are refined without a constraint 1695 1695 for all used histograms, if so, offer the user a chance to create a constraint 1696 1696 on the sum of phase fractions 1697 1698 :returns: False if refinement should be continued 1697 1699 ''' 1698 1700 histograms, phases = G2frame.GetUsedHistogramsAndPhasesfromTree() … … 1709 1711 if i: msg += ', ' 1710 1712 msg += str(h) 1711 msg += '. This is not recommended as it will produce an unstable refinement. Do you want to create constrain(s) on the sum of phase fractions to address this? (Press "No" to continue without)' 1712 dlg = wx.MessageDialog(G2frame,msg,'Warning: Constraint Needed',wx.YES|wx.NO) 1713 msg += '. This is not recommended as it will produce an unstable refinement. Do you want to create constrain(s) on the sum of phase fractions to address this?' 1714 if refine: 1715 msg += '\n\nRefinement may cause a significant shift in scaling, so it may be best to refine only a few other parameters (Press "No" to continue refinement without, "Cancel" to stop.)' 1716 opts = wx.YES|wx.NO|wx.CANCEL 1717 else: 1718 opts = wx.YES|wx.NO 1719 dlg = wx.MessageDialog(G2frame,msg,'Warning: Constraint Needed',opts) 1713 1720 ans = dlg.ShowModal() 1714 1721 dlg.Destroy() … … 1727 1734 wx.CallAfter(G2frame.GPXtree.SelectItem,cId) # should call SelectDataTreeItem 1728 1735 UpdateConstraints(G2frame,Constraints,1,True) # repaint with HAP tab 1729 return True 1730 return False 1731 1736 return False 1737 elif ans == wx.ID_NO: 1738 return False 1739 return True 1740 1732 1741 def CheckScalePhaseFractions(G2frame,hist,histograms,phases,Constraints): 1733 1742 '''Check if scale factor and all phase fractions are refined without a constraint -
TabularUnified trunk/GSASIIdataGUI.py ¶
r5236 r5239 5289 5289 for a sequential fit. 5290 5290 ''' 5291 if G2cnstG.CheckAllScalePhaseFractions(self ): return5291 if G2cnstG.CheckAllScalePhaseFractions(self,refine=False): return 5292 5292 try: 5293 5293 parmDict,varyList = self.MakeLSParmDict() -
TabularUnified trunk/GSASIIrestrGUI.py ¶
r5143 r5239 190 190 numerical values (only) 191 191 ''' 192 G2cnstG.CheckAllScalePhaseFractions(G2frame )192 G2cnstG.CheckAllScalePhaseFractions(G2frame,refine=False) 193 193 try: 194 194 parmDict,varyList = G2frame.MakeLSParmDict()
Note: See TracChangeset
for help on using the changeset viewer.