def get_hijitreg_translations(flat):
    """
    Parse a flatfile created by the ISIS program hijitreg and return a list of the average sample and line translations,
    rounded to the nearest int.


    Parameters
    ----------
    flat : str
           path to a flatfile (text file) created by the ISIS program hijitreg

    Returns
    -------
    st,lt : list
          List of integers representing the average sample,line offsets from input file, rounded to nearest int.

    """
    st = lt = None
    # Get average sample and line translations, rounded to nearest int
    with open(flat, 'r') as f:
        for line in f.readlines():
            if "Average Sample Offset" in line:
                st = round(float(line.split()[4]))
            elif "Average Line Offset" in line:
                lt = round(float(line.split()[4]))
            # Break out of the FOR loop as soon as both offsets are found
            if (st and lt):
                break
    return st,lt