# Path: sncosmo/tests/test_models.py
# def flatsource():
#     """Create and return a TimeSeriesSource with a flat spectrum == 1.0 at
#     all times."""
#     phase = np.linspace(0., 100., 10)
#     wave = np.linspace(800., 20000., 100)
#     flux = np.ones((len(phase), len(wave)), dtype=float)
#     return sncosmo.TimeSeriesSource(phase, wave, flux)


import numpy as np
import sncosmo
from astropy.table import Table
from .test_models import flatsource
    # when this test was written (does not test whether the number is
    # correct)
    assert len(z) == 14

    # check that all values are indeed between the input limits.
    zarr = np.array(z)
    assert np.all((zarr > 0.) & (zarr < 0.25))


def test_realize_lcs():

    # here's some completely made-up data:
    obs1 = Table({'time': [10., 60., 110.],
                  'band': ['bessellb', 'bessellr', 'besselli'],
                  'gain': [1., 1., 1.],
                  'skynoise': [100., 100., 100.],
                  'zp': [30., 30., 30.],
                  'zpsys': ['ab', 'ab', 'ab']})

    # same made up data with aliased column names:
    obs2 = Table({'MJD': [10., 60., 110.],
                  'filter': ['bessellb', 'bessellr', 'besselli'],
                  'GAIN': [1., 1., 1.],
                  'skynoise': [100., 100., 100.],
                  'ZPT': [30., 30., 30.],
                  'zpmagsys': ['ab', 'ab', 'ab']})

    for obs in (obs1, obs2):

        # A model with a flat spectrum between 0 and 100 days.

# Path: sncosmo/tests/test_models.py
# def flatsource():
#     """Create and return a TimeSeriesSource with a flat spectrum == 1.0 at
#     all times."""
#     phase = np.linspace(0., 100., 10)
#     wave = np.linspace(800., 20000., 100)
#     flux = np.ones((len(phase), len(wave)), dtype=float)
#     return sncosmo.TimeSeriesSource(phase, wave, flux)


# Path: sncosmo/tests/test_simulation.py
import numpy as np
import sncosmo
from astropy.table import Table
from .test_models import flatsource

    # when this test was written (does not test whether the number is
    # correct)
    assert len(z) == 14

    # check that all values are indeed between the input limits.
    zarr = np.array(z)
    assert np.all((zarr > 0.) & (zarr < 0.25))


def test_realize_lcs():

    # here's some completely made-up data:
    obs1 = Table({'time': [10., 60., 110.],
                  'band': ['bessellb', 'bessellr', 'besselli'],
                  'gain': [1., 1., 1.],
                  'skynoise': [100., 100., 100.],
                  'zp': [30., 30., 30.],
                  'zpsys': ['ab', 'ab', 'ab']})

    # same made up data with aliased column names:
    obs2 = Table({'MJD': [10., 60., 110.],
                  'filter': ['bessellb', 'bessellr', 'besselli'],
                  'GAIN': [1., 1., 1.],
                  'skynoise': [100., 100., 100.],
                  'ZPT': [30., 30., 30.],
                  'zpmagsys': ['ab', 'ab', 'ab']})

    for obs in (obs1, obs2):

        # A model with a flat spectrum between 0 and 100 days.

        model = sncosmo.Model(source=flatsource())