Changeset 2354


Ignore:
Timestamp:
Jun 29, 2016 6:17:47 PM (7 years ago)
Author:
toby
Message:

fix export of TOF powder data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/exports/G2export_CIF.py

    r2143 r2354  
    331331            elif 'T' in inst['Type'][0]:    #to be tested after TOF Rietveld done
    332332                s = 'Von Dreele-Jorgenson-Windsor function parameters\n'+ \
    333                     '   alpha, beta-0, beta-1, beta-q, sig-0, sig-1, sig-q, X, Y:\n    '
    334                 for item in ['alpha','bet-0','bet-1','bet-q','sig-0','sig-1','sig-q','X','Y']:
     333                    '   alpha, beta-0, beta-1, beta-q, sig-0, sig-1, sig-2, sig-q, X, Y:\n    '
     334                for item in ['alpha','beta-0','beta-1','beta-q','sig-0','sig-1','sig-2','sig-q','X','Y']:
    335335                    name = hfx+item
    336336                    sig = self.sigDict.get(name,-0.009)
     
    929929                             PutInCol(G2mth.ValEsd(ratio,sratio),15)+
    930930                             PutInCol('2',5))               
    931             else:
     931            elif 'Lam' in inst:
    932932                lam1 = self.parmDict.get('Lam',inst['Lam'][1])
    933933                slam1 = self.sigDict.get('Lam',-0.00009)
     
    10001000            elif histblk['Instrument Parameters'][0]['Type'][1][1] == 'N':
    10011001                WriteCIFitem('_diffrn_radiation_probe','neutron')
    1002             # TOF (note that this may not be defined)
    1003             #if histblk['Instrument Parameters'][0]['Type'][1][2] == 'T':
    1004             #    WriteCIFitem('_pd_meas_2theta_fixed',text)
    1005            
     1002            if 'T' in inst['Type'][0]:
     1003                txt = G2mth.ValEsd(inst['2-theta'][0],-0.009)
     1004                WriteCIFitem('_pd_meas_2theta_fixed',txt)
    10061005
    10071006            # TODO: this will need help from Bob
     
    11201119                fixedstep = True
    11211120
    1122             if fixedstep: # and not TOF
     1121            zero = None
     1122            if fixedstep and 'T' not in inst['Type'][0]: # and not TOF
    11231123                WriteCIFitem('_pd_meas_2theta_range_min', G2mth.ValEsd(histblk['Data'][0][0],-0.00009))
    11241124                WriteCIFitem('_pd_meas_2theta_range_max', G2mth.ValEsd(histblk['Data'][0][-1],-0.00009))
    11251125                WriteCIFitem('_pd_meas_2theta_range_inc', G2mth.ValEsd(steps.sum()/len(steps),-0.00009))
    11261126                # zero correct, if defined
    1127                 zero = None
    11281127                zerolst = histblk['Instrument Parameters'][0].get('Zero')
    11291128                if zerolst: zero = zerolst[1]
     
    11431142                if zero:
    11441143                    WriteCIFitem('   _pd_proc_2theta_corrected')
     1144                elif 'T' in inst['Type'][0]: # and not TOF
     1145                    WriteCIFitem('   _pd_meas_time_of_flight')
    11451146                else:
    11461147                    WriteCIFitem('   _pd_meas_2theta_scan')
     
    11761177                    if fixedstep:
    11771178                        s = ""
     1179                    elif zero:
     1180                        s = PutInCol(G2mth.ValEsd(x-zero,-0.00009),10)
    11781181                    else:
    1179                         s = PutInCol(G2mth.ValEsd(x-zero,-0.00009),10)
     1182                        s = PutInCol(G2mth.ValEsd(x,-0.00009),10)
    11801183                    s += PutInCol(Yfmt(ndec,yobs),12)
    11811184                    s += PutInCol(Yfmt(ndec,ycalc),12)
Note: See TracChangeset for help on using the changeset viewer.