generation.py 文件源码

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

项目:astrobase 作者: waqasbhatti 项目源码 文件源码
def generate_hads_lightcurve(
        times,
        mags=None,
        errs=None,
        paramdists={
            'period':sps.uniform(loc=0.04,scale=0.06),
            'fourierorder':[5,10],
            'amplitude':sps.uniform(loc=0.1,scale=0.6),
            'phioffset':np.pi,
        },
        magsarefluxes=False
):
    '''This generates fake HADS light curves.

    times is an array of time values that will be used as the time base.

    mags and errs will have the model mags applied to them. If either is None,
    np.full_like(times, 0.0) will used as a substitute.

    paramdists is a dict containing parameter distributions to use for the
    transitparams, in order:

    {'period', 'fourierorder', 'amplitude'}

    These are all 'frozen' scipy.stats distribution objects, e.g.:

    https://docs.scipy.org/doc/scipy/reference/stats.html#continuous-distributions

    The minimum light curve epoch will be automatically chosen from a uniform
    distribution between times.min() and times.max().

    The amplitude will be flipped automatically as appropriate if
    magsarefluxes=True.

    '''

    modeldict = generate_sinusoidal_lightcurve(times,
                                               mags=mags,
                                               errs=errs,
                                               paramdists=paramdists,
                                               magsarefluxes=magsarefluxes)
    modeldict['vartype'] = 'HADS'
    return modeldict
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号