# Path: ciao_contrib/logger_wrapper.py
# def initialize_module_logger(name):
#     """Create a logger for the module with an id of name.
# 
#     Returns the logger. Unlike initialize_logger, no handler
#     is set up.
# 
#     """
# 
#     return get_module_logger(name)
# 
# Path: ciao_contrib/smooth.py
# def mk_gauss(sigma, hwidth):
# def mk_tophat(radius):
# def mk_boxcar(radius):
# def ismooth(image, kernel, origin=None, norm=True):
# def gsmooth(image, sigma, hwidth=5):
# def tsmooth(image, radius):
# def bsmooth(image, radius):
# def fsmooth(image, filename):


import os
import time
import collections
import numpy as np
import pycrates
from ciao_contrib.logger_wrapper import initialize_module_logger
from ciao_contrib import smooth as sm
    Examples
    --------

    >>> cr = read_file('img.fits')
    >>> scale_image_crate(cr, 'log10')

    """

    if not isinstance(cr, pycrates.IMAGECrate):
        raise ValueError("First argument must be an image crate.")

    # Short cut
    if scaling == "none":
        return

    ivals = pycrates.copy_piximgvals(cr)

    try:
        sfunc = _image_scalings[scaling]

    except KeyError:
        raise ValueError("Invalid scaling value of '{}': must be one of\n  {}".format(
            scaling, " ".join(_image_scalings.keys())))

    pycrates.set_piximgvals(cr, sfunc(ivals))


_image_smooth = {
    "none": None,
    "gauss": sm.gsmooth,

# Path: ciao_contrib/logger_wrapper.py
# def initialize_module_logger(name):
#     """Create a logger for the module with an id of name.
# 
#     Returns the logger. Unlike initialize_logger, no handler
#     is set up.
# 
#     """
# 
#     return get_module_logger(name)
# 
# Path: ciao_contrib/smooth.py
# def mk_gauss(sigma, hwidth):
# def mk_tophat(radius):
# def mk_boxcar(radius):
# def ismooth(image, kernel, origin=None, norm=True):
# def gsmooth(image, sigma, hwidth=5):
# def tsmooth(image, radius):
# def bsmooth(image, radius):
# def fsmooth(image, filename):


# Path: crates_contrib/utils.py
import os
import time
import collections
import numpy as np
import pycrates
from ciao_contrib.logger_wrapper import initialize_module_logger
from ciao_contrib import smooth as sm

    Examples
    --------

    >>> cr = read_file('img.fits')
    >>> scale_image_crate(cr, 'log10')

    """

    if not isinstance(cr, pycrates.IMAGECrate):
        raise ValueError("First argument must be an image crate.")

    # Short cut
    if scaling == "none":
        return

    ivals = pycrates.copy_piximgvals(cr)

    try:
        sfunc = _image_scalings[scaling]

    except KeyError:
        raise ValueError("Invalid scaling value of '{}': must be one of\n  {}".format(
            scaling, " ".join(_image_scalings.keys())))

    pycrates.set_piximgvals(cr, sfunc(ivals))


_image_smooth = {
    "none": None,
    "gauss": sm.gsmooth,

    "boxcar": sm.bsmooth,