Changeset 2056 for trunk/GSASIIIO.py


Ignore:
Timestamp:
Nov 17, 2015 12:32:25 PM (6 years ago)
Author:
vondreele
Message:

peak list read/list/indexing now fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r2042 r2056  
    9494    sind = lambda x: math.sin(x*math.pi/180.)
    9595    asind = lambda x: 180.*math.asin(x)/math.pi
    96     Cuka = 1.54052
     96    wave = 1.54052
    9797    File = open(fileName,'Ur')
    9898    Comments = []
     
    112112    if Comments:
    113113       print 'Comments on file:'
    114        for Comment in Comments: print Comment
     114       for Comment in Comments:
     115            print Comment
     116            if 'wavelength' in Comment:
     117                wave = float(Comment.split('=')[1])
    115118    Peaks = []
    116119    if peaks[0][0] > peaks[-1][0]:          # d-spacings - assume CuKa
    117120        for peak in peaks:
    118121            dsp = peak[0]
    119             sth = Cuka/(2.0*dsp)
     122            sth = wave/(2.0*dsp)
    120123            if sth < 1.0:
    121124                tth = 2.0*asind(sth)
     
    126129        for peak in peaks:
    127130            tth = peak[0]
    128             dsp = Cuka/(2.0*sind(tth/2.0))
     131            dsp = wave/(2.0*sind(tth/2.0))
    129132            Peaks.append([tth,peak[1],True,False,0,0,0,dsp,0.0])
    130     return Comments,Peaks
     133    limits = [1000.,0.]
     134    for peak in Peaks:
     135        limits[0] = min(limits[0],peak[0])
     136        limits[1] = max(limits[1],peak[0])
     137    limits[0] = max(1.,(int(limits[0]-1.)/5)*5.)
     138    limits[1] = min(170.,(int(limits[1]+1.)/5)*5.)
     139    return Comments,Peaks,limits,wave
    131140
    132141def CheckImageFile(G2frame,imagefile):
Note: See TracChangeset for help on using the changeset viewer.