Changeset 2731


Ignore:
Timestamp:
Mar 1, 2017 9:08:17 AM (5 years ago)
Author:
vondreele
Message:

add save of stress/strain ring intensities as MRD in txt file
calculate stress/strain ring intensities from 5x5 pixel blocks (was 3x3)
show sig(MRD) instead of var(MRD) in ring intensities

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r2726 r2731  
    104104
    105105[ wxID_STRSTACOPY, wxID_STRSTAFIT, wxID_STRSTASAVE, wxID_STRSTALOAD,wxID_STRSTSAMPLE,
    106     wxID_APPENDDZERO,wxID_STRSTAALLFIT,wxID_UPDATEDZERO,wxID_STRSTAPLOT,
    107 ] = [wx.NewId() for item in range(9)]
     106    wxID_APPENDDZERO,wxID_STRSTAALLFIT,wxID_UPDATEDZERO,wxID_STRSTAPLOT,wxID_STRRINGSAVE,
     107] = [wx.NewId() for item in range(10)]
    108108
    109109[ wxID_BACKCOPY,wxID_LIMITCOPY, wxID_SAMPLECOPY, wxID_SAMPLECOPYSOME, wxID_BACKFLAGCOPY, wxID_SAMPLEFLAGCOPY,
     
    22692269        self.StrStaEdit.Append(help='Plot intensity distribution',
    22702270            id=wxID_STRSTAPLOT, kind=wx.ITEM_NORMAL,text='Plot intensity distribution')
     2271        self.StrStaEdit.Append(help='Save intensity distribution',
     2272            id=wxID_STRRINGSAVE, kind=wx.ITEM_NORMAL,text='Save intensity distribution')
    22712273        self.StrStaEdit.Append(help='Update d-zero from ave d-zero',
    22722274            id=wxID_UPDATEDZERO, kind=wx.ITEM_NORMAL,text='Update d-zero')       
  • trunk/GSASIIimage.py

    r2725 r2731  
    214214    ypix = int(Ypix)
    215215    if not w:
    216         ZMax = np.sum(image[ypix-1:ypix+1,xpix-1:xpix+1])
     216        ZMax = np.sum(image[ypix-2:ypix+2,xpix-2:xpix+2])
    217217        return xpix,ypix,ZMax,0.0001
    218218    if (w2 < xpix < sizex-w2) and (w2 < ypix < sizey-w2) and image[ypix,xpix]:
     
    10301030            ringint = np.array([float(Image[int(x*scalex),int(y*scaley)]) for y,x in np.array(ringxy)[:,:2]])
    10311031            ringint /= np.mean(ringint)
    1032             print ' %s %.3f %s %.3f'%('d-spacing',ring['Dcalc'],'var(MRD):',np.var(ringint))
     1032            print ' %s %.3f %s %.3f'%('d-spacing',ring['Dcalc'],'sig(MRD):',np.sqrt(np.var(ringint)))
    10331033            RingsAI.append(np.array(zip(ringazm,ringint)).T)
    1034 #            GSASIIpath.IPyBreak()
    10351034    return RingsAI
    10361035   
     
    10561055        else:                       #compression
    10571056            ring['Dcalc'] = dmin+3.*(dmax-dmin)/4.
    1058 #        ring['Dcalc'] = np.mean(ring['ImtaCalc'][0])
    10591057
    10601058def calcFij(omg,phi,azm,th):
  • trunk/GSASIIimgGUI.py

    r2727 r2731  
    19221922            names=Names,lines=True)
    19231923       
     1924    def OnSaveStrRing(event):
     1925        Controls = G2frame.PatternTree.GetItemPyData(
     1926            G2gd.GetPatternTreeItemId(G2frame,G2frame.Image, 'Image Controls'))
     1927        RingInt = G2img.IntStrSta(G2frame.ImageZ,data,Controls)
     1928        Names = ['d=%.3f'%(ring['Dcalc']) for ring in data['d-zero']]
     1929        pth = G2G.GetExportPath(G2frame)
     1930        dlg = wx.FileDialog(G2frame, 'Choose strain ring intensity file', pth, '',
     1931            'ring intensity file (*.txt)|*.txt',wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
     1932        try:
     1933            if dlg.ShowModal() == wx.ID_OK:
     1934                filename = dlg.GetPath()
     1935                File = open(filename,'w')
     1936                for i,name in enumerate(Names):
     1937                    File.write('%s%s\n'%(' Ring intensity for ',name))
     1938                    File.write('%12s %12s\n'%('Azimuth','RMD'))
     1939                    for item in RingInt[i].T:
     1940                        File.write(' %12.3f %12.3f\n'%(item[0],item[1]))
     1941                    File.write('\n')
     1942                File.close()
     1943        finally:
     1944            dlg.Destroy()
     1945               
     1946               
    19241947    def OnFitStrSta(event):
    19251948        Controls = G2frame.PatternTree.GetItemPyData(
     
    21292152    G2frame.dataFrame.Bind(wx.EVT_MENU, OnUpdateDzero, id=G2gd.wxID_UPDATEDZERO)
    21302153    G2frame.dataFrame.Bind(wx.EVT_MENU, OnFitStrSta, id=G2gd.wxID_STRSTAFIT)
    2131     G2frame.dataFrame.Bind(wx.EVT_MENU, OnPlotStrSta, id=G2gd.wxID_STRSTAPLOT)
     2154    G2frame.dataFrame.Bind(wx.EVT_MENU, OnPlotStrSta, id=G2gd.wxID_STRSTAPLOT) 
     2155    G2frame.dataFrame.Bind(wx.EVT_MENU, OnSaveStrRing, id=G2gd.wxID_STRRINGSAVE) 
    21322156    G2frame.dataFrame.Bind(wx.EVT_MENU, OnFitAllStrSta, id=G2gd.wxID_STRSTAALLFIT)
    21332157    G2frame.dataFrame.Bind(wx.EVT_MENU, OnCopyStrSta, id=G2gd.wxID_STRSTACOPY)
Note: See TracChangeset for help on using the changeset viewer.