#!/usr/bin/env python
# -*- coding: utf-8 -*-

# Copyright (c) 2014 Adam.Dybbroe

# Author(s):

#   Adam.Dybbroe <a000680@c14526.ad.smhi.se>

# This program 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, either version 3 of the License, or
# (at your option) any later version.

# 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.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

"""Test the reflectance derivation...
"""

from pyspectral.near_infrared_reflectance import Calculator
refl37 = Calculator('meteosat', '9', 'seviri', 'IR3.9')

import numpy as np
tb_rad_obs_file = "/local_disk/laptop/Satsa/Pytroll/demo/refl39/tbs_and_rads.npz"
this = np.load(tb_rad_obs_file)

refl37.tb2radiance_simple(290., 'IR3.9')

print refl37.reflectance_from_tbs(80., 290, 280)
