Changeset 2272


Ignore:
Timestamp:
May 14, 2016 9:45:23 AM (6 years ago)
Author:
vondreele
Message:

add Stacking Faults II tutorial
add a Copy Phase command to Layers menu
bring up new phase after Transform
change default dir/file name for saved structure drawings

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2246 r2272  
    28632863        E,SGData = G2spc.SpcGroup('P 1')
    28642864        self.PatternTree.SetItemPyData(sub,G2IO.SetNewPhase(Name=PhaseName,SGData=SGData))
     2865        G2gd.MovePatternTreeToGrid(self,sub) #bring up new phase General tab
    28652866       
    28662867    def OnDeletePhase(self,event):
  • trunk/GSASIIctrls.py

    r2249 r2272  
    38613861    ['StackingFaults-I', 'StackingFaults-I', 'Stacking Faults-I.htm',
    38623862        'Stacking fault simulations for diamond'],
    3863 #    ['StackingFaults-II', 'StackingFaults-II', 'Stacking Faults-II.htm',
    3864 #        'Stacking fault simulations for kaolinite'],
     3863    ['StackingFaults-II', 'StackingFaults-II', 'Stacking Faults II.htm',
     3864        'Stacking fault simulations for kaolinite'],
    38653865       
    38663866    ['CFXraySingleCrystal','CFXraySingleCrystal','CFSingleCrystal.htm',
  • trunk/GSASIIgrid.py

    r2242 r2272  
    8787] = [wx.NewId() for item in range(2)]
    8888
    89 [ wxID_LOADDIFFAX,wxID_LAYERSIMULATE,wxID_SEQUENCESIMULATE,
    90 ] = [wx.NewId() for item in range(3)]
     89[ wxID_LOADDIFFAX,wxID_LAYERSIMULATE,wxID_SEQUENCESIMULATE, wxID_COPYPHASE,
     90] = [wx.NewId() for item in range(4)]
    9191
    9292[ wxID_PAWLEYLOAD, wxID_PAWLEYESTIMATE, wxID_PAWLEYUPDATE,
     
    19611961        self.LayerDataEdit.Append(id=wxID_LOADDIFFAX, kind=wx.ITEM_NORMAL,text='Load from DIFFaX file',
    19621962            help='Load layer info from DIFFaX file')
     1963        self.LayerDataEdit.Append(id=wxID_COPYPHASE, kind=wx.ITEM_NORMAL,text='Copy phase cell',
     1964            help='Copy phase cell from another project')
    19631965        self.LayerDataEdit.Append(id=wxID_LAYERSIMULATE, kind=wx.ITEM_NORMAL,text='Simulate pattern',
    19641966            help='Simulate diffraction pattern from layer stacking')
  • trunk/GSASIIphsGUI.py

    r2249 r2272  
    12271227            G2gd.GetPatternTreeItemId(G2frame,G2frame.root,'Phases'),text=phaseName)
    12281228        G2frame.PatternTree.SetItemPyData(sub,newPhase)
    1229 
     1229#        G2gd.MovePatternTreeToGrid(G2frame,sub) #bring up new phase General tab
     1230       
    12301231################################################################################
    12311232#####  Atom routines
     
    30923093        SetPhaseWindow(G2frame.dataFrame,G2frame.layerData,mainSizer,Scroll)
    30933094       
     3095    def OnCopyPhase(event):
     3096        dlg = wx.FileDialog(G2frame, 'Choose GSAS-II project file',
     3097            wildcard='GSAS-II project file (*.gpx)|*.gpx',style=wx.OPEN| wx.CHANGE_DIR)
     3098        try:
     3099            if dlg.ShowModal() == wx.ID_OK:
     3100                GPXFile = dlg.GetPath()
     3101                phaseNames = G2strIO.GetPhaseNames(GPXFile)
     3102            else:
     3103                return
     3104        finally:
     3105            dlg.Destroy()
     3106        dlg = wx.SingleChoiceDialog(G2frame,'Phase to use for cell data','Select',phaseNames)
     3107        if dlg.ShowModal() == wx.ID_OK:
     3108            sel = dlg.GetSelection()
     3109            PhaseName = phaseNames[sel]
     3110        else:
     3111            return
     3112        General = G2strIO.GetAllPhaseData(GPXFile,PhaseName)['General']
     3113        data['Layers']['Cell'] = General['Cell']
     3114        wx.CallAfter(UpdateLayerData)
     3115
    30943116    def OnLoadDIFFaX(event):
    30953117        if len(data['Layers']['Layers']):
     
    73997421            G2frame.dataFrame.Bind(wx.EVT_MENU, OnWaveVary, id=G2gd.wxID_WAVEVARY)
    74007422        # Stacking faults
    7401         if data['General']['Type'] == 'faulted':
    7402             FillSelectPageMenu(TabSelectionIdDict, G2frame.dataFrame.LayerData)
    7403             G2frame.dataFrame.Bind(wx.EVT_MENU, OnLoadDIFFaX, id=G2gd.wxID_LOADDIFFAX)
    7404             G2frame.dataFrame.Bind(wx.EVT_MENU, OnSimulate, id=G2gd.wxID_LAYERSIMULATE)
    7405             G2frame.dataFrame.Bind(wx.EVT_MENU, OnSeqSimulate, id=G2gd.wxID_SEQUENCESIMULATE)
     7423        FillSelectPageMenu(TabSelectionIdDict, G2frame.dataFrame.LayerData)
     7424        G2frame.dataFrame.Bind(wx.EVT_MENU, OnCopyPhase, id=G2gd.wxID_COPYPHASE)
     7425        G2frame.dataFrame.Bind(wx.EVT_MENU, OnLoadDIFFaX, id=G2gd.wxID_LOADDIFFAX)
     7426        G2frame.dataFrame.Bind(wx.EVT_MENU, OnSimulate, id=G2gd.wxID_LAYERSIMULATE)
     7427        G2frame.dataFrame.Bind(wx.EVT_MENU, OnSeqSimulate, id=G2gd.wxID_SEQUENCESIMULATE)
    74067428        # Draw Options
    74077429        FillSelectPageMenu(TabSelectionIdDict, G2frame.dataFrame.DataDrawOptions)
  • trunk/GSASIIplot.py

    r2246 r2272  
    649649                Fname = os.path.join(Mydir,generalData['Name']+'.'+mode)
    650650            except NameError:   #for when generalData doesn't exist!
    651                 Fname = os.path.join(Mydir,'unknown'+'.'+mode)
     651                Fname = (os.path.join(Mydir,'unknown'+'.'+mode)).replace('*','+')
    652652            print Fname+' saved'
    653653            size = Page.canvas.GetSize()
     
    22712271            return
    22722272        Ymax = max(Ymax,max(xye[1]))
    2273     offset = Pattern[0]['Offset'][0]*Ymax/100.0
     2273    offset = Pattern[0].get('Offset',[0,0])[0]*Ymax/100.0
    22742274    if G2frame.Contour:
    22752275        ContourZ = []
     
    22922292                Plot.set_ylabel('Data sequence',fontsize=12)
    22932293        else:
    2294             X = xye[0]+Pattern[0]['Offset'][1]*.005*N
     2294            X = xye[0]+Pattern[0].get('Offset',[0,0])[1]*.005*N
    22952295            if ifpicked:
    22962296                Plot.plot(X,Y,colors[N%6]+'+',picker=3.,clip_on=False)
     
    47104710                    print "PIL/pillow Image module not present. Cannot save images without this"
    47114711                    raise Exception("PIL/pillow Image module not found")
    4712             Fname = os.path.join(Mydir,generalData['Name']+'.'+mode)
     4712            projFile = G2frame.GSASprojectfile
     4713            Fname = (os.path.splitext(projFile)[0]+'.'+mode).replace('*','+')
    47134714            size = Page.canvas.GetSize()
    47144715            glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
     
    60546055        [uBox[4],uBox[5]],[uBox[5],uBox[6]],[uBox[6],uBox[7]],[uBox[7],uBox[4]]])
    60556056    uColors = [Rd,Gr,Bl,Wt-Bc, Wt-Bc,Wt-Bc,Wt-Bc,Wt-Bc, Wt-Bc,Wt-Bc,Wt-Bc,Wt-Bc]
     6057    uEdges[2][1][2] = len(laySeq)
    60566058    AtInfo = Layers['AtInfo']
    60576059    Names = [layer['Name'] for layer in Layers['Layers']]
     
    60706072                    raise Exception("PIL/pillow Image module not found")
    60716073            projFile = G2frame.GSASprojectfile
    6072             Fname = os.path.splitext(projFile)[0]+'.'+mode
     6074            Fname = (os.path.splitext(projFile)[0]+'.'+mode).replace('*','+')
    60736075            size = Page.canvas.GetSize()
    60746076            glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
Note: See TracChangeset for help on using the changeset viewer.