# Path: dist/astro-smpy-0.1.dev/smpy/dust.py
# def Calzetti(ta_grid, wave, Av):
#     Att = np.ones(np.append(ta_grid.shape, len(wave)))
#     k = np.zeros_like(wave.value)
# 
#     w0 = [wave <= 1200 * u.AA]
#     w1 = [wave < 6300 * u.AA]
#     w2 = [wave >= 6300 * u.AA]
#     w_u = wave.to(u.um).value
# 
#     x1 = np.argmin(np.abs(wave - 1200 * u.AA))
#     x2 = np.argmin(np.abs(wave - 1250 * u.AA))
# 
#     k[w2] = 2.659 * (-1.857 + 1.040 / w_u[w2])
#     k[w1] = 2.659 * (-2.156 + (1.509 / w_u[w1]) - (0.198 / w_u[w1] ** 2) + (0.011 / w_u[w1] ** 3))
#     k[w0] = k[x1] + ((wave[w0] - 1200. * u.AA) * (k[x1] - k[x2]) / (wave[x1] - wave[x2]))
# 
#     k += 4.05
#     k[k < 0.] = 0.
# 
#     tv = Av * k / 4.05
#     Att *= np.power(10, -0.4 * tv)
#     return Att
# 
# Path: dist/astro-smpy-0.1.dev/smpy/sfh.py
# def exponential(t, tau):
#     """ Exponential star formation history
# 
#     """
#     sfh = np.exp(-1 * t / tau) / np.abs(tau)
#     return sfh


import numpy as np
import copy
import os
import sys
import h5py
import types
import glob
import data
from scipy.interpolate import griddata
from scipy.spatial import Delaunay
from astropy import units as u
from astropy import constants as c
from astropy import cosmology as cos
from astropy.utils.console import ProgressBar
from .dust import Calzetti
from .sfh import exponential
from .misc import tau_madau
from __future__ import print_function, division





cosmo = cos.FlatLambdaCDM(H0=70, Om0=0.3)

f = open("error.log", "w")
original_stderr = sys.stderr
sys.stderr = f

data_path = data.__path__[0]



# Path: dist/astro-smpy-0.1.dev/smpy/dust.py
# def Calzetti(ta_grid, wave, Av):
#     Att = np.ones(np.append(ta_grid.shape, len(wave)))
#     k = np.zeros_like(wave.value)
# 
#     w0 = [wave <= 1200 * u.AA]
#     w1 = [wave < 6300 * u.AA]
#     w2 = [wave >= 6300 * u.AA]
#     w_u = wave.to(u.um).value
# 
#     x1 = np.argmin(np.abs(wave - 1200 * u.AA))
#     x2 = np.argmin(np.abs(wave - 1250 * u.AA))
# 
#     k[w2] = 2.659 * (-1.857 + 1.040 / w_u[w2])
#     k[w1] = 2.659 * (-2.156 + (1.509 / w_u[w1]) - (0.198 / w_u[w1] ** 2) + (0.011 / w_u[w1] ** 3))
#     k[w0] = k[x1] + ((wave[w0] - 1200. * u.AA) * (k[x1] - k[x2]) / (wave[x1] - wave[x2]))
# 
#     k += 4.05
#     k[k < 0.] = 0.
# 
#     tv = Av * k / 4.05
#     Att *= np.power(10, -0.4 * tv)
#     return Att
# 
# Path: dist/astro-smpy-0.1.dev/smpy/sfh.py
# def exponential(t, tau):
#     """ Exponential star formation history
# 
#     """
#     sfh = np.exp(-1 * t / tau) / np.abs(tau)
#     return sfh


# Path: dist/astro-smpy-0.1.dev/smpy/smpy.py
import numpy as np
import copy
import os
import sys
import h5py
import types
import glob
import data
from scipy.interpolate import griddata
from scipy.spatial import Delaunay
from astropy import units as u
from astropy import constants as c
from astropy import cosmology as cos
from astropy.utils.console import ProgressBar
from .dust import Calzetti
from .sfh import exponential
from .misc import tau_madau

from __future__ import print_function, division





cosmo = cos.FlatLambdaCDM(H0=70, Om0=0.3)

f = open("error.log", "w")
original_stderr = sys.stderr
sys.stderr = f

data_path = data.__path__[0]



class CSP: