Skip to content

Commit

Permalink
Added grism test for LDC and released new svo_filters version
Browse files Browse the repository at this point in the history
  • Loading branch information
hover2pi committed Nov 11, 2018
1 parent acd4ec1 commit 9c0d655
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .pytest_cache/v/cache/lastfailed
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"exoctk/tests/test_limb_darkening.py": true
}
1 change: 1 addition & 0 deletions .pytest_cache/v/cache/nodeids
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
2 changes: 1 addition & 1 deletion ci/setup_conda_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 1 addition & 5 deletions exoctk/limb_darkening/limb_darkening_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
21 changes: 21 additions & 0 deletions exoctk/tests/test_limb_darkening.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c0d655

Please sign in to comment.