Changeset 1908
- Timestamp:
- Jun 24, 2015 3:48:08 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r1906 r1908 3628 3628 textureData['PFxyz'] = xyz 3629 3629 wx.CallAfter(G2plt.PlotTexture,G2frame,data) 3630 3631 def OnpopLA(event): 3632 pfName = PhaseName 3633 cell = generalData['Cell'][1:7] 3634 PH = np.array(textureData['PFhkl']) 3635 phi,beta = G2lat.CrsAng(PH,cell,SGData) 3636 SHCoef = textureData['SH Coeff'][1] 3637 ODFln = G2lat.Flnh(True,SHCoef,phi,beta,SGData) 3638 pfName = PhaseName+'%d%d%d.gpf'%(PH[0],PH[1],PH[2]) 3639 dlg = wx.FileDialog(G2frame, 'Choose popLA pole figure file name', '.', pfName, 3640 'popLA file (*.gpf)|*.gpf',wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT|wx.CHANGE_DIR) 3641 try: 3642 if dlg.ShowModal() == wx.ID_OK: 3643 pfFile = dlg.GetPath() 3644 finally: 3645 dlg.Destroy() 3646 print 'popLA save '+pfFile 3647 if pfFile: 3648 pf = open(pfFile,'w') 3649 pf.write(PhaseName+'\n') 3650 str = ' %d%d%d 5.0 90.0 5.0360.0 1 1 2 1 3 100 1'%(PH[0],PH[1],PH[2]) 3651 pf.write(str+'\n') 3652 Psi,Gam = np.mgrid[0:19,0:72] 3653 Psi = Psi.flatten()*5. 3654 Gam = Gam.flatten()*5. 3655 Z = np.array(G2lat.polfcal(ODFln,SamSym[textureData['Model']],Psi,Gam)*100.,dtype='int') 3656 Z = np.where(Z>0,Z,0) 3657 Z = np.where(Z<9999,Z,9999) 3658 for i in range(76): 3659 iBeg = i*18 3660 iFin = iBeg+18 3661 np.savetxt(pf,Z[iBeg:iFin],fmt='%4d',newline='') 3662 pf.write('\n') 3663 pf.close() 3664 print ' popLA %d %d %d pole figure saved to %s'%(PH[0],PH[1],PH[2],pfFile) 3630 3665 3631 3666 def SHPenalty(Penalty): … … 3725 3760 mainSizer.Add(shSizer,0,0) 3726 3761 mainSizer.Add((0,5),0) 3727 PTSizer = wx.FlexGridSizer(0, 4,5,5)3762 PTSizer = wx.FlexGridSizer(0,5,5,5) 3728 3763 PTSizer.Add(wx.StaticText(Texture,-1,' Texture plot type: '),0,WACV) 3729 3764 choices = ['Axial pole distribution','Pole figure','Inverse pole figure','3D pole distribution'] … … 3738 3773 projSel.Bind(wx.EVT_COMBOBOX,OnProjSel) 3739 3774 PTSizer.Add(projSel,0,WACV) 3775 PTSizer.Add((0,5),0) 3740 3776 if textureData['PlotType'] in ['Pole figure','Axial pole distribution','3D pole distribution']: 3741 3777 PTSizer.Add(wx.StaticText(Texture,-1,' Pole figure HKL: '),0,WACV) … … 3757 3793 colorSel.Bind(wx.EVT_COMBOBOX,OnColorSel) 3758 3794 PTSizer.Add(colorSel,0,WACV) 3795 popLA = wx.Button(Texture,-1,"Make popLA file") 3796 popLA.Bind(wx.EVT_BUTTON, OnpopLA) 3797 if 'Inverse' not in textureData['PlotType']: 3798 PTSizer.Add(popLA,0,WACV) 3759 3799 mainSizer.Add(PTSizer,0,WACV) 3760 3800 mainSizer.Add((0,5),0)
Note: See TracChangeset
for help on using the changeset viewer.