astrokep.py 文件源码

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

项目:astrobase 作者: waqasbhatti 项目源码 文件源码
def read_kepler_pklc(picklefile):
    '''This turns the pickled lightcurve back into an lcdict.

    '''

    try:
        with open(picklefile, 'rb') as infd:
            lcdict = pickle.load(infd)

    except UnicodeDecodeError:

        with open(picklefile,'rb') as infd:
            lcdict = pickle.load(infd, encoding='latin1')

        LOGWARNING('pickle %s was probably from Python 2 '
                   'and failed to load without using "latin1" encoding. '
                   'This is probably a numpy issue: '
                   'http://stackoverflow.com/q/11305790' % checkplotpickle)

    return lcdict



##########################
## KEPLER LC PROCESSING ##
##########################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号