From 9c0d6552d6256da0ef93dcc81c3b77bb6c787211 Mon Sep 17 00:00:00 2001 From: Joe Filippazzo Date: Sat, 10 Nov 2018 23:47:49 -0500 Subject: [PATCH] Added grism test for LDC and released new svo_filters version --- .pytest_cache/v/cache/lastfailed | 3 +++ .pytest_cache/v/cache/nodeids | 1 + ci/setup_conda_env.sh | 2 +- exoctk/limb_darkening/limb_darkening_fit.py | 6 +----- exoctk/tests/test_limb_darkening.py | 21 +++++++++++++++++++++ 5 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 .pytest_cache/v/cache/lastfailed create mode 100644 .pytest_cache/v/cache/nodeids diff --git a/.pytest_cache/v/cache/lastfailed b/.pytest_cache/v/cache/lastfailed new file mode 100644 index 00000000..59f35d35 --- /dev/null +++ b/.pytest_cache/v/cache/lastfailed @@ -0,0 +1,3 @@ +{ + "exoctk/tests/test_limb_darkening.py": true +} \ No newline at end of file diff --git a/.pytest_cache/v/cache/nodeids b/.pytest_cache/v/cache/nodeids new file mode 100644 index 00000000..0637a088 --- /dev/null +++ b/.pytest_cache/v/cache/nodeids @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/ci/setup_conda_env.sh b/ci/setup_conda_env.sh index afbd51c9..996479ff 100755 --- a/ci/setup_conda_env.sh +++ b/ci/setup_conda_env.sh @@ -8,5 +8,5 @@ conda env list echo "Installing packages..." pip install numpy astropy conda install numpy astropy scipy cython matplotlib numba mock bokeh h5py sphinx pandas flask -pip install bibtexparser astroquery svo_filters==0.2.15 batman-package lmfit +pip install bibtexparser astroquery svo_filters==0.2.16 batman-package lmfit echo $PATH \ No newline at end of file diff --git a/exoctk/limb_darkening/limb_darkening_fit.py b/exoctk/limb_darkening/limb_darkening_fit.py index 2e92e7fd..9d2f1b64 100755 --- a/exoctk/limb_darkening/limb_darkening_fit.py +++ b/exoctk/limb_darkening/limb_darkening_fit.py @@ -294,11 +294,7 @@ def calculate(self, Teff, logg, FeH, profile, mu_min=0.05, ld_min=0.01, # Calculate errors from covariance matrix diagonal errs = np.sqrt(np.diag(cov)) - - if bandpass.centers.ndim == 1: - wave_eff = bandpass.centers[0].round(5) - else: - wave_eff = bandpass.centers[0, n].round(5) + wave_eff = bandpass.centers[0, n].round(5) # Make a dictionary or the results result = {} diff --git a/exoctk/tests/test_limb_darkening.py b/exoctk/tests/test_limb_darkening.py index 12433891..89ac2d85 100755 --- a/exoctk/tests/test_limb_darkening.py +++ b/exoctk/tests/test_limb_darkening.py @@ -73,6 +73,27 @@ def test_ldc_calculation_filter(): assert len(ld_session.results) == 2 +def test_ldc_calculation_grism(): + """Test to see if a calculation can be performed with a grism and + that they are appended to the results table""" + print('Testing LDC calculation using a filter grism...') + + # Make the session + ld_session = ldf.LDC(MODELGRID) + + # Make a filter + filt = Filter('2MASS.H', n_bins=10) + + # Run the calculations + ld_session.calculate(Teff=4000, logg=4.5, FeH=0, profile='quadratic', + bandpass=filt) + ld_session.calculate(Teff=4000, logg=4.5, FeH=0, profile='4-parameter', + bandpass=filt) + + # Two profiles split into 10 measurements = 20 calculations + assert len(ld_session.results) == 20 + + def test_ldc_calculation_interpolation(): """Test to see if a calculation can be performed with no filter and an interpolated grid point and that they are appended to the results