def _read_coord_h5(files, shapes, header, twod):
meshes = []<EOL>for h5file, shape in zip(files, shapes):<EOL><INDENT>meshes.append({})<EOL>with h5py.File(h5file, '<STR_LIT:r>') as h5f:<EOL><INDENT>for coord, mesh in h5f.items():<EOL><INDENT>meshes[-<NUM_LIT:1>][coord] = mesh[()].reshape(shape).T<EOL>meshes[-<NUM_LIT:1>][coord] = _make_3d(meshes[-<NUM_LIT:1>][coord], twod)<EOL><DEDENT><DEDENT><DEDENT>header['<STR_LIT>'] = _ncores(meshes, twod)<EOL>header['<STR_LIT>'] = list((meshes[<NUM_LIT:0>]['<STR_LIT:X>'].shape[i] - <NUM_LIT:1>) * header['<STR_LIT>'][i]<EOL>for i in range(<NUM_LIT:3>))<EOL>header['<STR_LIT>'] = np.array([max(<NUM_LIT:1>, val) for val in header['<STR_LIT>']])<EOL>meshes = _conglomerate_meshes(meshes, header)<EOL>if np.any(meshes['<STR_LIT>'][:, :, <NUM_LIT:0>] != <NUM_LIT:0>):<EOL><INDENT>header['<STR_LIT>'] = np.copy(meshes['<STR_LIT:Y>'])  <EOL>header['<STR_LIT>'] = np.copy(meshes['<STR_LIT>'])<EOL>header['<STR_LIT>'] = np.copy(meshes['<STR_LIT:X>'])<EOL>header['<STR_LIT>'] = np.sqrt(header['<STR_LIT>']**<NUM_LIT:2> + header['<STR_LIT>']**<NUM_LIT:2> +<EOL>header['<STR_LIT>']**<NUM_LIT:2>)<EOL>header['<STR_LIT>'] = np.arccos(header['<STR_LIT>'] / header['<STR_LIT>'])<EOL>header['<STR_LIT>'] = np.roll(<EOL>np.arctan2(header['<STR_LIT>'], -header['<STR_LIT>']) + np.pi, -<NUM_LIT:1>, <NUM_LIT:1>)<EOL>header['<STR_LIT>'] = header['<STR_LIT>'][:, <NUM_LIT:0>, <NUM_LIT:0>]<EOL>header['<STR_LIT>'] = header['<STR_LIT>'][<NUM_LIT:0>, :, <NUM_LIT:0>]<EOL>header['<STR_LIT>'] = header['<STR_LIT>'][<NUM_LIT:0>, <NUM_LIT:0>, :]<EOL><DEDENT>else:<EOL><INDENT>header['<STR_LIT>'] = meshes['<STR_LIT:X>'][:, <NUM_LIT:0>, <NUM_LIT:0>]<EOL>header['<STR_LIT>'] = meshes['<STR_LIT:Y>'][<NUM_LIT:0>, :, <NUM_LIT:0>]<EOL>header['<STR_LIT>'] = meshes['<STR_LIT>'][<NUM_LIT:0>, <NUM_LIT:0>, :]<EOL><DEDENT>header['<STR_LIT>'] = (header['<STR_LIT>'][-<NUM_LIT:1>] - header['<STR_LIT>'][<NUM_LIT:0>],<EOL>header['<STR_LIT>'][-<NUM_LIT:1>] - header['<STR_LIT>'][<NUM_LIT:0>])<EOL>header['<STR_LIT>'] = header['<STR_LIT>'][<NUM_LIT:0>]<EOL>if header['<STR_LIT>'] == <NUM_LIT:0>:<EOL><INDENT>header['<STR_LIT>'] = -<NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>header['<STR_LIT>'] = header['<STR_LIT>'] - header['<STR_LIT>']<EOL><DEDENT>if twod is None or '<STR_LIT:X>' in twod:<EOL><INDENT>header['<STR_LIT>'] = header['<STR_LIT>'][:-<NUM_LIT:1>]<EOL><DEDENT>if twod is None or '<STR_LIT:Y>' in twod:<EOL><INDENT>header['<STR_LIT>'] = header['<STR_LIT>'][:-<NUM_LIT:1>]<EOL><DEDENT>header['<STR_LIT>'] = header['<STR_LIT>'][:-<NUM_LIT:1>]<EOL>
Read all coord hdf5 files of a snapshot.

    Args:
        files (list of pathlib.Path): list of NodeCoordinates files of
            a snapshot.
        shapes (list of (int,int)): shape of mesh grids.
        header (dict): geometry info.
        twod (str): 'XZ', 'YZ' or None depending on what is relevant.