Changeset 1386


Ignore:
Timestamp:
Jun 17, 2014 2:45:48 PM (7 years ago)
Author:
vondreele
Message:

fix stress strain data references

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1380 r1386  
    24852485                        Masks = {'Points':[],'Rings':[],'Arcs':[],'Polygons':[],'Frames':[],'Thresholds':[(Imin,Imax),[Imin,Imax]]}
    24862486                        self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Masks'),Masks)
    2487                         self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Stress/Strain'),{})
     2487                        self.PatternTree.SetItemPyData(self.PatternTree.AppendItem(Id,text='Stress/Strain'),
     2488                            {'Type':'True','d-zero':[],'Sample phi':0.0,'Sample z':0.0,'Sample load':0.0})
    24882489                        self.PatternTree.SelectItem(Id)
    24892490                        self.PatternTree.Expand(Id)
  • trunk/GSASIIIO.py

    r1384 r1386  
    282282       
    283283def PutG2Image(filename,Comments,Data,Npix,image):
    284     'Write an image as a python pickle'
     284    'Write an image as a python pickle - might be better as an .edf file?'
    285285    File = open(filename,'wb')
    286286    cPickle.dump([Comments,Data,Npix,image],File,1)
  • trunk/GSASIIgrid.py

    r1384 r1386  
    48384838        G2frame.Image = G2frame.PatternTree.GetItemParent(item)
    48394839        data = G2frame.PatternTree.GetItemPyData(item)
    4840         G2imG.UpdateStressStrain(G2frame,data)
    48414840        G2plt.PlotImage(G2frame)
    48424841        G2plt.PlotStrain(G2frame,data,newPlot=True)
     4842        G2imG.UpdateStressStrain(G2frame,data)
    48434843    elif G2frame.PatternTree.GetItemText(item) == 'PDF Controls':
    48444844        G2frame.PatternId = G2frame.PatternTree.GetItemParent(item)
  • trunk/GSASIIimgGUI.py

    r1384 r1386  
    2121import time
    2222import copy
    23 import cPickle
    2423import GSASIIpath
    2524GSASIIpath.SetVersionNumber("$Revision$")
     
    235234       
    236235    def OnCopyControls(event):
    237         import copy
    238236        TextList = [[False,'All IMG',0]]
    239237        Names = []
     
    246244                    if id == G2frame.Image:
    247245                        Source = name
    248                         Data = copy.deepcopy(G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,id, 'Image Controls')))
     246                        Data = copy.deepcopy(data)
     247#                        Data = copy.deepcopy(G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,id, 'Image Controls')))
    249248                        Data['showLines'] = True
    250249                        Data['ring'] = []
     
    278277            finally:
    279278                dlg.Destroy()
     279                G2frame.PatternTree.SelectItem(G2frame.PickId)
    280280               
    281281    def OnSaveControls(event):
     
    624624           
    625625        def OnSetDefault(event):
    626             import copy
    627626            if data['setDefault']:
    628627                G2frame.imageDefault = {}
     
    10981097
    10991098    def OnCopyMask(event):
    1100         import copy
    11011099        TextList = [[False,'All IMG',0]]
    11021100        Names = []
     
    14191417           
    14201418    def OnCopyStrSta(event):
    1421         import copy
    1422         TextList = [[False,'All IMG',0]]
     1419        TextList = [[False,'All IMG',0,0]]
    14231420        Names = []
    14241421        if G2frame.PatternTree.GetCount():
  • trunk/GSASIIplot.py

    r1383 r1386  
    25182518    '''
    25192519    G2frame.dataFrame.GetStatusBar().SetStatusText('Add strain ring active - LB pick d-zero value',0)
    2520     StrSta = G2frame.PatternTree.GetItemPyData(
    2521         G2gd.GetPatternTreeItemId(G2frame,G2frame.Image, 'Stress/Strain'))
     2520    G2frame.PickId = G2gd.GetPatternTreeItemId(G2frame,G2frame.Image, 'Stress/Strain')
     2521    data = G2frame.PatternTree.GetItemPyData(G2frame.PickId)
     2522    return data
    25222523
    25232524def PlotImage(G2frame,newPlot=False,event=None,newImage=True):
     
    25282529    import numpy.ma as ma
    25292530    Dsp = lambda tth,wave: wave/(2.*npsind(tth/2.))
    2530     global Data,Masks
     2531    global Data,Masks,StrSta
    25312532    colors=['b','g','r','c','m','k']
    25322533    Data = G2frame.PatternTree.GetItemPyData(
     
    25982599            if event.key in ['a',]:
    25992600                G2frame.StrainKey = event.key
    2600                 OnStartNewDzero(G2frame)
     2601                StrSta = OnStartNewDzero(G2frame)
    26012602                PlotImage(G2frame,newPlot=False)
    26022603               
Note: See TracChangeset for help on using the changeset viewer.