This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on 30/05/2014 | |
@author: andre | |
''' | |
import pystarlight.io # @UnusedImport | |
import atpy | |
import numpy as np | |
from scipy.interpolate.interpolate import interp1d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on Jun 27, 2013 | |
@author: andre | |
''' | |
import numpy as np | |
__all__ = ['SpectraVelocityFixer'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calc_rest_frame_spectra(K, target_vd): | |
if target_vd is None: | |
target_vd = np.percentile(K.v_d, 95.0) | |
from pystarlight.util.velocity_fix import SpectraVelocityFixer | |
fixer = SpectraVelocityFixer(K.l_obs, K.v_0, K.v_d, nproc=None) | |
logger.debug('Computing rest frame spectra from scratch...') | |
f_syn_rest__lz = fixer.fix(K.f_syn, target_vd) | |
f_obs_rest__lz, f_err_rest__lz, flags = fixer.fixFlagged(K.f_obs, K.f_err, K.f_flag > 0.0, target_vd) | |
f_flag_rest__lz = np.where(flags | (f_obs_rest__lz < 0.0), 1.0, 0.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Created on 19/05/2014 | |
@author: andre | |
''' | |
import numpy as np | |
import matplotlib.pyplot as plt | |
################################################################################################### |