@on_the_fly_hdf5
    def get_quantities(self, iteration=-1):
        '''
        Retrieve one of the physical grids for the model

        Parameters
        ----------
        iteration : integer, optional
            The iteration to retrieve the quantities for. The default is to return the grid for the last iteration.

        Returns
        -------
        grid : Grid instance
            An object containing information about the geometry and quantities
        '''

        from .helpers import find_last_iteration

        if 'Input' in self.file:
            if self.file['Input'].file != self.file.file:
                # Workaround for h5py bug - can't access link directly,
                # need to use file attribute
                g_grid = self.file['Input'].file[self.file['Input'].name]['Grid']
            else:
                g_grid = self.file['Input/Grid']
        else:
            g_grid = self.file['Grid']

        # Find coordinate grid type
        coord_type = g_grid['Geometry'].attrs['grid_type'].decode('utf-8')

        if coord_type == 'car':
            g = CartesianGrid()
        elif coord_type == 'cyl_pol':
            g = CylindricalPolarGrid()
        elif coord_type == 'sph_pol':
            g = SphericalPolarGrid()
        elif coord_type == 'amr':
            g = AMRGrid()
        elif coord_type == 'oct':
            g = OctreeGrid()
        elif coord_type == 'vor':
            g = VoronoiGrid()
        else:
            raise ValueError("Unknown grid type: {0}".format(coord_type))

        # Read in geometry and input quantities
        g.read_geometry(g_grid['Geometry'])

        # If iteration is last one, find iteration number
        if iteration == -1:
            iteration = find_last_iteration(self.file)
        else:
            iteration = iteration + 1  # Python value is zero based

        # Read in quantities from the requested iteration (if available)
        if iteration > 0:
            g.read_quantities(self.file['iteration_%05i' % iteration])

        if not 'density' in g:
            logger.info("No density present in output, reading initial density")
            g.read_quantities(g_grid['Quantities'], quantities=['density'])

        # Compute the temperature as a derived quantity
        if 'specific_energy' in g:

            # Open the dust group
            n_dust = g.n_dust
            g_dust = self.file['Input/Dust']

            # Compile a list of specific energy to temperature functions
            convert_func = []
            for i in range(n_dust):

                # Read in dust type
                dust = g_dust['dust_%03i' % (i + 1)]
                d = SphericalDust(dust)

                # Add to conversion function list
                convert_func.append(d.specific_energy2temperature)

            # Define function to convert different specific energy to
            # temperature for different dust types
            def specific_energy2temperature(quantities):
                quantities['temperature'] = []
                for i in range(n_dust):
                    quantities['temperature'].append(convert_func[i](quantities['specific_energy'][i]))

            # Get the grid to add the quantity
            g.add_derived_quantity('temperature', specific_energy2temperature)

        return g
dataset/ETHPy150Open hyperion-rt/hyperion/hyperion/model/model_output.py/ModelOutput.get_quantities/original