示例#1
0
 def test_get_logger(self):
     r"""
     Tests creation of a logger
     """
     logger = amt_core._get_logger('ApertureMapModelTools.Test.TestCore')
     #
     assert logger.name == 'AMT.Test.TestCore'
示例#2
0
 def test_toplevel_logger(self):
     r"""
     Tests te configuation of the top level logger
     """
     logger = amt_core._get_logger('ApertureMapModelTools')
     assert logger.name == 'AMT'
     assert len(logger.handlers) == 0
"""
Calculates a simple histogram for a data map. This also serves as the
super class for variants of a simple histogram.
#
Written By: Matthew Stadelman
Date Written: 2016/02/29
Last Modifed: 2016/10/25
#
"""
import scipy as sp
from ApertureMapModelTools.__core__ import _get_logger, calc_percentile
from .__BaseProcessor__ import BaseProcessor
logger = _get_logger(__name__)


class Histogram(BaseProcessor):
    r"""
    Performs a basic histogram of the data based on the number of bins
    desired. The first bin contains all values below the 1st percentile
    and the last bin contains all values above the 99th percentile to keep
    axis scales from being bloated by extrema.
    kwargs include:
        num_bins - integer value for the total number of bins
    """
    def __init__(self, field, **kwargs):
        super().__init__(field)
        self.args.update(kwargs)
        self.output_key = 'hist'
        self.action = 'histogram'
        self.bins = []