def Colourspline(self):
        from stellarpop import tools
        sed = tools.getSED('BC_Z=1.0_age=10.00gyr')
        #different SEDs don't change things much

        rband = tools.filterfromfile('r_SDSS')
        z = self.zlbins
        self.colourspline = {}
        for band in self.bands:
            if band != "VIS":
                c = z * 0
                Cband = tools.filterfromfile(band)
                for i in range(len(z)):
                    c[i] = -(tools.ABFM(Cband, sed, z[i]) -
                             tools.ABFM(rband, sed, 0))
                self.colourspline[band] = interpolate.splrep(z, c)
Example #2
0
    def create_models(self):
        import numpy, cPickle
        from stellarpop import tools
        from ndinterp import ndInterp

        wave = self.axes[2]
        self.axes_names = self.axes[1]
        nmodels = self.spex.size / wave.size
        spex = self.spex.reshape(nmodels, wave.size)
        spex = spex * self.luminosity_correction()

        axes = self.axes[0]

        out = {}
        for F in self.filter_names:
            filt = self.filters[F]
            mags = numpy.zeros(nmodels)
            for i in range(nmodels):
                mags[i] = tools.ABFM(filt, [wave, spex[i]], self.redshift)
            mags = mags.reshape(self.spex.shape[:-1])
            out[F] = ndInterp(axes, mags)
        return out