示例#1
0
"""
Test of the observedlist save/load
"""
import numpy as np
from pyterpol.fitting.interface import ObservedList

# define the type
ol = ObservedList()

# build a list of observations
obs = [
    dict(filename='o.asc', group=dict(rv=[0, 1], teff=0), error=0.01),
    dict(filename='o.asc', group=dict(rv=0, teff=1)),
    dict(filename='o.asc'),
    dict(filename='o.asc', component='primary', korel=True, group=dict(logg=2))
]

# attach the spectra again
ol.add_observations(obs)

# save the class
ol.save('save_ol.txt')
print ol
# clear it
ol.clear_all()
print ol

# an
ol.load('save_ol.txt')
print ol
示例#2
0
"""
Test of the submodule ObservedList in fitting.
"""
import numpy as np
from pyterpol.fitting.interface import ObservedList

# define the type
ol = ObservedList(debug=True)

# add some observations
ol.add_one_observation(filename='o.asc', group=dict(rv=0, teff=0))
ol.add_one_observation(filename='o.asc', group=dict(rv=0, teff=1))
ol.add_one_observation(filename='o.asc')
ol.add_one_observation(filename='o.asc')

# list the class
print ol

# clear the class
ol.clear_all()

# build a list of observations
obs = [
    dict(filename='o.asc', group=dict(rv=0, teff=0)),
    dict(filename='o.asc', group=dict(rv=0, teff=1)),
    dict(filename='o.asc'),
    dict(filename='o.asc')
]

# attach the spectra again
ol.add_observations(obs)
示例#3
0
"""
Test of the submodule ObservedList in fitting.
Testing querying of spectra.
"""
import numpy as np
from pyterpol.fitting.interface import ObservedList

# define the type
ol = ObservedList()

# build a list of observations
obs = [
    dict(filename='o.asc', group=dict(rv=0, teff=0)),
    dict(filename='o.asc', group=dict(rv=0, teff=1)),
    dict(filename='o.asc'),
    dict(filename='o.asc', component='primary', korel=True, group=dict(logg=2))
]

# attach the spectra again
ol.add_observations(obs)
print ol

# try some queries - first groups
osl = ol.get_spectra(verbose=True, teff=1)                  # -- correct
print ObservedList(observedSpectraList=osl, debug=True)

osl = ol.get_spectra(verbose=True, rv=0)                    # -- correct
print ObservedList(observedSpectraList=osl, debug=True)

# now wavelengths
osl = ol.get_spectra(verbose=True, wmin=4300)               # -- correct