Changeset 612


Ignore:
Timestamp:
May 11, 2012 10:35:51 AM (11 years ago)
Author:
vondreele
Message:

complete combined x/n exercise & fix bugs uncovered in process
made version 0.2.0
moved tutorials in help menu to be 2nd
fixed problem with drawing after f-map generated
fixed some plot errors
reverse sign on macrostrain

Location:
trunk
Files:
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Exercises/PbSO4/INST_XRY.PRM

    r603 r612  
    1             123456789012345678901234567890123456789012345678901234567890       
     1            123456789012345678901234567890123456789012345678901234567890
    22INS   BANK      1                                                               
    33INS   HTYPE   PXCR                                                             
    44INS  1 IRAD     3                                                               
    55INS  1 ICONS  1.540500  1.544300       0.0         0       0.7    0       0.5   
    6 INS  1I HEAD  DUMMY INCIDENT SPECTRUM FOR X-RAY DIFFRACTOMETER                 
     6INS  1I HEAD  DUMMY INCIDENT SPECTRUM FOR X-RAY DIFFRACTOMETER
    77INS  1I ITYP    0    0.0000  180.0000         1                                 
    88INS  1PRCF1     3    8      0.01                                               
    99INS  1PRCF11   2.000000E+00  -2.000000E+00   5.000000E+00   0.100000E+00       
    1010INS  1PRCF12   0.000000E+00   0.000000E+00   0.150000E-01   0.150000E-01       
    11 INS  1PRCF2     2    6      0.01                                               
    12 INS  1PRCF21   2.000000E+00  -2.000000E+00   5.000000E+00   0.100000E+01       
    13 INS  1PRCF22   0.100000E+01   0.000000E+00                                     
    14 INS  1PRCF3     4   12      0.01                                               
    15 INS  1PRCF31   2.000000E+00  -2.000000E+00   5.000000E+00   0.000000E+00       
    16 INS  1PRCF32   0.100000E+00   0.000000E+00   0.000000E+00   0.000000E+00       
    17 INS  1PRCF33   0.000000E+00   0.150000E-01   0.150000E-01   0.750000E+00       
  • trunk/GSASII.py

    r609 r612  
    8484    pass
    8585#    print "MKL module not present"
    86 __version__ = '0.1.5'
     86__version__ = '0.2.0'
    8787G2gd.__version__ = __version__
    8888print "This is GSAS-II version:     ",__version__
  • trunk/GSASIIgrid.py

    r610 r612  
    143143            frame.Bind(wx.EVT_MENU, self.OnHelpById, helpobj)
    144144            self.HelpById[helpobj.GetId()] = helpType
    145         self.Append(help='', id=wx.ID_ABOUT, kind=wx.ITEM_NORMAL,
    146             text='&About GSAS-II')
    147         frame.Bind(wx.EVT_MENU, self.OnHelpAbout, id=wx.ID_ABOUT)
    148145        for lbl,indx in morehelpitems:
    149146            helpobj = self.Append(text=lbl,
     
    151148            frame.Bind(wx.EVT_MENU, self.OnHelpById, helpobj)
    152149            self.HelpById[helpobj.GetId()] = indx
     150        self.Append(help='', id=wx.ID_ABOUT, kind=wx.ITEM_NORMAL,
     151            text='&About GSAS-II')
     152        frame.Bind(wx.EVT_MENU, self.OnHelpAbout, id=wx.ID_ABOUT)
    153153
    154154    def OnHelpById(self,event):
  • trunk/GSASIIphsGUI.py

    r609 r612  
    14421442#        elif generalData['Type'] == 'modulated':
    14431443#           ?????   for future
    1444         if not drawingData['Atoms']:
     1444        if not drawingData.get('Atoms'):
    14451445            for atom in atomData:
    14461446                DrawAtomAdd(drawingData,atom)
     
    17821782            dlg.Destroy()
    17831783            G2frame.dataFrame.SetStatusText('')
     1784            G2plt.PlotStructure(G2frame,data)
    17841785           
    17851786    def ResetAtomColors(event):
     
    36443645        mapData['Flip'] = False
    36453646        mapSig = np.std(mapData['rho'])
     3647        if not data['Drawing']:                 #if new drawing - no drawing data!
     3648            SetupDrawingData()
    36463649        data['Drawing']['contourLevel'] = 1.
    36473650        data['Drawing']['mapSize'] = 10.
    36483651        print mapData['MapType']+' computed: rhomax = %.3f rhomin = %.3f sigma = %.3f'%(np.max(mapData['rho']),np.min(mapData['rho']),mapSig)
     3652        UpdateDrawAtoms()
    36493653        G2plt.PlotStructure(G2frame,data)
    36503654       
     
    37013705        G2frame.dataFrame.Bind(wx.EVT_MENU, OnPeaksMove, id=G2gd.wxID_PEAKSMOVE)
    37023706        G2frame.dataFrame.Bind(wx.EVT_MENU, OnPeaksClear, id=G2gd.wxID_PEAKSCLEAR)
     3707        UpdateDrawAtoms()
    37033708        FillMapPeaksGrid()
    37043709        G2plt.PlotStructure(G2frame,data)
  • trunk/GSASIIplot.py

    r584 r612  
    425425                    wave = Parms['Lam1']
    426426                if G2frame.qPlot:
    427                     xpos = 2.0*asind(xpos*wave/(4*math.pi))
     427                    try:
     428                        xpos = 2.0*asind(xpos*wave/(4*math.pi))
     429                    except ValueError:      #avoid bad value in asin beyond upper limit
     430                        pass
    428431                dsp = 0.0
    429432                if abs(xpos) > 0.:                  #avoid possible singularity at beam center
     
    550553            Phases = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId,'Reflection Lists'))
    551554            pick = str(G2frame.itemPicked).split('(')[1].strip(')')
    552             if 'Line' not in pick:       #avoid data points, etc.
     555            if 'line' not in pick:       #avoid data points, etc.
    553556                num = Phases.keys().index(pick)
    554557                if num:
     
    750753            for pId,phase in enumerate(Phases):
    751754                peaks = Phases[phase]
     755                if not peaks:
     756                    continue
    752757                peak = np.array([[peak[4],peak[5]] for peak in peaks])
    753758                pos = G2frame.refOffset-pId*Ymax*G2frame.refDelt*np.ones_like(peak)
     
    758763            if len(Phases):
    759764                handles,legends = Plot.get_legend_handles_labels()  #got double entries in the legends for some reason
    760                 Plot.legend(handles[::2],legends[::2],title='Phases',loc='best')    #skip every other one
     765                if handles:
     766                    Plot.legend(handles[::2],legends[::2],title='Phases',loc='best')    #skip every other one
    761767           
    762768    if G2frame.Contour:
  • trunk/GSASIIstruct.py

    r609 r612  
    23062306        Dij = parmDict[phfx+'D11']*h**2+parmDict[phfx+'D22']*k**2+parmDict[phfx+'D33']*l**2+ \
    23072307            parmDict[phfx+'D12']*h*k+parmDict[phfx+'D13']*h*l+parmDict[phfx+'D23']*k*l
    2308     return Dij*refl[4]**2*tand(refl[5]/2.0)
     2308    return -Dij*refl[4]**2*tand(refl[5]/2.0)
    23092309           
    23102310def GetHStrainShiftDerv(refl,SGData,phfx):
     
    23362336            phfx+'D12':h*k,phfx+'D13':h*l,phfx+'D23':k*l}
    23372337    for item in dDijDict:
    2338         dDijDict[item] *= refl[4]**2*tand(refl[5]/2.0)
     2338        dDijDict[item] *= -refl[4]**2*tand(refl[5]/2.0)
    23392339    return dDijDict
    23402340   
     
    23942394                        Wd,fmin,fmax = G2pwd.getWidths(refl[5],refl[6],refl[7],shl)
    23952395                        iBeg = max(xB,np.searchsorted(x,refl[5]-fmin))
    2396                         iFin = min(np.searchsorted(x,refl[5]+fmax),xF)
     2396                        iFin = max(xB,min(np.searchsorted(x,refl[5]+fmax),xF))
    23972397                        iFin2 = iFin
    23982398                        yp[iBeg:iFin] = refl[13]*refl[9]*G2pwd.getFCJVoigt3(refl[5],refl[6],refl[7],shl,x[iBeg:iFin])    #>90% of time spent here
     
    24002400                            pos2 = refl[5]+lamRatio*tand(refl[5]/2.0)       # + 360/pi * Dlam/lam * tan(th)
    24012401                            Wd,fmin,fmax = G2pwd.getWidths(pos2,refl[6],refl[7],shl)
    2402                             iBeg2 = max(xB,np.searchsorted(x[xB:xF],pos2-fmin))
    2403                             iFin2 = min(np.searchsorted(x[xB:xF],pos2+fmax),xF)
     2402                            iBeg2 = max(xB,np.searchsorted(x,pos2-fmin))
     2403                            iFin2 = min(np.searchsorted(x,pos2+fmax),xF)
     2404                            if not iBeg2+iFin2:       #peak below low limit - skip peak
     2405                                continue
     2406                            elif not iBeg2-iFin2:     #peak above high limit - done
     2407                                break
    24042408                            yp[iBeg2:iFin2] += refl[13]*refl[9]*kRatio*G2pwd.getFCJVoigt3(pos2,refl[6],refl[7],shl,x[iBeg2:iFin2])        #and here
    24052409                        refl[8] = np.sum(np.where(ratio[iBeg:iFin2]>0.,yp[iBeg:iFin2]*ratio[iBeg:iFin2]/(refl[13]*(1.+kRatio)),0.0))
Note: See TracChangeset for help on using the changeset viewer.