code: def designAARM(npos):
      #
      
      if npos != 9:
          print('Sorry - only 9 positions available')
          return
      Dec = [315., 225., 180., 135., 45., 90., 270.,
             270., 270., 90., 0., 0., 0., 180., 180.]
      Dip = [0., 0., 0., 0., 0., -45., -45., 0.,
             45., 45., 45., -45., -90., -45., 45.]
      index9 = [0, 1, 2, 5, 6, 7, 10, 11, 12]
      H = []
      for ind in range(15):
          Dir = [Dec[ind], Dip[ind], 1.]
          H.append(dir2cart(Dir))  # 15 field directionss
  #
  # make design matrix A
  #
      A = np.zeros((npos * 3, 6), 'f')
      tmpH = np.zeros((npos, 3), 'f')  # define tmpH
      if npos == 9:
          for i in range(9):
              k = index9[i]
              ind = i * 3
              A[ind][0] = H[k][0]
              A[ind][3] = H[k][1]
              A[ind][5] = H[k][2]
              ind = i * 3 + 1
              A[ind][3] = H[k][0]
              A[ind][1] = H[k][1]
              A[ind][4] = H[k][2]
              ind = i * 3 + 2
              A[ind][5] = H[k][0]
              A[ind][4] = H[k][1]
              A[ind][2] = H[k][2]
              for j in range(3):
                  tmpH[i][j] = H[k][j]
          At = np.transpose(A)
          ATA = np.dot(At, A)
          ATAI = linalg.inv(ATA)
          B = np.dot(ATAI, At)
      else:
          print("B matrix not yet supported")
          return
      return B, H, tmpH
docs: calculates B matrix for AARM calculations.