@staticmethod
def _map_gen_gids(res_gids, gen_index):
    """
        Map resource gids from techmap to gen gids in .h5 source file

        Parameters
        ----------
        res_gids : ndarray
            resource gids from techmap
        gen_index : ndarray
            Equivalent gen gids to resource gids

        Returns
        -------
        gen_gids : ndarray
            gen gid to excl mapping
        res_gids : ndarray
            updated resource gid to excl mapping
        """
    mask = (res_gids >= len(gen_index)) | (res_gids == -1)
    res_gids[mask] = -1
    gen_gids = gen_index[res_gids]
    gen_gids[mask] = -1
    res_gids[gen_gids == -1] = -1
    return gen_gids, res_gids
