Factory for various catalogs.

def catalogFactory(name, **kwargs):
    """
    Factory for various catalogs.
    """
    fn = lambda member: inspect.isclass(member) and member.__module__==__name__
    catalogs = odict(inspect.getmembers(sys.modules[__name__], fn))

    if name not in list(catalogs.keys()):
        msg = "%s not found in catalogs:\n %s"%(name,list(kernels.keys()))
        logger.error(msg)
        msg = "Unrecognized catalog: %s"%name
        raise Exception(msg)

    return catalogs[name](**kwargs)