spec1d.py 36.7 KB
Newer Older
Shuai Feng's avatar
Shuai Feng committed
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
        # 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
For faster browsing, not all history is shown. View entire blame