Changeset 3270


Ignore:
Timestamp:
Feb 10, 2018 12:25:09 PM (4 years ago)
Author:
toby
Message:

revise plot update code; add plotting docs & cleanup; always use last phase tab

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r3250 r3270  
    221221            return wx.TreeCtrl.SetItemPyData(self,id,data)
    222222
    223     def onSelectionChanged(self,event):
    224         '''Log each press on a tree item here.
    225         '''
    226         if not self.G2frame.treePanel:
    227             return
    228         if self.SelectionChanged:
    229             textlist = self._getTreeItemsList(event.GetItem())
    230             if log.LogInfo['Logging'] and event.GetItem() != self.root:
    231                 textlist[0] = self.GetRelativeHistNum(textlist[0])
    232                 if textlist[0] == "Phases" and len(textlist) > 1:
    233                     textlist[1] = self.GetRelativePhaseNum(textlist[1])
    234                 log.MakeTreeLog(textlist)
    235             if textlist == self.textlist:
    236                 return      #same as last time - don't get it again
    237             self.textlist = textlist
    238             self.SelectionChanged(event)
    239 
    240     def Bind(self,eventtype,handler,*args,**kwargs):
    241         '''Override the Bind() function so that page change events can be trapped
    242         '''
    243         if eventtype == wx.EVT_TREE_SEL_CHANGED:
    244             self.SelectionChanged = handler
    245             wx.TreeCtrl.Bind(self,eventtype,self.onSelectionChanged)
    246             return
    247         wx.TreeCtrl.Bind(self,eventtype,handler,*args,**kwargs)
     223    # def onSelectionChanged(self,event):
     224    #     '''Log each press on a tree item here.
     225    #     '''
     226    #     if not self.G2frame.treePanel:
     227    #         return
     228    #     if self.SelectionChanged:
     229    #         textlist = self._getTreeItemsList(event.GetItem())
     230    #         if log.LogInfo['Logging'] and event.GetItem() != self.root:
     231    #             textlist[0] = self.GetRelativeHistNum(textlist[0])
     232    #             if textlist[0] == "Phases" and len(textlist) > 1:
     233    #                 textlist[1] = self.GetRelativePhaseNum(textlist[1])
     234    #             log.MakeTreeLog(textlist)
     235    #         if textlist == self.textlist:
     236    #             return      #same as last time - don't get it again
     237    #         self.textlist = textlist
     238    #         self.SelectionChanged(event)
     239
     240    # def Bind(self,eventtype,handler,*args,**kwargs):
     241    #     '''Override the Bind() function so that page change events can be trapped
     242    #     '''
     243    #     if eventtype == wx.EVT_TREE_SEL_CHANGED:
     244    #         self.SelectionChanged = handler
     245    #         wx.TreeCtrl.Bind(self,eventtype,self.onSelectionChanged)
     246    #         return
     247    #     wx.TreeCtrl.Bind(self,eventtype,handler,*args,**kwargs)
    248248
    249249    # commented out, disables Logging
  • trunk/GSASIIdataGUI.py

    r3263 r3270  
    26582658            self.SetIcon(wx.IconFromBitmap(img))
    26592659        self.Bind(wx.EVT_CLOSE, self.ExitMain)
    2660         # various defaults
     2660        # initialize default values for GSAS-II "global" variables (saved in main Frame)
    26612661        self.oldFocus = None
    26622662        self.GSASprojectfile = ''
     
    27202720        self.dataDisplay = None
    27212721        self.dataDisplayPhaseText = ''
    2722         self.lastTreeSetting = []
     2722        self.lastTreeSetting = [] # used to track the selected Tree item before a refinement
    27232723        self.ExpandingAll = False
    27242724        self.SeqTblHideList = []
     2725        self.lastSelectedPhaseTab = None # track the last tab pressed on a phase window
    27252726               
    27262727        arg = sys.argv
     
    27802781                               
    27812782    def OnDataTreeSelChanged(self, event):
    2782         '''Called when a data tree item is selected'''
     2783        '''Called when a data tree item is selected. May be called on item deletion as well.
     2784        '''
    27832785        if self.TreeItemDelete:
    27842786            self.TreeItemDelete = False
     
    28012803    def OnGPXtreeItemExpanded(self, event):
    28022804        'Called when a tree item is expanded'
    2803         #self.OnDataTreeSelChanged(event)  # removed -- why select & show a tree item when expanding it? BHT
    28042805        event.Skip()
    28052806       
    28062807    def OnGPXtreeItemDelete(self, event):
    2807         'Called when a tree item is deleted -- not sure what this does'
     2808        'Called when a tree item is deleted, inhibit the next tree item selection action'
    28082809        self.TreeItemDelete = True
    28092810
     
    42974298        dlg.Raise()
    42984299        Rw = 100.00
    4299         self.SaveTreeSetting()
    4300         self.GPXtree.SaveExposedItems()       
     4300        self.SaveTreeSetting() # save the current tree selection
     4301        self.GPXtree.SaveExposedItems()             # save the exposed/hidden tree items
    43014302        try:
    43024303            OK,Msg = G2stMn.Refine(self.GSASprojectfile,dlg)    #Msg is Rvals dict if Ok=True
     
    43204321                    self.HKL = []
    43214322                    G2IO.ProjFileOpen(self,False)
    4322                     self.GPXtree.RestoreExposedItems()       
     4323                    self.TreeItemDelete = False  # tree has been repopulated; ignore previous deletions
     4324                    self.GPXtree.RestoreExposedItems() # reset exposed/hidden tree items       
    43234325                    self.ResetPlots()
    43244326            finally:
     
    43284330       
    43294331    def SaveTreeSetting(self):
    4330         'Save the last tree setting'
     4332        'Save the current selected tree item by name (since the id will change)'
    43314333        oldId =  self.GPXtree.GetSelection()        #retain current selection
    43324334        oldPath = self.GetTreeItemsList(oldId)
    43334335        self.lastTreeSetting = oldPath
    4334         # note that for reasons unclear, it does not seem necessary to reload the Atoms tab
    4335         #parentName = ''
    4336         #tabId = None
    4337         # parentId = self.GPXtree.GetItemParent(oldId)
    4338         # if parentId:
    4339         #     parentName = self.GPXtree.GetItemText(parentId)     #find the current data tree name
    4340         #     if 'Phases' in parentName:
    4341         #         tabId = self.dataDisplay.GetSelection()
    4342         #self.lastTreeSetting = oldPath,tabId
    4343         #GSASIIpath.IPyBreak()
    4344        
    4345     def TestResetPlot(self,event):
    4346         '''Debug code to test cleaning up plots after a refinement'''
    4347         #for i in range(self.G2plotNB.nb.GetPageCount()):
    4348         #    [self.G2plotNB.nb.GetPageText(i)
    4349         # save current tree item and (if needed) atoms tab
    4350         self.SaveTreeSetting()
    4351         self.ResetPlots()
    43524336       
    43534337    def ResetPlots(self):
     
    43574341        require one (see G2plotNB.SetNoDelete).
    43584342        '''
    4359         lastRaisedPlotTab = self.G2plotNB.lastRaisedPlotTab # save the last page saved
     4343        lastRaisedPlotTab = self.G2plotNB.lastRaisedPlotTab # save the current plot tab
    43604344        self.G2plotNB.lastRaisedPlotTab = None
    4361 #        print ('lastRaisedPlotTab='+lastRaisedPlotTab)
    4362         # mark displayed plots as invalid
    4363         for lbl,frame in zip(self.G2plotNB.plotList,self.G2plotNB.panelList):
    4364             frame.plotInvalid = True
    4365         # reload current tree item, triggering the routine to redraw the data window and possibly a plot
    4366         #oldPath,tabId = self.lastTreeSetting
    4367         oldPath = self.lastTreeSetting
     4345        #print ('lastRaisedPlotTab='+lastRaisedPlotTab)
     4346        for lbl,win in zip(self.G2plotNB.plotList,self.G2plotNB.panelList):
     4347            win.plotInvalid = True  # mark all current plots as invalid so we can tell what has been updated
     4348           
     4349        oldPath = self.lastTreeSetting  # reload last selected tree item, triggers window and possibly plot redraw
    43684350        Id = self.root
    43694351        for txt in oldPath:
    43704352            Id = GetGPXtreeItemId(self, Id, txt)
    4371         self.PickIdText = None  #force reload of page
     4353        self.PickIdText = None  #forces reload of page
    43724354        if Id:
    43734355            self.PickId = Id
    43744356            self.GPXtree.SelectItem(Id)
     4357        wx.CallLater(100,self.CleanupOldPlots,lastRaisedPlotTab) # wait for plotting to catch up before cleanup
     4358   
     4359    def CleanupOldPlots(self,lastRaisedPlotTab):
     4360        '''Called after a refinement to update plots and delete plots that show obsoleted information
     4361        '''
    43754362        # update other self-updating plots
    4376 #        for lbl,frame in zip(self.G2plotNB.plotList,self.G2plotNB.panelList):
    4377 #            if frame.plotInvalid and frame.replotFunction:
    4378 #                frame.replotFunction(*frame.replotArgs,**frame.replotKWargs)
    4379         # delete any remaining plots that are still invalid and need a refresh
    4380         for lbl,frame in zip(self.G2plotNB.plotList,self.G2plotNB.panelList):
    4381             if frame.plotInvalid and frame.plotRequiresRedraw:
     4363        for lbl,win in zip(self.G2plotNB.plotList,self.G2plotNB.panelList):
     4364            if win.plotInvalid and win.replotFunction:
     4365                if GSASIIpath.GetConfigValue('debug'):
     4366                    print('updating',lbl,'by calling',str(win.replotFunction))
     4367                try:
     4368                    win.replotFunction(*win.replotArgs,**win.replotKWargs)
     4369                except:
     4370                    if GSASIIpath.GetConfigValue('debug'):
     4371                        print('Error with args',win.replotArgs,win.replotKWargs)
     4372        # delete any remaining plots that have not been updated and need a refresh (win.plotRequiresRedraw)
     4373        for lbl,win in zip(self.G2plotNB.plotList,self.G2plotNB.panelList):
     4374            if win.plotInvalid and win.plotRequiresRedraw:
     4375                if GSASIIpath.GetConfigValue('debug'):
     4376                    print('Closing out-of-date plot',lbl)
    43824377                self.G2plotNB.Delete(lbl)
    4383         # put the previously last-raised tab on top, if present. If not, use the one corresponding to
     4378        # put the previously last-raised plot tab on top, if present. If not, use the one corresponding to
    43844379        # the last tree item to be selected
    43854380        wx.CallAfter(self.G2plotNB.RaiseLastPage,lastRaisedPlotTab,self.G2plotNB.lastRaisedPlotTab)
     
    44694464################################################################################
    44704465class G2DataWindow(wx.ScrolledWindow):      #wxscroll.ScrolledPanel):
    4471     '''Create the data item window entries in menus used in
    4472     that window. The menu entries are created for all
    4473     data item windows, but in the Mac the menu is accessed from all
    4474     windows. This means that a different menu is posted depending on which
    4475     data item is posted. On the Mac, all the menus contain the data tree menu
    4476     items, but additional menus are added specific to the data item.
     4466    '''Create the data item window as well as the menu. Note that
     4467    the same core menu items are used in all menus, but different items may be
     4468    added depending on what data tree item (and for phases, the phase tab).
    44774469
    44784470    Note that while the menus are created here,
     
    74257417    if G2frame.PickIdText == G2frame.GetTreeItemsList(item): # don't redo the current data tree item
    74267418        return
    7427     oldPage = None # will be set later if already on a Phase item
    74287419
    74297420    # save or finish processing of outstanding events
     
    74537444        except:     #clumsy but avoids dead window problem when opening another project
    74547445            pass
    7455     elif 'Phase Data for' in G2frame.dataWindow.GetLabel():
    7456         if G2frame.dataDisplay:
    7457             oldPage = G2frame.dataDisplay.GetSelection()
     7446#    elif 'Phase Data for' in G2frame.dataWindow.GetLabel():
     7447#        if G2frame.dataDisplay:
     7448#            oldPage = G2frame.dataDisplay.GetSelection()
    74587449    G2frame.SetLabel('')
    74597450       
     
    76127603    elif G2frame.GPXtree.GetItemText(parentID) == 'Phases':
    76137604        data = G2frame.GPXtree.GetItemPyData(item)
    7614         G2phG.UpdatePhaseData(G2frame,item,data,oldPage)
     7605        G2phG.UpdatePhaseData(G2frame,item,data)
    76157606    elif G2frame.GPXtree.GetItemText(item) == 'Comments':
    76167607        SetDataMenuBar(G2frame,G2frame.dataWindow.DataCommentsMenu)
  • trunk/GSASIIphsGUI.py

    r3269 r3270  
    10901090                    atomData[i][-1] = Faces
    10911091                       
    1092 def UpdatePhaseData(G2frame,Item,data,oldPage):
     1092def UpdatePhaseData(G2frame,Item,data):
    10931093    '''Create the data display window contents when a phase is clicked on
    10941094    in the main (data tree) window.
     
    11021102    :param wx.TreeItemId Item: the tree item that was selected
    11031103    :param dict data: all the information on the phase in a dictionary
    1104     :param int oldPage: This sets a tab to select when moving
    1105       from one phase to another, in which case the same tab is selected
    1106       to display first. This is set only when the previous data tree
    1107       selection is a phase, if not the value is None. The default action
    1108       is to bring up the General tab.
    11091104
    11101105    '''
     
    89368931    def ChangePage(page):
    89378932        text = G2frame.phaseDisplay.GetPageText(page)
    8938         G2frame.phaseDisplayPhaseText = text
     8933        G2frame.lastSelectedPhaseTab = text
    89398934        G2frame.dataWindow.helpKey = text # use name of Phase tab for help lookup
    89408935        if text == 'General':
     
    91959190    G2frame.phaseDisplay.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, OnPageChanged)
    91969191    FillMenus()
    9197     if oldPage is None or oldPage == 0:
     9192    if G2frame.lastSelectedPhaseTab in Pages:
     9193        #     SetupGeneral()    # not sure why one might need this when moving from phase to phase; but does not hurt
     9194        G2frame.phaseDisplay.SetSelection(Pages.index(G2frame.lastSelectedPhaseTab))
     9195    else:
    91989196        ChangePage(0)
    9199         #wx.CallAfter(G2frame.phaseDisplay.SendSizeEvent)
    9200     elif oldPage:
    9201         SetupGeneral()    # not sure why one might need this when moving from phase to phase; but does not hurt
    9202         G2frame.phaseDisplay.SetSelection(oldPage)
  • trunk/GSASIIplot.py

    r3268 r3270  
    11# -*- coding: utf-8 -*-
    2 '''
    3 *GSASIIplot: plotting routines*
    4 ===============================
    5 
    6 '''
    72########### SVN repository information ###################
    83# $Date$
     
    127# $Id$
    138########### SVN repository information ###################
     9'''
     10*GSASIIplot: plotting routines*
     11===============================
     12
     13This module performs all visualization using matplotlib and OpenGL graphics. The following plotting
     14routines are defined:
     15
     16============================  ===========================================================================
     17============================  ===========================================================================
     18:func:`PlotPatterns`          Powder pattern plotting
     19:func:`PlotImage`             Plots of 2D detector images
     20:func:`PlotPeakWidths`        Plot instrument broadening terms as function of 2-theta/TOF
     21:func:`PlotCovariance`        Show covariance terms in 2D
     22:func:`PlotStructure`         Crystal structure plotting with balls, sticks, lines,
     23                              ellipsoids, polyhedra and magnetic moments
     24:func:`PlotSngl`              Structure factor plotting
     25:func:`Plot3DSngl`            3D Structure factor plotting
     26:func:`PlotDeltSig`           Normal probability plot (powder or single crystal)
     27:func:`PlotISFG`              PDF analysis: displays I(Q), S(Q), F(Q) and G(r)
     28:func:`PlotCalib`             CW or TOF peak calibration
     29:func:`PlotXY`                simple plot of xy data
     30:func:`PlotXYZ`               simple contour plot of xyz data
     31:func:`PlotAAProb`            Protein "quality" plot
     32:func:`PlotStrain`            Plot of strain data, used for diagnostic purposes
     33:func:`PlotSASDSizeDist`      Small angle scattering size distribution plot
     34:func:`PlotPowderLines`       Plot powder pattern as a stick plot (vertical lines)
     35:func:`PlotSizeStrainPO`      Plot 3D mustrain/size/preferred orientation figure
     36:func:`PlotTexture`           Pole figure, inverse pole figure plotting
     37:func:`ModulationPlot`        Plots modulation information
     38:func:`PlotTorsion`           Plots MC torsion angles
     39:func:`PlotRama`              Ramachandran of energetically allowed regions for dihedral
     40                              angles in protein
     41:func:`PlotSelectedSequence`  Plot one or more sets of values selected from the sequential
     42                              refinement table
     43:func:`PlotIntegration`       Rectified plot of 2D image after image integration with 2-theta and
     44                              azimuth as coordinates
     45:func:`PlotTRImage`           test plot routine
     46:func:`PlotRigidBody`         show rigid body structures as balls & sticks
     47:func:`PlotLayers`            show layer structures as balls & sticks
     48============================  ===========================================================================
     49
     50These plotting routines place their graphics in the GSAS-II Plot Window, which contains a
     51:class:`G2PlotNoteBook` tabbed panel allowing multiple plots to be viewed. Methods
     52:meth:`G2PlotNoteBook.addMpl` (2-D matplotlib),
     53:meth:`G2PlotNoteBook.add3D` (3-D matplotlib), and
     54:meth:`G2PlotNoteBook.addOgl` (OpenGL) are used to
     55create tabbed plot objects to hold plots of the following classes:
     56:class:`G2PlotMpl` (2-D matplotlib),
     57:class:`G2Plot3D` (3-D matplotlib), and
     58:class:`G2PlotOgl` (OpenGL).
     59These tabbed plot objects share a common parent class, which defines a number
     60of special attributes (variables), which have these uses:
     61
     62======================    ===============     ============================================================
     63variable                   default             use
     64======================    ===============     ============================================================
     65replotFunction              None               Defines a routine to be called to update the plot
     66                                               after a refinement (unless None). Do not define
     67                                               this to use functions that take significant time
     68                                               to complete (also see
     69replotArgs                  []                 Defines the positional arguments to be supplied to
     70                                               the replotFunction function or method.
     71replotKwArgs                {}                 Defines the keyword arguments to be supplied to
     72                                               the replotFunction function or method. (Implemented,
     73                                               but not currently used.)
     74plotInvalid                 False              Used to track if a plot has been updated. Set to False
     75                                               in :meth:`G2PlotNoteBook.FindPlotTab` when a plot is
     76                                               drawn. After a refinement is completed, method
     77                                               :func:`GSASIIdataGUI.GSASII.ResetPlots` sets
     78                                               plotInvalid to False for all plots before any routines
     79                                               are called.
     80plotRequiresRedraw         True                If set to True, after a refinement, the plot will be
     81                                               closed (in :func:`GSASIIdataGUI.GSASII.CleanupOldPlots`)
     82                                               if it was not updated after the refinement. Set this to
     83                                               False using :meth:`G2PlotNoteBook.SetNoDelete`
     84                                               for plots that should not be deleted or do
     85                                               not change based on refinement results.
     86======================    ===============     ============================================================
     87
     88Note that the plot toolbar is customized with :class:`GSASIItoolbar`
     89                                       
     90'''
    1491from __future__ import division, print_function
    1592import platform
     
    133210    'Creates a basic tabbed plot window for GSAS-II graphics'
    134211    def __init__(self,parent,id=-1,dpi=None,**kwargs):
    135         self.ReplotRoutine = None
    136         self.ReplotArgs = []
    137         self.ReplotKwArgs = {}
     212        self.replotFunction = None
     213        self.replotArgs = []
     214        self.replotKwArgs = {}
     215        self.plotInvalid = False # valid
     216        self.plotRequiresRedraw = True # delete plot if not updated
    138217        wx.Panel.__init__(self,parent,id=id,**kwargs)
    139218       
     
    223302        self.plotList = []   # contains the tab label for each plot
    224303        self.panelList = []   # contains the panel object for each plot
    225         self.skipPageChange = False # set to True when no plot update is needed
     304        #self.skipPageChange = False # set to True when no plot update is needed
    226305        self.allowZoomReset = True # this indicates plot should be updated not initialized
     306                                   # (BHT: should this be in tabbed panel rather than here?)
    227307        self.lastRaisedPlotTab = None
    228308       
     
    342422        :param page: the wx.Frame for the matplotlib, openGL, etc. window
    343423        '''
    344         self.skipPageChange = True
     424        #self.skipPageChange = True
    345425        if name in self.plotList:
    346426            print('Warning: duplicate plot name! Name='+name)
     
    351431        self.panelList.append(page) # panel object for plot
    352432        self.lastRaisedPlotTab = name
    353         page.plotInvalid = False # plot has just been drawn
    354         page.plotRequiresRedraw = True # set to False if plot should be retained even if not refreshed
    355         page.replotFunction = None # used to specify a routine to redraw the routine
    356         page.replotArgs = []
    357         page.replotKWargs = {}
    358         self.skipPageChange = False
     433        #page.plotInvalid = False # plot has just been drawn
     434        #page.plotRequiresRedraw = True # set to False if plot should be retained even if not refreshed
     435        #page.replotFunction = None # used to specify a routine to redraw the routine
     436        #page.replotArgs = []
     437        #page.replotKWargs = {}
     438        #self.skipPageChange = False
    359439               
    360440    def addMpl(self,name=""):
     
    407487        'Raises a plot tab without triggering a refresh via OnPageChanged'
    408488        if plotDebug: print ('Raise'+str(self).split('0x')[1])
    409         self.skipPageChange = True
     489        #self.skipPageChange = True
    410490        Page.SetFocus()
    411         self.skipPageChange = False
     491        #self.skipPageChange = False
    412492       
    413493    def SetSelectionNoRefresh(self,plotNum):
    414494        'Raises a plot tab without triggering a refresh via OnPageChanged'
    415495        if plotDebug: print ('Select'+str(self).split('0x')[1])
    416         self.skipPageChange = True
     496        #self.skipPageChange = True
    417497        self.nb.SetSelection(plotNum) # raises plot tab
    418498        Page = self.G2frame.G2plotNB.nb.GetPage(plotNum)
    419499        Page.SetFocus()
    420         self.skipPageChange = False
     500        #self.skipPageChange = False
    421501
    422502    def OnPageChanged(self,event):
     
    424504        Called when a plot tab is clicked. on some platforms (Mac for sure) this
    425505        is also called when a plot is created or selected with .SetSelection() or
    426         .SetFocus(). The self.skipPageChange is used variable is set to suppress
    427         repeated replotting.
     506        .SetFocus().
     507
     508        (removed) The self.skipPageChange is used variable is set to suppress repeated replotting.
    428509        '''
    429510        tabLabel = event.GetEventObject().GetPageText(event.GetSelection())
    430511        self.lastRaisedPlotTab = tabLabel
    431512        if plotDebug:
    432             print ('PageChanged, self='+str(self).split('0x')[1]+tabLabel+str(self.skipPageChange))
     513        #    print ('PageChanged, self='+str(self).split('0x')[1]+tabLabel+str(self.skipPageChange))
     514            print ('PageChanged, self='+str(self).split('0x')[1]+tabLabel)
    433515            print ('event type='+event.GetEventType())
    434516        self.status.DestroyChildren()    #get rid of special stuff on status bar
     
    12981380    elif PickName:
    12991381        G2frame.PickId = G2gd.GetGPXtreeItemId(G2frame, G2frame.PatternId, PickName)
     1382    elif GSASIIpath.GetConfigValue('debug'):
     1383        print('Possible PickId problem PickId=',G2frame.PickId)
    13001384    # for now I am not sure how to regenerate G2frame.HKL
    13011385    G2frame.HKL = [] # TODO
     
    32603344################################################################################
    32613345def PlotAAProb(G2frame,resNames,Probs1,Probs2,Title='',thresh=None,pickHandler=None):
     3346    'Needs a description'
    32623347
    32633348    def OnMotion(event):
     
    33763461           
    33773462def PlotSASDSizeDist(G2frame):
     3463    'Needs a description'
    33783464   
    33793465    def OnPageChanged(event):
     
    41054191
    41064192def ModulationPlot(G2frame,data,atom,ax,off=0):
     4193    'Needs a description'
    41074194    global Off,Atom,Ax,Slab,Off
    41084195    Off = off
     
    69707057        pass
    69717058    wx.CallAfter(Draw,'main')
    6972 #    if firstCall: Draw('main') # draw twice the first time that graphics are displayed
     7059    # on Mac (& Linux?) the structure must be drawn twice the first time that graphics are displayed
     7060    if firstCall: Draw('main') # redraw
    69737061
    69747062################################################################################
     
    72477335            G2frame.G2plotNB.status.SetStatusText('Drawing saved to: '+Fname,1)
    72487336
    7249     # PlotStructure execution starts here (N.B. initialization above)
     7337    # PlotRigidBody execution starts here (N.B. initialization above)
    72507338    new,plotNum,Page,Plot,lim = G2frame.G2plotNB.FindPlotTab('Rigid body','ogl')
    72517339    if new:
  • trunk/GSASIIscriptable.py

    r3253 r3270  
    28582858    """Implements the refine command-line subcommand:
    28592859    conducts refinements on GSAS-II projects according to a JSON refinement dict::
    2860    
    2861   usage: GSASIIscriptable.py refine [-h] gpxfile [refinements]
     2860
     2861        usage: GSASIIscriptable.py refine [-h] gpxfile [refinements]
    28622862
    28632863positional arguments::
  • trunk/docs/source/index.rst

    r3238 r3270  
    3838Note that GSAS-II requires the Python extension packages
    3939
    40 * wxPython (http://wxpython.org/docs/api/),
    41   * note that GSAS-II has been tested with wxPython >=2.8, 3.0.x and 4.0.x
     40* wxPython (http://wxpython.org/docs/api/). Note that GSAS-II has been tested with wxPython >=2.8, 3.0.x and 4.0.x
    4241* NumPy (http://docs.scipy.org/doc/numpy/reference/),
    4342* SciPy (http://docs.scipy.org/doc/scipy/reference/),
    4443* matplotlib (http://matplotlib.org/contents.html)  and
    45 * PyOpenGL (http://pyopengl.sourceforge.net/documentation)
    46   * Note: a copy of this is distributed with GSAS-II at present and will be
    47     installed if the Python setuptools package is present.
     44* PyOpenGL (http://pyopengl.sourceforge.net/documentation). Note: a copy of this is distributed with GSAS-II (at present) and will be installed if the Python setuptools package is present.
    4845
    4946Two packages are used by some parts of the code, but are not
  • trunk/help/gsasII.html

    r3265 r3270  
    34283428  are of the form ‘p:h:name:id’ where ‘p’ is the phase index, ‘h’ is
    34293429  the histogram index and ‘id’ is the item index (if needed). Indexes
    3430   all begin with ‘0’ (zero). Note that for atom positions the value is
    3431   not a refinable parameter, but the shift in the value is. Position
    3432   names are, e.g. ‘0::Ax:0’ for the x-position of the 0th atom in
    3433   the 0th phase while shift names have a ‘d’ in them,
    3434   e.g. ‘0::dAx:0’. Press the window exit button to exit this dialog box.
     3430  all begin with ‘0’ (zero).
     3431<P>
     3432      Note that for atom positions, the coordinate values (named as
     3433  ‘p::A<i>w</i>:n’, where p is the phase number, n is the atom number
     3434  and <i>w</i> is x, y or z) is
     3435  not a refinable parameter, but the shift in the value is. The
     3436  refined parameters are ‘p::A<i>w</i>:n’.
     3437      The reason this is done is that by treating an atom
     3438  position as x+dx,y+dy,z+dz where the “d” values indicate shifts from
     3439  the starting position and the shifts
     3440  are refined rather than the x,y, or z values is that this simplifies
     3441  symmetry constraints. As an example, suppose we have an atom on
     3442  a symmetry constrained site, x,1/2-x,z. The process needed to define
     3443  this constraint, so
     3444  that if x moves positively y has to move negatively by the same
     3445  amount would be messy. With refinement of shifts, all we need to do is constrain dy (‘0::dAy:n’)
     3446  to be equal to -dx (-1*‘0::dAx:n’).
     3447      <P>
     3448      Press the window exit button to exit this dialog box.
    34353449    <DT><b>Refine</b>
    34363450    <DD>This performs the refinement (Pawley/Rietveld or single
     
    71427156<hr size=2 width="100%" align=center>
    71437157
    7144 <!-- hhmts start -->Last modified: Tue Feb  6 17:27:23 CST 2018 <!-- hhmts end -->
     7158<!-- hhmts start -->Last modified: Tue Feb  6 22:56:34 CST 2018 <!-- hhmts end -->
    71457159
    71467160</div>
Note: See TracChangeset for help on using the changeset viewer.