-
Notifications
You must be signed in to change notification settings - Fork 4
/
test_WDmodel.py
59 lines (37 loc) · 1.33 KB
/
test_WDmodel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Runs some tests for coveralls on the WDmodel package. Just checks that the
functions execute, not that the output is sane.
"""
import sys
import numpy as np
import WDmodel.WDmodel
import WDmodel.io
def main():
model = WDmodel.WDmodel.WDmodel()
TEFF = 42757.
LOGG = 7.732
AV = 0.01
FWHM = 3.
WAVE = np.arange(3000., 9001., 1.)
model._get_model(TEFF, LOGG, wave=WAVE, log=True)
model._get_model_nosp(TEFF, LOGG, wave=WAVE)
model._get_model_nosp(TEFF, LOGG, wave=WAVE, log=True)
model._get_red_model(TEFF, LOGG, AV, WAVE)
model._get_red_model(TEFF, LOGG, AV, WAVE, log=True)
model._get_obs_model(TEFF, LOGG, AV, FWHM, WAVE, log=True)
_, testspec = model._get_full_obs_model(TEFF, LOGG, AV, FWHM, WAVE, log=True)
model._wave_test(testspec.wave[0:1])
BADTEFF = 9000.
BADLOGG = 6.5
model.get_model(BADTEFF, BADLOGG, strict=False)
model.get_red_model(TEFF, LOGG, AV, wave=WAVE)
model.get_red_model(TEFF, LOGG, AV, wave=WAVE, log=True)
model.get_obs_model(TEFF, LOGG, AV, FWHM, wave=WAVE, log=True)
model.extract_spectral_line(testspec.wave, testspec.flux, line=2)
fn = 'out/test/test/test_mcmc.hdf5'
WDmodel.io.read_mcmc(fn)
return
if __name__=='__main__':
sys.exit(main())