In [1]:
import wisps
import pandas as pd
import splat
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
In [7]:
def proper_classification(sp):
"""
Uses splat.classifyByStandard to classify spectra using spex standards
"""
val=wisps.classify(sp, stripunits=True)
return val
def combine_two_spectra(sp10, sp20):
"""
sp1 and sp2 are splat objects
"""
sp1=sp10.splat_spectrum
sp2=sp20.splat_spectrum
sp1.fluxCalibrate('2MASS J', wisps.absolute_magnitude_jh(wisps.make_spt_number(sp10.spectral_type))[0])
sp2.fluxCalibrate('2MASS J', wisps.absolute_magnitude_jh(wisps.make_spt_number(sp20.spectral_type))[0])
sp3=sp1+sp2
types={}
types={'primary': [sp10.spectral_type, sp20.spectral_type],
'system': proper_classification(sp3),
'spectrum': sp3}
return types
In [49]:
sp=splat.getSpectrum(lucky=True)[0]
In [51]:
fig, ax=plt.subplots()
sp.toInstrument('WFC3')
ax.step(sp.wave, sp.flux)
sp.reset()
ax.step(sp.wave.value, sp.flux.value+0.4)
ax.set_xlim([1.0, 1.7])
ax.set_ylim([0.0, 1.5])
Out[51]:
In [27]:
splat.INSTRUMENTS['WFC3-G141']
Out[27]:
In [ ]: