Changeset 3756
- Timestamp:
- Dec 6, 2018 3:05:22 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIstrIO.py
r3754 r3756 3099 3099 if 'X' in Inst['Type'][0]: 3100 3100 histDict[pfx+'Lam'] = Inst['Lam'][1] 3101 controlDict[pfx+'keV'] = 12.397639/histDict[pfx+'Lam'] 3101 controlDict[pfx+'keV'] = 12.397639/histDict[pfx+'Lam'] 3102 elif 'NC' in Inst['Type'][0]: 3103 histDict[pfx+'Lam'] = Inst['Lam'][1] 3102 3104 return histVary,histDict,controlDict 3103 3105 -
trunk/imports/G2sfact.py
r3254 r3756 566 566 return True 567 567 568 class ISIS_SXD_INT_ReaderClass(G2obj.ImportStructFactor):569 'Routines to import neutron TOF F**2, sig(F**2) reflections from a ISISint file'568 class NIST_hb3a_INT_ReaderClass(G2obj.ImportStructFactor): 569 'Routines to import neutron CW F**2, sig(F**2) reflections from a NIST hb3a int file' 570 570 def __init__(self): 571 571 if 'linux' in sys.platform: # wx 3.0.0.0 on gtk does not like Unicode in menus 572 formatName = u'Neutron ISIS SXD TOFHKL F2'573 longFormatName = u'Neutron ISIS SXD TOF [hkl, Fo2, sig(Fo2),...]Structure factor text file'574 else: 575 formatName = u'Neutron ISIS SXD TOFHKL F\u00b2'576 longFormatName = u'Neutron ISIS SXD TOF [hkl, Fo\u00b2, sig(Fo\u00b2),...]Structure factor text file'572 formatName = u'Neutron NIST hb3a CW HKL F2' 573 longFormatName = u'Neutron NIST hb3a CW HKL [hkl, Fo2, sig(Fo2),...] 5 column Structure factor text file' 574 else: 575 formatName = u'Neutron NIST hb3a CW HKL F\u00b2' 576 longFormatName = u'Neutron NIST hb3a CW HKL [hkl, Fo\u00b2, sig(Fo\u00b2),...] 5 column Structure factor text file' 577 577 super(self.__class__,self).__init__( # fancy way to self-reference 578 578 extensionlist=('.int','.INT'), … … 583 583 def ContentsValidator(self, filename): 584 584 'Make sure file contains the expected columns on numbers & count number of data blocks - "Banks"' 585 oldNo = -1586 585 fp = open(filename,'r') 587 586 for line,S in enumerate(fp): … … 589 588 break 590 589 if S[0] == '#': continue #ignore comments, if any 591 if S[0] == '(': continue #ignore format line592 bankNo = S.split()[5]593 if bankNo != oldNo:594 self.Banks.append({'RefDict':{'RefList':[],}})595 oldNo = bankNo596 590 fp.seek(0) 597 valid = ColumnValidator(self, fp,nCol= 8)591 valid = ColumnValidator(self, fp,nCol=5) 598 592 fp.close() 599 593 return valid … … 605 599 self.errors = ' Error reading line '+str(line+1) 606 600 if S[0] == '#': continue #ignore comments, if any 607 if S[0] == '(': continue #ignore the format line608 601 data = S.split() 609 h,k,l,Fo,sigFo ,bN,wave,x,x,tbar = data[:10]602 h,k,l,Fo,sigFo = data 610 603 h,k,l = [int(h),int(k),int(l)] 611 604 if not any([h,k,l]): … … 613 606 Fo = float(Fo) 614 607 sigFo = float(sigFo) 615 wave = float(wave)616 tbar = float(tbar)617 if len(self.Banks):618 self.Banks[int(bN)-1]['RefDict']['RefList'].append([h,k,l,1,0,Fo,sigFo,0,Fo,0,0,0,wave,tbar])619 else:620 608 # h,k,l,m,dsp,Fo2,sig,Fc2,Fot2,Fct2,phase,... 621 self.RefDict['RefList'].append([h,k,l,1,0,Fo,sigFo,0,Fo,0,0,0,wave,tbar]) 622 fp.close() 623 if len(self.Banks): 624 self.UpdateParameters(Type='SNT',Wave=None) # histogram type 625 for Bank in self.Banks: 626 Bank['RefDict']['RefList'] = np.array(Bank['RefDict']['RefList']) 627 Bank['RefDict']['Type'] = 'SNT' 628 Bank['RefDict']['Super'] = 0 629 else: 630 self.RefDict['RefList'] = np.array(self.RefDict['RefList']) 631 self.RefDict['Type'] = 'SNT' 632 self.RefDict['Super'] = 0 633 self.errors = 'Error after reading reflections (unexpected!)' 634 self.UpdateParameters(Type='SNT',Wave=None) # histogram type 635 return True 636 609 self.RefDict['RefList'].append([h,k,l,1,0,Fo,sigFo,0,Fo,0,0,0]) 610 fp.close() 611 self.RefDict['RefList'] = np.array(self.RefDict['RefList']) 612 self.RefDict['Type'] = 'SNC' 613 self.RefDict['Super'] = 0 614 self.errors = 'Error after reading reflections (unexpected!)' 615 self.UpdateParameters(Type='SNC',Wave=None) # histogram type 616 return True
Note: See TracChangeset
for help on using the changeset viewer.