<commit_before>"""
Unit tests for hugs.imtools
"""
from __future__ import division, print_function

from ...utils import get_test_exp
from ..core import get_cutout

exposure = get_test_exp()

def test_get_cutout():
    center = (13687, 28321)
    size = 300
    cutout = get_cutout(center, size, exp=exposure)
    img = cutout.getMaskedImage().getImage().getArray()
    assert img.shape == (435, 419)<commit_msg>test gauss smooth<commit_after>"""
Unit tests for hugs.imtools
"""
from __future__ import division, print_function

import numpy as np
from ...utils import get_test_exp
from ..core import get_cutout, smooth_gauss

exposure = get_test_exp()

def test_get_cutout():
    center = (13687, 28321)
    size = 300
    cutout = get_cutout(center, size, exp=exposure)
    img = cutout.getMaskedImage().getImage().getArray()
    assert img.shape == (435, 419)


def test_smooth_gauss():
    mi = exposure.getMaskedImage()
    mi_smooth = smooth_gauss(mi, 10.0)
    arr = mi.getImage().getArray()
    arr_smooth = mi_smooth.getImage().getArray()
    assert np.nanstd(arr) > np.nanstd(arr_smooth)
{'fraction_non_alphanumeric': 0.12043795620437957, 'fraction_numerical': 0.037408759124087594, 'mean_word_length': 4.248803827751196, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6421608', 'n_tokens_mistral': 416, 'n_tokens_neox': 368, 'n_words': 94}