process_fits.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:black_holes 作者: codeforgoodconf 项目源码 文件源码
def process_fits(file_path, wls_out):
    print('processing ' + file_path)
    hdulist = fits.open(file_path)
    wls = 10 ** hdulist[1].data['loglam']
    fxs = hdulist[1].data['flux']
    z = hdulist[2].data['z']
    wls = wls / (1 + z)
    if wls_out[0] < wls[0] or wls_out[-1] > wls[-1]:
        return None
    remove_slope(wls, fxs)
    wls, fxs = gaussian_smooth(wls, fxs)
    wls, fxs = crop_data(wls, fxs, wls_out)
    fxs_out = numpy.interp(wls_out, wls, fxs)
    return fxs_out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号