In [1]:
from __future__ import print_function
import numpy as np
import sncosmo
%matplotlib inline
In [2]:
# Other models (this one is a IIP)
model = sncosmo.Model(source='snana-2004hx')
(see http://sncosmo.readthedocs.org/en/latest/source-list.html for more)
In [3]:
print(model)
In [4]:
# all the same methods work
model.set(amplitude=1.e-10)
In [5]:
model.bandmag('sdssg', 'ab', 10.)
Out[5]:
In [6]:
sncosmo.plot_lc(model=model, bands=['sdssg', 'sdssr', 'sdssi', 'sdssz']);
In [7]:
dust = sncosmo.CCM89Dust()
In [8]:
print(dust)
In [9]:
model = sncosmo.Model(source='snana-2004hx', effects=[dust],
effect_names=['host'], effect_frames=['rest'])
In [10]:
print(model)
In [11]:
model.set(hostebv=0.3, hostr_v=2.1)
In [12]:
sncosmo.plot_lc(model=model, bands=['sdssg', 'sdssr', 'sdssi', 'sdssz']);