def create_field_ratemap(ratemap, field_idx):
    """Returns a copy of input `ratemap`, where fields not True in `field_idx` are set to `0`.

    :param numpy.ndarray ratemap: shape (n_ybins, n_xbins)
    :param numpy.ndarray field_idx: boolean array same shape as ratemap, specifying which elements
        belong to the field.
    :return: field_ratemap
    :rtype: numpy.ndarray
    """
    field_ratemap = ratemap.copy()
    field_ratemap[~field_idx] = 0

    return field_ratemap