# Path: atrain_match/config.py
# RESOLUTION = int(os.environ.get('ATRAIN_RESOLUTION', 5))


import numpy as np
from atrain_match.config import RESOLUTION
from matplotlib import pyplot as plt
#
# You should have received a copy of the GNU General Public License
# along with atrain_match.  If not, see <http://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
# Program truth_imager_plot.py

"""Plotting functions to plot CALIOP, CPR (CloudSat) and colocated imager data along track."""



def plot_cal_clsat_geoprof_imager(match_clsat,
                                  match_calipso,
                                  imager_ctth_m_above_seasurface,
                                  plotpath,
                                  basename,
                                  mode,
                                  file_type='png',
                                  **options):
    """Plot imager co-located data on CALIOP and CPR (Cloudsat) track."""
    instrument = 'imager'
    if 'instrument' in options:
        instrument = options['instrument']
    MAXHEIGHT = None
    if 'MAXHEIGHT' in options:
        MAXHEIGHT = options["MAXHEIGHT"]
    caliop_height = match_calipso.calipso.layer_top_altitude * 1000
    caliop_base = match_calipso.calipso.layer_base_altitude * 1000
    calipso_val_h = match_calipso.calipso.validation_height
    caliop_base[caliop_base < 0] = -9
    caliop_height[caliop_height < 0] = -9

# Path: atrain_match/config.py
# RESOLUTION = int(os.environ.get('ATRAIN_RESOLUTION', 5))


# Path: atrain_match/plotting/along_track_plotting.py
import numpy as np
from atrain_match.config import RESOLUTION
from matplotlib import pyplot as plt

#
# You should have received a copy of the GNU General Public License
# along with atrain_match.  If not, see <http://www.gnu.org/licenses/>.
# -*- coding: utf-8 -*-
# Program truth_imager_plot.py

"""Plotting functions to plot CALIOP, CPR (CloudSat) and colocated imager data along track."""



def plot_cal_clsat_geoprof_imager(match_clsat,
                                  match_calipso,
                                  imager_ctth_m_above_seasurface,
                                  plotpath,
                                  basename,
                                  mode,
                                  file_type='png',
                                  **options):
    """Plot imager co-located data on CALIOP and CPR (Cloudsat) track."""
    instrument = 'imager'
    if 'instrument' in options:
        instrument = options['instrument']
    MAXHEIGHT = None
    if 'MAXHEIGHT' in options:
        MAXHEIGHT = options["MAXHEIGHT"]
    caliop_height = match_calipso.calipso.layer_top_altitude * 1000
    caliop_base = match_calipso.calipso.layer_base_altitude * 1000
    calipso_val_h = match_calipso.calipso.validation_height
    caliop_base[caliop_base < 0] = -9
    caliop_height[caliop_height < 0] = -9

    if RESOLUTION == 5 and match_clsat is not None: