Пример #1
0
def L96_table():
    import dapper.mods.Lorenz96 as model
    from dapper.mods.Lorenz96.sakov2008 import HMM as _HMM

    model.Force = 8.0  # undo pinheiro2019
    HMM = _HMM.copy()
    HMM.t.BurnIn = 0
    HMM.t.KObs = 10

    dpr.set_seed(3000)

    # xps
    xps = dpr.xpList()
    xps += da.Climatology()
    xps += da.OptInterp()
    xps += da.Var3D(xB=0.02)
    xps += da.ExtKF(infl=6)
    xps += da.EnKF("PertObs", N=40, infl=1.06)
    xps += da.EnKF("Sqrt", N=28, infl=1.02, rot=True)

    xps += da.EnKF_N(N=24, rot=True)
    xps += da.EnKF_N(N=24, rot=True, xN=2)
    xps += da.iEnKS("Sqrt", N=40, infl=1.01, rot=True)

    xps += da.LETKF(N=7, rot=True, infl=1.04, loc_rad=4)
    xps += da.SL_EAKF(N=7, rot=True, infl=1.07, loc_rad=6)

    xps.launch(HMM, store_u=True)

    table = xps.tabulate_avrgs(statkeys, decimals=4)
    return table.splitlines(True)
Пример #2
0
def L63_gen():
    from dapper.mods.Lorenz63.sakov2012 import HMM as _HMM

    HMM = _HMM.copy()
    HMM.t.BurnIn = 0
    HMM.t.KObs = 10

    dpr.set_seed(3000)

    # xps
    xps = dpr.xpList()
    xps += da.Climatology()
    xps += da.OptInterp()
    xps += da.Var3D(xB=0.1)
    xps += da.ExtKF(infl=90)
    xps += da.EnKF("Sqrt", N=3, infl=1.30)
    xps += da.EnKF("Sqrt", N=10, infl=1.02, rot=True)
    xps += da.EnKF("PertObs", N=500, infl=0.95, rot=False)
    xps += da.EnKF_N(N=10, rot=True)
    xps += da.iEnKS("Sqrt", N=10, infl=1.02, rot=True)
    xps += da.PartFilt(N=100, reg=2.4, NER=0.3)
    xps += da.PartFilt(N=800, reg=0.9, NER=0.2)
    xps += da.PartFilt(N=4000, reg=0.7, NER=0.05)
    xps += da.PFxN(xN=1000, N=30, Qs=2, NER=0.2)

    # Run
    xps.launch(HMM, False, store_u=True)
    return xps
Пример #3
0
def L63_gen():
    from dapper.mods.Lorenz63.sakov2012 import HMM as _HMM

    HMM = _HMM.copy()
    HMM.tseq.BurnIn = 0
    HMM.tseq.Ko = 10

    # xps
    xps = dpr.xpList()
    xps += da.Climatology()
    xps += da.OptInterp()
    xps += da.Persistence()
    xps += da.PreProg(lambda k, xx, yy: xx[k])
    xps += da.Var3D(xB=0.1)
    xps += da.ExtKF(infl=90)
    xps += da.EnKF("Sqrt", N=3, infl=1.30)
    xps += da.EnKF("Sqrt", N=10, infl=1.02, rot=True)
    xps += da.EnKF("PertObs", N=500, infl=0.95, rot=False)
    xps += da.EnKF_N(N=10, rot=True)
    xps += da.iEnKS("Sqrt", N=10, infl=1.02, rot=True)
    xps += da.PartFilt(N=100, reg=2.4, NER=0.3)
    xps += da.PartFilt(N=800, reg=0.9, NER=0.2)
    xps += da.PartFilt(N=4000, reg=0.7, NER=0.05)
    xps += da.PFxN(xN=1000, N=30, Qs=2, NER=0.2)

    xps += da.OptPF(N=100, Qs=2, reg=0.7, NER=0.3)
    xps += da.EnKS("Serial", N=30, Lag=1)
    xps += da.EnRTS("Serial", N=30, DeCorr=0.99)

    for xp in xps:
        xp.seed = 3000

    # Run
    xps.launch(HMM, False, store_u=True)
    return xps
Пример #4
0
def L96_gen():
    import dapper.mods.Lorenz96 as model
    from dapper.mods.Lorenz96.sakov2008 import HMM as _HMM

    model.Force = 8.0  # undo pinheiro2019
    HMM = _HMM.copy()
    HMM.tseq.BurnIn = 0
    HMM.tseq.Ko = 10

    # xps
    xps = dpr.xpList()
    xps += da.Climatology()
    xps += da.OptInterp()
    xps += da.Persistence()
    xps += da.PreProg(lambda k, xx, yy: xx[k])
    xps += da.Var3D(xB=0.02)
    xps += da.ExtKF(infl=6)
    xps += da.EnKF("PertObs", N=40, infl=1.06)
    xps += da.EnKF("Sqrt", N=28, infl=1.02, rot=True)

    xps += da.EnKF_N(N=24, rot=True)
    xps += da.EnKF_N(N=24, rot=True, xN=2)
    xps += da.iEnKS("Sqrt", N=40, infl=1.01, rot=True)

    xps += da.LETKF(N=7, rot=True, infl=1.04, loc_rad=4)
    xps += da.SL_EAKF(N=7, rot=True, infl=1.07, loc_rad=6)

    for xp in xps:
        xp.seed = 3000

    xps.launch(HMM, store_u=True)
    return xps
Пример #5
0
# `!python -m pip install git+https://github.com/nansencenter/DAPPER.git` .
# Also note that liveplotting does not work on Colab.

# %matplotlib notebook
import dapper as dpr
import dapper.da_methods as da

seed = dpr.set_seed(3000)

# #### DA method configurations

xps = dpr.xpList()

from dapper.mods.Lorenz63.sakov2012 import HMM  # Expected rmse.a:

xps += da.Climatology()  # 7.6
xps += da.OptInterp()  # 1.25
xps += da.Var3D(xB=0.1)  # 1.03
xps += da.ExtKF(infl=90)  # 0.87
xps += da.EnKF('Sqrt', N=3, infl=1.30)  # 0.82
xps += da.EnKF('Sqrt', N=10, infl=1.02, rot=True)  # 0.63
xps += da.EnKF('PertObs', N=500, infl=0.95, rot=False)  # 0.56
xps += da.EnKF_N(N=10, rot=True)  # 0.54
xps += da.iEnKS('Sqrt', N=10, infl=1.02, rot=True)  # 0.31
xps += da.PartFilt(N=100, reg=2.4, NER=0.3)  # 0.38
xps += da.PartFilt(N=800, reg=0.9, NER=0.2)  # 0.28
# xps += da.PartFilt(       N=4000, reg=0.7  , NER=0.05)       # 0.27
# xps += da.PFxN(xN=1000,   N=30  , Qs=2     , NER=0.2)        # 0.56

# #### With Lorenz-96 instead