def METHOD_NAME(d_min=3):
  #
  # Make cubic box and compute spherical map (mask) of radius R in its center
  #
  sc=3
  cs = crystal.symmetry((20.0*sc , 24.0*sc, 32.0*sc, 90,90,90), "P1")
  uc = cs.unit_cell()
  a,b,c = uc.parameters()[:3]
  x,y,z = 11.0, 13.0, 15.0
  #with open("one.pdb","w") as fo:
  #  fo.write(iotbx.pdb.format_cryst1_record(crystal_symmetry = cs))
  #  fo.write(pdb_str%(x,y,z))
  R = 3
  N = [int(a/0.6),int(b/0.6),int(c/0.6)]
  mask = make_map(N=N, x=x,y=y,z=z, a=a,b=b,c=c, R=R)
  #write_ccp4_map(cs=cs, file_name="mask.map", map_data=mask)
  #
  # Make complete set of indices hkl up to specified resolution
  #
  ms = miller.build_set(crystal_symmetry = cs, anomalous_flag = False, d_min=d_min)
  #
  # Compute structure factors using mask_FT_05.docx
  #
  #f3 = sf_direct(miller_array=f1, mask=mask)
  t0 = time.time()
  o3 = maptbx.loft(
    miller_indices = ms.indices(),
    map_data       = mask,
    abc            = flex.double([a,b,c]),
    d_min          = d_min)
  t3 = time.time()-t0
  print("time f3:", t3)
  ms = miller.set(crystal_symmetry=cs, indices=o3.indices())
  f3 = ms.array(data = o3.structure_factors())
  del ms
  #
  # Compute structure factors using FT from CCTBX
  #
  t0 = time.time()
  f1 = f3.structure_factors_from_map(map=mask, use_scale=True)
  t1 = time.time()-t0
  print("time f1:", t1)
  #
  # Compute structure factors using exact formula
  #
  t0 = time.time()
  f2 = sf_analytical(miller_array=f1, x=x,y=y,z=z, R=R)
  t2 = time.time()-t0
  print("time f2:", t2)
  #
  # Write mask structure factors as MTZ
  #
  mtz_dataset = f1.as_mtz_dataset(column_root_label = "f1")
  mtz_dataset.add_miller_array(
    miller_array      = f2,
    column_root_label = "f2")
  mtz_object = mtz_dataset.mtz_object()
  mtz_object.write(file_name = "maps.mtz")
  #
  # Check all three Fmask structure factors are the same
  #
  cc12 = f1.map_correlation(other=f2)
  cc13 = f1.map_correlation(other=f3)
  cc23 = f2.map_correlation(other=f3)
  print()
  print("t1/t3: ", t1/t3)
  print()
  print("Map CC:", cc12)
  print("Map CC:", cc13)
  print("Map CC:", cc23)
  #
  #print("t2/t3: ", t2/t3)
  print("R-factor:", rfactor(f1,f2))
  print("R-factor:", rfactor(f1,f3))
  print("R-factor:", rfactor(f2,f3))
  #
  assert cc12 > 0.99
  assert cc13 > 0.99
  assert cc23 > 0.99