def acquire_data( hdf_files = None, var_names=None, concatenate_size = None, bounds = None):


    import h5py, numpy

    if hdf_files is None:
        raise NotFound('No open_hdf_files provided to extract data from.')
    if var_names is None:
        raise NotFound('Variable names where not provided.')
    if concatenate_size is None:
        raise NotFound('The concatenation size was not provided')

    open_files = []

    try:
        for hdf_file in hdf_files:
            #-------------------------------------------------------------------------------------------------------
            # make a file object
            #-------------------------------------------------------------------------------------------------------
            try:
                file = h5py.File(hdf_file,'r')
            except __HOLE__ as ioe:
                log.exception('Unable to open file: "%s"', hdf_file)

                # Try again?
                try:
                    file = h5py.File(hdf_file,'r')

                except:
                    log.exception('Still Unable to open file: "%s" !', hdf_file)

                    # If we are only opening one file - we must fail - but otherwise for now, just let it go!
                    if len(hdf_files) == 1:
                        raise ioe



            open_files.append(file)

        gen = _acquire_hdf_data(open_hdf_files=open_files, var_names=var_names, concatenate_size=concatenate_size, bounds=bounds)

        # run the generator yielding to the caller
        for item in gen:
            yield item

    finally:
        # always clean up!
        for file in open_files:
            file.close()
dataset/ETHPy150Open ooici/pyon/prototype/hdf/hdf_array_iterator.py/acquire_data