def get_up_down_filter(filters, field, direction):
    """ This function returns the appropriate mask to filter on the given field
        in the given direction. It assumes the filters are in the same order as
        the output of get_up_and_down_masks.

        Parameters
        ----------
            filters : tuple
                The result of the call to get_up_and_down_masks

            field : string
                The name of the field on which to filter. Valid options are:
                    * ribo
                    * rna
                    * te

            direction : string
                The direction in which to filter. Valid options are:
                    * up
                    * down

        Returns
        -------
            significance_mask : boolean mask
                The appropriate mask for filtering for significance based on the
                given field.
    """

    # just map from the field to the index of the significant filters
    field_map = {
        "te": 0,
        "rna": 2,
        "ribo": 4
    }

    direction_map = {
        "up": 0,
        "down": 1
    }

    index = field_map[field] + direction_map[direction]

    return filters[index]