def isProduct(filename):
    """Return True if 'filename' is a "product" name.

    Parameters
    ----------
    filename: str
        Name of an output file.

    Returns
    -------
    is_product: boolean
        True if the root part (before the suffix) of 'filename' ends in '0',
        implying that it is a product name.
    """
    is_product = False
    i = filename.rfind('_')
    if i > 0 and filename[i:] == '_a.fits' or filename[i:] == '_b.fits':
        i = filename[0:i - 1].rfind('_')
    if i > 0 and filename[i - 1] == '0':
        is_product = True
    return is_product
