# Path: pyLIMA/telescopes.py
# PYLIMA_LIGHTCURVE_MAGNITUDE_CONVENTION = ['time', 'mag', 'err_mag']
# PYLIMA_LIGHTCURVE_FLUX_CONVENTION = ['time', 'flux', 'err_flux']
# class Telescope(object):
#     def __init__(self, name='NDG', camera_filter='I', light_curve_magnitude=None,
#                  light_curve_magnitude_dictionnary=None,
#                  light_curve_flux=None, light_curve_flux_dictionnary=None,
#                  reference_flux=0.0, clean_the_lightcurve='Yes',
#                  location = 'Earth', spacecraft_name=None):
#     def arrange_the_lightcurve_columns(self, choice):
#     def n_data(self, choice='magnitude'):
#     def find_gamma(self, star):
#     def compute_parallax(self, event, parallax):
#     def clean_data_magnitude(self):
#     def clean_data_flux(self):
#     def lightcurve_in_flux(self):
#     def lightcurve_in_magnitude(self):
#     def hidden(self):
# 
# Path: pyLIMA/stars.py
# CLARET_PATH = template
# class Star(object):
#     def __init__(self):
#     def define_claret_filter_tables(self):
#     def find_gamma(self, filter):


import os.path
import numpy as np
from pyLIMA import telescopes
from pyLIMA import stars
        light_curve_magnitude=np.array([[0, 1, 0.1], [3, 4, 0.1], [5, 6, 0.1]]))

    clean_lightcurve = telescope.clean_data_magnitude()
    assert np.allclose(clean_lightcurve, np.array([[0, 1, 0.1], [3, 4, 0.1], [5, 6, 0.1]]))


def test_clean_data_not_clean():
    telescope = telescopes.Telescope(light_curve_magnitude=np.array(
        [[0, 1, 0.1], [3, np.nan, 0.1], [5, 6, 0.1], [7, np.nan, np.nan], [8, 1, 27.0],
         [9, 2, 0.03]]))
    clean_lightcurve = telescope.clean_data_magnitude()
    assert np.allclose(clean_lightcurve, np.array([[0, 1, 0.1], [5, 6, 0.1], [9, 2, 0.03]]))


def test_lightcurve_in_flux():
    telescope = telescopes.Telescope(
        light_curve_magnitude=np.array([[0, 1, 0.1], [3, 4, 0.1], [5, 6, 0.1]]))

    telescope.lightcurve_flux = telescope.lightcurve_in_flux()

    assert np.allclose(telescope.lightcurve_flux,
                       np.array([[0.00000000e+00, 3.63078055e+10, 3.34407247e+09],
                                 [3.00000000e+00, 2.29086765e+09, 2.10996708e+08],
                                 [5.00000000e+00, 3.63078055e+08, 3.34407247e+07]]))


def test_find_gamma():
    telescope = telescopes.Telescope(camera_filter="z'")



# Path: pyLIMA/telescopes.py
# PYLIMA_LIGHTCURVE_MAGNITUDE_CONVENTION = ['time', 'mag', 'err_mag']
# PYLIMA_LIGHTCURVE_FLUX_CONVENTION = ['time', 'flux', 'err_flux']
# class Telescope(object):
#     def __init__(self, name='NDG', camera_filter='I', light_curve_magnitude=None,
#                  light_curve_magnitude_dictionnary=None,
#                  light_curve_flux=None, light_curve_flux_dictionnary=None,
#                  reference_flux=0.0, clean_the_lightcurve='Yes',
#                  location = 'Earth', spacecraft_name=None):
#     def arrange_the_lightcurve_columns(self, choice):
#     def n_data(self, choice='magnitude'):
#     def find_gamma(self, star):
#     def compute_parallax(self, event, parallax):
#     def clean_data_magnitude(self):
#     def clean_data_flux(self):
#     def lightcurve_in_flux(self):
#     def lightcurve_in_magnitude(self):
#     def hidden(self):
# 
# Path: pyLIMA/stars.py
# CLARET_PATH = template
# class Star(object):
#     def __init__(self):
#     def define_claret_filter_tables(self):
#     def find_gamma(self, filter):


# Path: pyLIMA/test/test_telescopes.py
import os.path
import numpy as np
from pyLIMA import telescopes
from pyLIMA import stars

        light_curve_magnitude=np.array([[0, 1, 0.1], [3, 4, 0.1], [5, 6, 0.1]]))

    clean_lightcurve = telescope.clean_data_magnitude()
    assert np.allclose(clean_lightcurve, np.array([[0, 1, 0.1], [3, 4, 0.1], [5, 6, 0.1]]))


def test_clean_data_not_clean():
    telescope = telescopes.Telescope(light_curve_magnitude=np.array(
        [[0, 1, 0.1], [3, np.nan, 0.1], [5, 6, 0.1], [7, np.nan, np.nan], [8, 1, 27.0],
         [9, 2, 0.03]]))
    clean_lightcurve = telescope.clean_data_magnitude()
    assert np.allclose(clean_lightcurve, np.array([[0, 1, 0.1], [5, 6, 0.1], [9, 2, 0.03]]))


def test_lightcurve_in_flux():
    telescope = telescopes.Telescope(
        light_curve_magnitude=np.array([[0, 1, 0.1], [3, 4, 0.1], [5, 6, 0.1]]))

    telescope.lightcurve_flux = telescope.lightcurve_in_flux()

    assert np.allclose(telescope.lightcurve_flux,
                       np.array([[0.00000000e+00, 3.63078055e+10, 3.34407247e+09],
                                 [3.00000000e+00, 2.29086765e+09, 2.10996708e+08],
                                 [5.00000000e+00, 3.63078055e+08, 3.34407247e+07]]))


def test_find_gamma():
    telescope = telescopes.Telescope(camera_filter="z'")



    star = stars.Star()