def add_hdf_dataset(self, name, nparray):
        # Return Value
        # ------------
        # {success: true}
        #

        # Using inline imports to put off making hdf/numpy required dependencies
        import numpy


        #try:
        assert isinstance(nparray, numpy.ndarray), '2nd argument of method add_hdf_dataset() is not a numpy array!'
        # check that that the input arguments are of the type they are supposed to be
        assert isinstance(name, basestring), '1st argument of method add_hdf_dataset() is not a string!'
        #except AssertionError as err:
        #    log.debug('Name and array assertion failed in add_hdf_dataset method.')
        #    raise HDFEncoderException(err.message)
        lowest_subgroup, name_of_dataset = self.create_group_tree(name)

        #try:
        assert lowest_subgroup, 'No datagroup.'
        assert name_of_dataset, 'No dataset name. provided.'

        assert lowest_subgroup.get(name_of_dataset) is None, 'The dataset %s already exists in the file.' % name_of_dataset

        # create a dataset and hang it under the just created group...
        shape = nparray.shape
        dataset = lowest_subgroup.create_dataset(name_of_dataset,
            shape,
            nparray.dtype.str,
            compression='gzip',
            compression_opts=4,
            maxshape=([None for rank in range(len(shape))])
            )

        assert dataset, 'Unable to create dataset.'
        # write the array in the dataset
        dataset.write_direct(nparray)
        #except AssertionError as err:
        #    log.debug(err.message)
        #    raise HDFEncoderException(err.message)
        #except Exception as exc:
        #    log.debug('Error writing dataset to HDFFile during encoding.')
        #    raise HDFEncoderException(exc.message)

        return True
Add a numpy array to the hdf file that is temporarily used to store the data.
dataset/ETHPy150Open ooici/pyon/prototype/hdf/hdf_codec.py/HDFEncoder.add_hdf_dataset