def METHOD_NAME(inputfiles, outputfile, verbose=False, inclination=0,
                          **compression_kw):
    """Merge several HDF5 injections files into a single file,
    sieving by inclination.
    Parameters
    ----------
    inputfiles : `list` of `str`
        the paths of the input HDF5 files to merge
    outputfile : `str`
        the path of the output HDF5 file to write
    """
    incrad = radians(inclination)
    attributes = {}
    datasets = {}
    keep = {}
    total = defaultdict(int)
    nfiles = len(inputfiles)
    def _scan_file(name, obj):
        """Record parameters for a given dataset
        """
        # if this is an injection group, determine which injections to keep
        if isinstance(obj, h5py.Group) and name in ("found", "missed"):
            keep.setdefault(obj.file.filename, {})[name] = theta(obj) < incrad
            total[name] += obj["mass1"].shape[0]
        # if this is just an individual dataset, record its parameters
        if isinstance(obj, h5py.Dataset):
            datasets[name] = {attr: getattr(obj, attr) for attr in (
                "compression",
                "compression_opts",
                "dtype",
            )}
    # loop once over all files, recording information
    for filename in tqdm.tqdm(inputfiles, desc="Scanning trigger files",
                              disable=not verbose, total=nfiles, unit="files",
                              **TQDM_KW):
        with h5py.File(filename, 'r') as h5f:
            attributes = dict(h5f.attrs)
            h5f.visititems(_scan_file)
    # print summary of what we found
    nfound = sum(keep[name]["found"].sum() for name in keep)
    nmissed = sum(keep[name]["missed"].sum() for name in keep)
    if verbose:
        print("Found {}/{} found, {}/{} missed with inclination < {}°".format(
            nfound, total["found"], nmissed, total["missed"], inclination,
        ))
    position = defaultdict(int)
    eventcount = 0
    with h5py.File(outputfile, 'w') as h5out:
        h5out.attrs.update(attributes)
        # create datasets
        for dset, params in datasets.items():
            size = nmissed if dset.startswith("missed") else nfound
            h5out.create_dataset(dset, shape=(size,), **params)
        # copy dataset contents
        for filename in tqdm.tqdm(inputfiles, desc="Merging trigger files",
                                  disable=not verbose, total=nfiles,
                                  unit="files", **TQDM_KW):
            _keep = keep[filename]
            with h5py.File(filename, 'r') as h5in:
                for dset in datasets:
                    if dset.startswith("missed"):
                        _keep = keep[filename]["missed"]
                    else:
                        _keep = keep[filename]["found"]
                    data = h5in[dset][:][_keep]
                    size = data.shape[0]
                    pos = position[dset]
                    if dset == "network/network_event_id":
                        # increment event_id by the _total_ number of events
                        # in the file (not just the ones we are using)
                        data += eventcount
                        eventcount += h5in[dset].shape[0]
                    h5out[dset][pos:pos+size] = data
                    position[dset] += size
    if verbose:
        print("Merged triggers written to {}".format(outputfile))
    return outputfile