import triangle sys.path.append(os.path.abspath("../source")) from spamm.Spectrum import Spectrum from spamm.Model import Model from spamm.components.NuclearContinuumComponent import NuclearContinuumComponent from spamm.components.HostGalaxyComponent import HostGalaxyComponent from spamm.components.FeComponent import FeComponent from spamm.components.BalmerContinuum import BalmerContinuum datafile = 'testLBT.dat' wavelengths, flux, flux_err = np.loadtxt(datafile, unpack=True) spectrum = Spectrum() spectrum.wavelengths = sp.r_[1000:5200:10000j] spectrum.flux = sp.ones(10000) spectrum.flux_error = sp.ones(10000) model = Model() bc_comp = BalmerContinuum() model.components.append(bc_comp) model.data_spectrum = spectrum # add data norm = 1.e-15 pvector = [norm, 0.5e4, 0.1, 0.0, 0.5e8] BCflux = model.model_flux(pvector) nwv = 4861
# ------------ model = Model() model.print_parameters = False # ----------------- # Initialize components # ----------------- if True: fe_comp = FeComponent() #datafile = "../Data/FakeData/for_gisella/fake_host_spectrum.dat" #datafile = "../Data/FakeData/Iron_comp/fakeFe1_deg.dat" datafile = "../Fe_templates/FeSimdata_BevWills_0p05.dat" wavelengths, flux, flux_err = np.loadtxt(datafile, unpack=True) spectrum = Spectrum() spectrum.wavelengths = wavelengths spectrum.flux = flux spectrum.flux_error = flux_err model.components.append(fe_comp) if False: nuclear_comp = NuclearContinuumComponent() datafile = "../Data/FakeData/PLcompOnly/fakepowlaw1_werr.dat" wavelengths, flux, flux_err = np.loadtxt(datafile, unpack=True) spectrum = Spectrum() spectrum.wavelengths = wavelengths spectrum.flux = flux spectrum.flux_error = flux_err