# Path: nansat/utils.py
# def add_logger(logName='', logLevel=None):
#     """ Creates and returns logger with default formatting for Nansat
# 
#     Parameters
#     -----------
#     logName : string, optional
#         Name of the logger
# 
#     Returns
#     --------
#     logging.logger
# 
#     See also
#     --------
#     `<http://docs.python.org/howto/logging.html>`_
# 
#     """
#     if logLevel is not None:
#         os.environ['LOG_LEVEL'] = str(logLevel)
#     # create (or take already existing) logger
#     # with default logging level WARNING
#     logger = logging.getLogger(logName)
#     logger.setLevel(int(os.environ['LOG_LEVEL']))
# 
#     # if logger already exits, default stream handler has been already added
#     # otherwise create and add a new handler
#     if len(logger.handlers) == 0:
#         # create console handler and set level to debug
#         ch = logging.StreamHandler()
#         # create formatter
#         formatter = logging.Formatter('%(asctime)s|%(levelno)s|%(module)s|'
#                                       '%(funcName)s|%(message)s',
#                                       datefmt='%I:%M:%S')
#         # add formatter to ch
#         ch.setFormatter(formatter)
#         # add ch to logger
#         logger.addHandler(ch)
# 
#     logger.handlers[0].setLevel(int(os.environ['LOG_LEVEL']))
# 
#     return logger


import os
import numpy as np
        import matplotlib; matplotlib.use('Agg')
    import Image
    import ImageDraw
    import ImageFont
from math import floor, log10
    from matplotlib import cm
    from PIL import Image, ImageDraw, ImageFont
from nansat.utils import add_logger
# Name:    figure.py
# Purpose: Container of Figure class
# Authors:      Asuka Yamakawa, Anton Korosov, Knut-Frode Dagestad,
#               Morten W. Hansen, Alexander Myasoyedov,
#               Dmitry Petrenko, Evgeny Morozov
# Created:      29.06.2011
# Copyright:    (c) NERSC 2011 - 2013
# Licence:
# This file is part of NANSAT.
# NANSAT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
# http://www.gnu.org/licenses/gpl-3.0.html
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
from __future__ import absolute_import


try:
    if 'DISPLAY' not in os.environ:
except ImportError:
    MATPLOT_LIB_IS_INSTALLED = False
else:

# Path: nansat/utils.py
# def add_logger(logName='', logLevel=None):
#     """ Creates and returns logger with default formatting for Nansat
# 
#     Parameters
#     -----------
#     logName : string, optional
#         Name of the logger
# 
#     Returns
#     --------
#     logging.logger
# 
#     See also
#     --------
#     `<http://docs.python.org/howto/logging.html>`_
# 
#     """
#     if logLevel is not None:
#         os.environ['LOG_LEVEL'] = str(logLevel)
#     # create (or take already existing) logger
#     # with default logging level WARNING
#     logger = logging.getLogger(logName)
#     logger.setLevel(int(os.environ['LOG_LEVEL']))
# 
#     # if logger already exits, default stream handler has been already added
#     # otherwise create and add a new handler
#     if len(logger.handlers) == 0:
#         # create console handler and set level to debug
#         ch = logging.StreamHandler()
#         # create formatter
#         formatter = logging.Formatter('%(asctime)s|%(levelno)s|%(module)s|'
#                                       '%(funcName)s|%(message)s',
#                                       datefmt='%I:%M:%S')
#         # add formatter to ch
#         ch.setFormatter(formatter)
#         # add ch to logger
#         logger.addHandler(ch)
# 
#     logger.handlers[0].setLevel(int(os.environ['LOG_LEVEL']))
# 
#     return logger


# Path: nansat/figure.py
import os
import numpy as np
        import matplotlib; matplotlib.use('Agg')
    import Image
    import ImageDraw
    import ImageFont
from math import floor, log10
    from matplotlib import cm
    from PIL import Image, ImageDraw, ImageFont
from nansat.utils import add_logger

# Name:    figure.py
# Purpose: Container of Figure class
# Authors:      Asuka Yamakawa, Anton Korosov, Knut-Frode Dagestad,
#               Morten W. Hansen, Alexander Myasoyedov,
#               Dmitry Petrenko, Evgeny Morozov
# Created:      29.06.2011
# Copyright:    (c) NERSC 2011 - 2013
# Licence:
# This file is part of NANSAT.
# NANSAT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
# http://www.gnu.org/licenses/gpl-3.0.html
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
from __future__ import absolute_import


try:
    if 'DISPLAY' not in os.environ:
except ImportError:
    MATPLOT_LIB_IS_INSTALLED = False
else:

    MATPLOT_LIB_IS_INSTALLED = True