def real_space_pixel_scales_tag_from_real_space_pixel_scales(
    real_space_pixel_scales):
    """Generate a sub-grid tag, to customize phase names based on the sub-grid size used.

    This changes the phase name 'phase_name' as follows:

    real_space_pixel_scales = None -> phase_name
    real_space_pixel_scales = 1 -> phase_name_real_space_pixel_scales_2
    real_space_pixel_scales = 4 -> phase_name_real_space_pixel_scales_4
    """
    if real_space_pixel_scales is None:
        return ''
    y = '{0:.2f}'.format(real_space_pixel_scales[0])
    x = '{0:.2f}'.format(real_space_pixel_scales[1])
    return '__rs_pix_' + y + 'x' + x
