def METHOD_NAME(aerosol_path, output_filename):
    """
    Converts all the .pix and .cmp files found in `aerosol_path`
    to a HDF5 file.
    """
    # define a case switch
    func = {"pix": read_pix, "cmp": read_cmp}
    # create the output file
    fid = h5py.File(output_filename, "w")
    pattern = ["*.pix", "*.cmp"]
    for p in pattern:
        search = pjoin(aerosol_path, p)
        files = glob.glob(search)
        for fname in files:
            pth, ext = splitext(fname)
            ext = ext.split(".")[-1]
            grp_name = basename(pth)
            out_path = ppjoin(ext, grp_name)
            # read/write
            df, extents = func[ext](fname)
            attrs = {"extents": wkt.dumps(extents), "source filename": fname}
            write_dataframe(df, out_path, fid, attrs=attrs)
    fid.close()