@@ -22,13 +22,11 @@ def __init__(self):
2222 def ContentsValidator (self , filename ):
2323 '''no test used at this time
2424 '''
25- print ('CBF ContentsValidator' )
2625 return True
2726
2827 def Reader (self ,filename , ParentFrame = None , ** unused ):
2928 '''Read using Bob's routine :func:`GetCbfData`
3029 '''
31- print ('CBF Reader' )
3230 self .Comments ,self .Data ,self .Npix ,self .Image = GetCbfData (self ,filename )
3331 if self .Npix == 0 or not self .Comments :
3432 return False
@@ -38,7 +36,6 @@ def Reader(self,filename, ParentFrame=None, **unused):
3836def GetCbfData (self ,filename ):
3937 'Read cif binary detector data cbf file'
4038
41- print ('CBF GetCbfData' ,filename )
4239 if GSASIIpath .binaryPath :
4340 import unpack_cbf as cbf
4441 else :
@@ -55,12 +52,10 @@ def GetCbfData(self,filename):
5552 byteOrd = '<'
5653 stream = File .read ()
5754 if 'bytes' in str (type (stream )):
58- print ('decoding: ' + filename )
5955 stream = stream .decode ('latin-1' )
6056 starter = '\x0c \x1a \x04 \xd5 '
6157 imageBeg = stream .find (starter )+ 4
6258 head = stream [:imageBeg ]
63- print ('\\ r\\ n in head' ,'\r \n ' in head , 'size' ,imageBeg )
6459 term = '\r \n ' #CR-LF
6560 if term in head :
6661 pass
@@ -91,9 +86,8 @@ def GetCbfData(self,filename):
9186 elif 'Detector_2theta' in line :
9287 det2theta = float (fields [2 ])
9388 if compImageSize is None :
94- print ('CBF failed to read header' )
95- print (head )
96- return
89+ print ('CBF error failed to read header' )
90+ return False
9791
9892 nxy = sizexy [0 ]* sizexy [1 ]
9993 cent = [cent [0 ]* pixSize [0 ]/ 1000. ,cent [1 ]* pixSize [1 ]/ 1000. ]
0 commit comments