parameters: (fullfilename)
return_statement: return UB, lattice
docstring: %getISAWub reads UB determined by ISAW and stored in file "fname"
      %   Detailed explanation goes here
  
  
      % [filename pathname ~] = ...
      %     uigetfile('*.dat','Choose UB file (generated by ISAW)');
      % fullfilename = [pathname filename];
docstring_summary: %getISAWub reads UB determined by ISAW and stored in file "fname"
      %   Detailed explanation goes here
docstring_tokens: %getISAWub reads UB determined by ISAW and stored in file fname % Detailed explanation goes here
function: def getISAWub(fullfilename):
      '''
      %getISAWub reads UB determined by ISAW and stored in file "fname"
      %   Detailed explanation goes here
  
  
      % [filename pathname ~] = ...
      %     uigetfile('*.dat','Choose UB file (generated by ISAW)');
      % fullfilename = [pathname filename];
      '''
      fileID = fullfilename
      if fileID == 1:
          print(('Error opening file: ' + fullfilename))
      f = open(fileID, "r")
      lines = f.readlines()
      f.close()
  
      # Build UB matrix and lattice
      UB = np.zeros(shape=(3, 3))
      lattice = np.zeros(shape=(2, 6))
      for i in range(3):
          UB[i][0], UB[i][1], UB[i][2] = lines[i].split()
      UB = UB.transpose()
      for i in range(3, 5):
          lattice[i - 3][0], lattice[i - 3][1], \
              lattice[i - 3][2], lattice[i - 3][3], \
              lattice[i - 3][4], lattice[i - 3][5], \
              non = lines[i].split()
  
      print('Successfully got UB and lattice')
  
      return UB, lattice
function_tokens: def getISAWub ( fullfilename ) : fileID = fullfilename if fileID == 1 : print ( ( 'Error opening file: ' + fullfilename ) ) f = open ( fileID , "r" ) lines = f . readlines ( ) f . close ( ) # Build UB matrix and lattice UB = np . zeros ( shape = ( 3 , 3 ) ) lattice = np . zeros ( shape = ( 2 , 6 ) ) for i in range ( 3 ) : UB [ i ] [ 0 ] , UB [ i ] [ 1 ] , UB [ i ] [ 2 ] = lines [ i ] . split ( ) UB = UB . transpose ( ) for i in range ( 3 , 5 ) : lattice [ i - 3 ] [ 0 ] , lattice [ i - 3 ] [ 1 ] , lattice [ i - 3 ] [ 2 ] , lattice [ i - 3 ] [ 3 ] , lattice [ i - 3 ] [ 4 ] , lattice [ i - 3 ] [ 5 ] , non = lines [ i ] . split ( ) print ( 'Successfully got UB and lattice' ) return UB , lattice