import logging


def download_exps_file(dfu, exps_fp, exps_ref):
    """We download an experiments file

    Args:
        dfu: DataFileUtil class object
        exps_fp: (str) Path to download exps file to
        exps_ref: (str) Reference to file
    """

    GetObjectsParams = {
            'object_refs': [exps_ref]
    }

    # We get the handle id
    expsFileObjectData = dfu.get_objects(GetObjectsParams)['data'][0]['data']
    logging.info("DFU Experiment File Get objects results:")
    logging.info(expsFileObjectData)

    expsfile_handle = expsFileObjectData['expsfile']


    # Set params for shock to file
    ShockToFileParams = {
            "handle_id": expsfile_handle,
            "file_path": exps_fp,
            "unpack": "uncompress"
            }
    ShockToFileOutput = dfu.shock_to_file(ShockToFileParams)
    logging.info(ShockToFileOutput)
    exps_fp = ShockToFileOutput['file_path']
    # expsfile is at location "expsfile_path"

    return exps_fp