bfast-ray

image

The bfast-ray package provides a highly-efficient parallel implementation for the `Breaks For Additive Season and Trend (BFASTmonitor) proposed by Verbesselt et al. The implementation is based on Ray

This package is adapted from https://github.com/diku-dk/bfast, with credit to mortvest.

Dependencies

============

Input args

Output

breaks: 数组。 -2代表 没有充分的历史数据。 -1代表该pixel没有break 。所有其他非负数据对应于第一个在监控期间检测到的中断的索引序号

means: 每一个MOSUM 过程的mean值(例如考虑NDMI指数时,像素的正平均值对应于植被的增加,)

timers : dict 是个字典,包含拟合过程不同阶段的运行时测量值。

共三个

use example

k = 3
freq = 365
trend = False
hfrac = 0.25
level = 0.05
start_monitor = datetime(2010, 1, 1)

model = BFASTMonitor(
            start_monitor,
            freq=freq,
            k=k,
            hfrac=hfrac,
            trend=trend,
            level=level,
            # backend='python',
            backend='python-ray',
            cluster_address = "ray://xx.xx.xx.xx:xxxxx",
            ray_remote_args= {"resources": {"xxxx": xx}, "batch_size":1}
        )


model.fit(data, dates, nan_value=-32768)

breaks = model.breaks
means = model.means
timers = model.timers