def METHOD_NAME(xrs, d_min):
  crystal_gridding = maptbx.crystal_gridding(
    unit_cell          = xrs.unit_cell(),
    d_min              = d_min,
    resolution_factor  = 1./4,
    symmetry_flags     = maptbx.use_space_group_symmetry,
    space_group_info   = xrs.space_group_info())
  mp = mmtbx.masks.mask_master_params.extract()
  return mmtbx.masks.mask_from_xray_structure(
    xray_structure           = xrs,
    p1                       = True,
    solvent_radius           = mp.solvent_radius,
    shrink_truncation_radius = mp.shrink_truncation_radius,
    for_structure_factors    = True,
    n_real                   = crystal_gridding.n_real()).mask_data