Try out the interpolator and see if the error spectra make sense


In [1]:
%load_ext autoreload
%autoreload 2

In [5]:
import matplotlib.pyplot as plt
import numpy as np
from StellarSpectra.grid_tools import HDF5Interface, Interpolator
import StellarSpectra.constants as C
from StellarSpectra.spectrum import DataSpectrum
from StellarSpectra.utils import saveall

In [6]:
#interface = HDF5Interface("../libraries/PHOENIX_F.hdf5")
interface = HDF5Interface("../libraries/PHOENIX_TRES_F.hdf5")
dataspec = DataSpectrum.open("../data/WASP14/WASP14-2009-06-14.hdf5", orders=np.array([22]))
interpolator = Interpolator(interface, dataspec, trilinear=True)


Determine Chunk Log: Wl is 8192

In [10]:
params = {"temp":6150, "logg":4.29, "Z":-0.4}
fl, errspec = interpolator(params)


[(6100, 6200), (4.0, 4.5), (-0.5, 0.0)]
[(0.5, 0.5), (0.41999999999999993, 0.58000000000000007), (0.80000000000000004, 0.19999999999999996)]
[ 0.168  0.042  0.232  0.058  0.168  0.042  0.232  0.058]
[ 0.40987803  0.20493902  0.48166378  0.24083189  0.40987803  0.20493902
  0.48166378  0.24083189]
[ 0.168  0.042  0.232  0.058  0.168  0.042  0.232  0.058]

In [27]:
wl = interpolator.wl
ind = (wl > 5160) & (wl < 5164)
wl_raw = wl[ind]

In [28]:
for spec in errspec:
    plt.plot(wl_raw, spec[ind])
plt.show()

In [ ]: