import pickle


def read_gridded_predictions(pickle_file_name):
    """Reads gridded predictions from Pickle file.

    :param pickle_file_name: Path to input file.
    :return: prediction_dict: Dictionary with the following keys.
    prediction_dict['class_probability_matrix']: See doc for
        `write_gridded_predictions`.
    prediction_dict['target_times_unix_sec']: Same.
    prediction_dict['target_matrix']: Same.
    prediction_dict['model_file_name']: Same.
    prediction_dict['used_isotonic_regression']: Same.
    """

    pickle_file_handle = open(pickle_file_name, 'rb')
    prediction_dict = pickle.load(pickle_file_handle)
    pickle_file_handle.close()

    return prediction_dict