Changeset 3330 for trunk/GSASIIIO.py


Ignore:
Timestamp:
Mar 31, 2018 8:40:02 AM (4 years ago)
Author:
vondreele
Message:

modify Bruker image import to keep "TARGET" and use it in SaveIntegration? to put Ka1/Ka2 wavelengths into PWDR Instrument Parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r3319 r3330  
    688688def SaveIntegration(G2frame,PickId,data,Overwrite=False):
    689689    'Save image integration results as powder pattern(s)'
     690    waves = {'Cu':[1.54051,1.54433],'Ti':[2.74841,2.75207],'Cr':[2.28962,2.29351],
     691        'Fe':[1.93597,1.93991],'Co':[1.78892,1.79278],'Mo':[0.70926,0.713543],
     692        'Ag':[0.559363,0.563775]}
    690693    azms = G2frame.Integrate[1]
    691694    X = G2frame.Integrate[2][:-1]
     
    697700    Controls = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.root, 'Controls'))
    698701    if 'PWDR' in name:
    699         names = ['Type','Lam','Zero','Polariz.','U','V','W','X','Y','Z','SH/L','Azimuth']
    700         codes = [0 for i in range(12)]
     702        if 'target' in data:
     703            names = ['Type','Lam1','Lam2','I(L2)/I(L1)','Zero','Polariz.','U','V','W','X','Y','Z','SH/L','Azimuth']
     704            codes = [0 for i in range(14)]
     705        else:
     706            names = ['Type','Lam','Zero','Polariz.','U','V','W','X','Y','Z','SH/L','Azimuth']
     707            codes = [0 for i in range(12)]
    701708    elif 'SASD' in name:
    702709        names = ['Type','Lam','Zero','Azimuth']
     
    758765                        Controls['FreePrm'+num] = item.split('=')[1].strip()
    759766        if 'PWDR' in Aname:
    760             parms = ['PXC',data['wavelength'],0.0,polariz,1.0,-0.10,0.4,0.30,1.0,0.0,0.0001,Azms[i]]
     767            if 'target' in data:    #from lab x-ray 2D imaging data
     768                wave1,wave2 = waves[data['target']]
     769                parms = ['PXC',wave1,wave2,0.5,0.0,polariz,290.,-40.,30.,6.,-14.,0.0,0.0001,Azms[i]]
     770            else:
     771                parms = ['PXC',data['wavelength'],0.0,polariz,1.0,-0.10,0.4,0.30,1.0,0.0,0.0001,Azms[i]]
    761772        elif 'SASD' in Aname:
    762773            Sample['Trans'] = data['SampleAbs'][0]
Note: See TracChangeset for help on using the changeset viewer.