def hydro_cell_lookup(cell_id, df_ref):
    """Get max row of a particular grid cell to reduce row count for performance

    :param cell_id:                 ID of cell
    :type cell_id:                  int

    :param df_ref:                  Reference dataframe
    :type df_ref:                   dataframe

    :return:                        int; Max row of cell in file data

    """

    # get which grid cells are associated with the target basin
    target_idx_list = df_ref[df_ref['grid_id'] == cell_id].copy()
    return max(target_idx_list['grid_id'])