Changeset 4522
- Timestamp:
- Jul 16, 2020 9:30:05 AM (3 years ago)
- Location:
- trunk/exports
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/exports/G2export_csv.py
r4190 r4522 338 338 for i,phasenam in enumerate(sorted(histblk['Reflection Lists'])): 339 339 phasDict = histblk['Reflection Lists'][phasenam] 340 tname = {'T':'TOF','C':'2-theta' }[phasDict['Type'][2]]340 tname = {'T':'TOF','C':'2-theta','B':'2-theta'}[phasDict['Type'][2]] 341 341 if phasDict.get('Super',False): 342 342 WriteList(self,("h","k","l","m","d-sp",tname,"F_obs","F_calc","phase","mult","sig","gam","FWHM","Prfo","phase #")) … … 351 351 FWHM = G2pwd.getgamFW(gam,sig) 352 352 self.Write(fmt.format(h,k,l,m,dsp,pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,i)) 353 el se: #convert to deg353 elif 'C' in phasDict['Type']: #convert to deg 354 354 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,Prfo = refItem[:14] 355 s = np.sqrt(max(sig,0.0001))/100. #var -> sig in deg 356 g = gam/100. #-> deg 357 FWHM = G2pwd.getgamFW(g,s) 358 self.Write(fmt.format(h,k,l,m,dsp,pos,Fobs,Fcalc,phase,mult,s,g,FWHM,i)) 359 elif 'B' in phasDict['Type']: #convert to deg 360 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,x,x,x,Prfo = refItem[:17] 355 361 s = np.sqrt(max(sig,0.0001))/100. #var -> sig in deg 356 362 g = gam/100. #-> deg … … 369 375 FWHM = G2pwd.getgamFW(gam,sig) 370 376 self.Write(fmt.format(h,k,l,dsp,pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,Prfo,i)) 371 el se: #convert to deg377 elif 'C' in phasDict['Type']: #convert to deg 372 378 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,Prfo = refItem[:13] 379 g = gam/100. 380 s = np.sqrt(max(sig,0.0001))/100. 381 FWHM = G2pwd.getgamFW(g,s) 382 self.Write(fmt.format(h,k,l,dsp,pos,Fobs,Fcalc,phase,mult,s,g,FWHM,Prfo,i)) 383 elif 'B' in phasDict['Type']: #convert to deg 384 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,Icorr,x,x,x,Prfo = refItem[:16] 373 385 g = gam/100. 374 386 s = np.sqrt(max(sig,0.0001))/100. -
trunk/exports/G2export_examples.py
r3990 r4522 199 199 for phasenam in histblk['Reflection Lists']: 200 200 phasDict = histblk['Reflection Lists'][phasenam] 201 tname = {'T':'TOF','C':'2-theta' }[phasDict['Type'][2]]201 tname = {'T':'TOF','C':'2-theta','B':'2-theta'}[phasDict['Type'][2]] 202 202 self.Write('\nPhase '+str(phasenam)) 203 203 if phasDict.get('Super',False): … … 217 217 FWHM = G2pwd.getgamFW(gam,sig) 218 218 self.Write(fmt.format(hklfmt.format(h,k,l,m),pos,Fobs,Fcalc,phase,mult,sig,gam,FWHM,prfo)) 219 el se:219 elif 'C' in phasDict['Type']: 220 220 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,x,prfo = refItem[:14] 221 g = gam/100. #centideg -> deg 222 s = np.sqrt(max(sig,0.0001))/100. #var -> sig in deg 223 FWHM = G2pwd.getgamFW(g,s) #FWHM 224 self.Write(fmt.format(hklfmt.format(h,k,l,m),pos,Fobs,Fcalc,phase,mult,s,g,FWHM,prfo)) 225 elif 'B' in phasDict['Type']: 226 h,k,l,m,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,x,x,x,x,prfo = refItem[:17] 221 227 g = gam/100. #centideg -> deg 222 228 s = np.sqrt(max(sig,0.0001))/100. #var -> sig in deg … … 239 245 FWHM = G2pwd.getgamFW(gam,sig) 240 246 self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult,np.sqrt(max(sig,0.0001)),gam,FWHM,prfo)) 241 el se:247 elif 'C' in phasDict['Type']: 242 248 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,x,prfo = refItem[:13] 249 g = gam/100. #centideg -> deg 250 s = np.sqrt(max(sig,0.0001))/100. #var -> sig in deg 251 FWHM = G2pwd.getgamFW(g,s) 252 self.Write(fmt.format(hklfmt.format(h,k,l),pos,Fobs,Fcalc,phase,mult, \ 253 s,g,FWHM,prfo)) 254 elif 'B' in phasDict['Type']: 255 h,k,l,mult,dsp,pos,sig,gam,Fobs,Fcalc,phase,x,x,x,x,prfo = refItem[:16] 243 256 g = gam/100. #centideg -> deg 244 257 s = np.sqrt(max(sig,0.0001))/100. #var -> sig in deg -
trunk/exports/G2export_pwdr.py
r4072 r4522 42 42 '''Write an instrument parameter file 43 43 ''' 44 if 'T' in Inst['Type'][0] : #can't do TOFiparm files44 if 'T' in Inst['Type'][0] or 'B' in Inst['Type'][0]: #can't do TOF or pink iparm files 45 45 return None 46 46 prmname = os.path.splitext(self.filename)[0] + '.prm' … … 73 73 if prmname: self.Write('Instrument parameter file:'+os.path.split(prmname)[1]) 74 74 x = np.array(histblk['Data'][0]) 75 if 'C' in histblk['Instrument Parameters'][0]['Type'][0]: 76 x *= 100. 77 else: 75 if 'T' in histblk['Instrument Parameters'][0]['Type'][0]: 78 76 cw = np.diff(x) 79 77 x[:-1] += cw 78 else: 79 x *= 100. 80 80 # convert weights to sigmas; use largest weight as minimum esd 81 81 s = np.sqrt(np.maximum(0.,np.array(histblk['Data'][2])))
Note: See TracChangeset
for help on using the changeset viewer.