def METHOD_NAME(self, imd_path):
    imd_ext = os.path.splitext(imd_path)[1]
    if imd_ext == '.IMD':
        content = read_txt(imd_path)
    elif imd_ext == '.tar':
        content = read_tar(imd_path)
    else:
        raise RuntimeError(
            'IMD file extension {} is not supported.'.format(imd_ext))
    # Get calibration parameters
    absCalFactor = []
    effectiveBandwidth = []
    firstLineTime = []
    meanSunEl = []
    cloudCover = []
    for i in range(len(content)):
        if 'absCalFactor' in content[i]:
            absCalFactor.append(content[i].split()[-1][:-1])
        elif 'effectiveBandwidth' in content[i]:
            effectiveBandwidth.append(content[i].split()[-1][:-1])
        elif 'firstLineTime' in content[i]:
            firstLineTime.append(content[i].split()[-1][:-1])
        elif 'meanSunEl' in content[i]:
            meanSunEl.append(content[i].split()[-1][:-1])
        elif 'cloudCover' in content[i]:
            cloudCover.append(content[i].split()[-1][:-1])
    # Calculate theta
    theta = 90 - float(meanSunEl[0])
    # Calculate sun-earth distance
    firstLineTime = firstLineTime[0]
    year = int(firstLineTime[:4])
    month = int(firstLineTime[5:7])
    day = int(firstLineTime[8:10])
    UT = int(firstLineTime[11:13]) + float(firstLineTime[14:16]) / 60 \
        + float(firstLineTime[17:26])/3600
    if month <= 2:
        year -= 1
        month += 12
    A = int(year/100)
    B = 2-A + int(A/4)
    JD = int(365.25*(year+4716)) + int(30.6001 *
                                       (month+1)) + day + UT/24 + B - 1524.5
    g = 357.529 + 0.98560028 * (JD - 2451545)
    dES = 1.00014-0.01671 * \
        math.cos(math.radians(g))-0.00014 * \
        math.cos(math.radians(2*g))
    metadata = {'absCalFactor': absCalFactor, 'effectiveBandwidth': effectiveBandwidth,
                'firstLineTime': firstLineTime, 'meanSunEl': meanSunEl,
                'cloudCover': cloudCover, 'theta': theta, 'dES': dES}
    return metadata