Skip to content
spec1d.py 36.7 KiB
Newer Older
Shuai Feng's avatar
Shuai Feng committed
        # Select Teff bins
        teff_feH = template.teff_grid[idx_feh]
        minloc   = np.argmin(abs(teff - teff_feH))
        starspec = tpls[:, minloc]
        
        wave = np.exp(template.log_lam_temp)
        
        # Dust Reddening
        if np.isscalar(ebv):
            starspec = reddening(wave, starspec, ebv = ebv)
            
        # Redshift
        redshift = vel / 3e5
        wave_r = wave * (1 + redshift)
        
        flux = np.interp(instrument.wave, wave_r, starspec)
        
        # Calibration
        if np.isscalar(mag):
            flux = calibrate(instrument.wave, flux, mag, filtername='SLOAN_SDSS.r')
        
        # Convert to input wavelength
        self.wave = instrument.wave
        self.flux = flux