Changeset 5003


Ignore:
Timestamp:
Jul 28, 2021 3:04:06 PM (2 years ago)
Author:
toby
Message:

redo LeBail? msg to show up only after screen paint & only show what is changed & now turn off Hist Scale; Save As now in recent menu; scriptable minor docs updates

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r5000 r5003  
    45174517                config = G2G.GetConfigValsDocs()
    45184518                GSASIIpath.addPrevGPX(self.GSASprojectfile,config)
     4519                G2G.SaveConfigVars(config)
    45194520                return True
    45204521            else:
  • trunk/GSASIIddataGUI.py

    r4972 r5003  
    822822            G2frame.bottomSizer.DeleteWindows()
    823823        Indx.clear()
    824         G2frame.bottomSizer = ShowHistogramInfo()
     824        G2frame.bottomSizer,LeBailMsg = ShowHistogramInfo()
    825825        mainSizer.Add(G2frame.bottomSizer)
    826826        mainSizer.Layout()
     
    829829        DData.Scroll(0,Scroll)
    830830        G2frame.dataWindow.SendSizeEvent()
     831        if LeBailMsg:
     832            G2G.G2MessageBox(G2frame,LeBailMsg,
     833                                 title='LeBail refinement changes')
    831834       
    832835    def ShowHistogramInfo():
     
    904907            UseList[G2frame.hist]['Layer Disp'] = [0.0,False]
    905908#end patch
     909        offMsg = ''
    906910        bottomSizer = wx.BoxSizer(wx.VERTICAL)
    907911        useBox = wx.BoxSizer(wx.HORIZONTAL)
     
    10321036                    bottomSizer.Add(BabSizer(),0,wx.BOTTOM,5)
    10331037            else:   #turn off PWDR intensity related paramters for LeBail refinement
    1034                 UseList[G2frame.hist]['Scale'][1] = False
    1035                 UseList[G2frame.hist]['Pref.Ori.'][2] = False
    1036                 UseList[G2frame.hist]['Extinction'][1] = False
     1038                if UseList[G2frame.hist]['Scale'][1]:
     1039                    offMsg = "Phase fraction"
     1040                    UseList[G2frame.hist]['Scale'][1] = False
     1041                if UseList[G2frame.hist]['Pref.Ori.'][2]:
     1042                    UseList[G2frame.hist]['Pref.Ori.'][2] = False
     1043                    if offMsg: offMsg += ', '
     1044                    offMsg += 'Preferred orientation'
     1045                if UseList[G2frame.hist]['Extinction'][1]:
     1046                    UseList[G2frame.hist]['Extinction'][1] = False
     1047                    if offMsg: offMsg += ', '
     1048                    offMsg += 'Extinction'
     1049                flag = False
    10371050                for item in UseList[G2frame.hist]['Babinet']:
    1038                     UseList[G2frame.hist]['Babinet'][item][1] = False
    1039                 G2G.G2MessageBox(G2frame,'Refinement flags for Phase fraction, Preferred orientation, Extinction & Babinet are now off',
    1040                     title='LeBail refinement flag notice')
     1051                    if UseList[G2frame.hist]['Babinet'][item][1]:
     1052                        UseList[G2frame.hist]['Babinet'][item][1] = False
     1053                        flag = True
     1054                if flag:
     1055                    if offMsg: offMsg += ', '
     1056                    offMsg += 'Babinet'
     1057                # make sure that the at least one phase uses the histogram...
     1058                allLeBail = True
     1059                hists,phases = G2frame.GetUsedHistogramsAndPhasesfromTree()
     1060                for key in phases:
     1061                    d = phases[key]
     1062                    if G2frame.hist not in d['Histograms']: continue
     1063                    if not d['Histograms'][G2frame.hist]['Use']: continue
     1064                    if not d['Histograms'][G2frame.hist]['LeBail']:
     1065                        #print('Phase',key,'is used as non-LeBail')
     1066                        allLeBail = False
     1067                        break
     1068                # ...or turn off scale
     1069                if allLeBail:
     1070                    if hists[G2frame.hist]['Sample Parameters']['Scale'][1]:
     1071                        hists[G2frame.hist]['Sample Parameters']['Scale'][1] = False
     1072                        if offMsg: offMsg += ', '
     1073                        offMsg += 'Histogram scale factor'
     1074                if offMsg:
     1075                    offMsg = "Refinement flags turned for: " + offMsg
    10411076        elif G2frame.hist[:4] == 'HKLF':
    10421077            bottomSizer.Add(ExtSizer('HKLF'),0,wx.BOTTOM,5)
     
    10451080                bottomSizer.Add(FlackSizer(),0,wx.BOTTOM,5)
    10461081            bottomSizer.Add(twinSizer(),0,wx.BOTTOM,5)
    1047         return bottomSizer
     1082        return bottomSizer,offMsg
    10481083
    10491084    ######################################################################
     
    10531088    keyList = G2frame.GetHistogramNames(['PWDR','HKLF'])
    10541089    UseList = data['Histograms']
    1055     # look for histgrams that are no longer in the project (should not happen!)
     1090    # look for histgrams that are no longer in the project (can happen when histogram deleted from tree)
    10561091    broken = [i for i in UseList if i not in keyList]
    10571092    if broken:
     
    10611096            msg += j
    10621097            del data['Histograms'][j]
    1063         G2G.G2MessageBox(G2frame,msg,'Removing bad histograms')
     1098        G2G.G2MessageBox(G2frame,msg,'Dereferencing Removed histograms')
    10641099    if UseList:
    10651100        G2frame.dataWindow.DataMenu.Enable(G2G.wxID_DATADELETE,True)
     
    10971132    topSizer.Add(G2G.HelpButton(DData,helpIndex=G2frame.dataWindow.helpKey))
    10981133    mainSizer.Add(topSizer,0,wx.EXPAND)
     1134    LeBailMsg = None
    10991135    if G2frame.hist:
    11001136        topSizer = wx.FlexGridSizer(1,2,5,5)
     
    11081144            topSizer.Add(PlotSizer())
    11091145        mainSizer.Add(topSizer)       
    1110         G2frame.bottomSizer = ShowHistogramInfo()
     1146        G2frame.bottomSizer,LeBailMsg = ShowHistogramInfo()
    11111147        mainSizer.Add(G2frame.bottomSizer)
    11121148    elif not keyList:
     
    11201156       
    11211157    G2phG.SetPhaseWindow(DData,mainSizer,Scroll=Scroll)
     1158    if LeBailMsg:
     1159        G2G.G2MessageBox(G2frame,LeBailMsg,
     1160                                 title='LeBail refinement changes')
    11221161
    11231162def MakeHistPhaseWin(G2frame):
  • trunk/GSASIIscriptable.py

    r4980 r5003  
    4242class                              Encapsulates
    4343===============================    ===============================================================================================================
    44 :class:`G2Project`                  a GSAS-II project file, provides references to objects below,
     44:class:`G2Project`                  A GSAS-II project file, provides references to objects below,
    4545                                    each corresponding to a tree item
    46                                     (excepting :class:`G2AtomRecord`)
    47 :class:`G2Phase`                    a phase
    48 :class:`G2PwdrData`                 a powder histogram
    49 :class:`G2Image`                    an image
    50 :class:`G2PDF`                      a PDF histogram
    51 :class:`G2SeqRefRes`                the sequential results table
    52 :class:`G2AtomRecord`               an atom within a phase
     46                                    (exception is :class:`G2AtomRecord`)
     47:class:`G2Phase`                    Provides phase information access
     48                                    (also provides access to atom info via :class:`G2AtomRecord`)
     49:class:`G2AtomRecord`               Access to an atom within a phase
     50:class:`G2PwdrData`                 Access to powder histogram info
     51:class:`G2Image`                    Access to image info
     52:class:`G2PDF`                      PDF histogram info
     53:class:`G2SeqRefRes`                The sequential results table
    5354===============================    ===============================================================================================================
    5455
Note: See TracChangeset for help on using the changeset viewer.