# Author:    Yasuko Matsubara
# Email:     [email protected]
# URL:       https://www.dm.sanken.osaka-u.ac.jp/~yasuko/
# Date:      2020-01-01
#------------------------------------------------------------#
# Copyright (C) 2020 Yasuko Matsubara & Yasushi Sakurai
# OrbitMap is freely available for non-commercial purposes
##############################################################
import numpy as np
import tool as tl
import time
import om_trans as om_trans
try:
    import lmfit
except:
    tl.error(
        "can not find lmfit - please see http://lmfit.github.io/lmfit-py/")

#-----------------------------#
# lmfit (default)
#XTL=1.e-8
#FTL=1.e-8
#MAXFEV=100
# lmfit (efficient)
XTL = 0.1
FTL = 0.1
MAXFEV = 20
#-----------------------------#
DBG = tl.NO  #YES

#-----------------------------#
Exemple #2
0
# URL:       https://www.dm.sanken.osaka-u.ac.jp/~yasuko/
# Date:      2020-01-01
#------------------------------------------------------------#
# Copyright (C) 2020 Yasuko Matsubara & Yasushi Sakurai
# OrbitMap is freely available for non-commercial purposes
##############################################################
import numpy as np
import tool as tl
import pylab as pl
import sys
from pykalman import KalmanFilter
import pickle
try:
    from pykalman import KalmanFilter
except:
    tl.error("can not find pykalman - please see https://pykalman.github.io/")

#-----------------------------#
ITERf=10 #2
ITERe=20 #10
#-----------------------------#
DBG=tl.NO


class KF:
    def __init__(self, data, k):
        if(DBG): tl.comment("KF (Kalman Filter)")
        (self.n,self.d)=np.shape(data)
        # data (observations)
        self.data=data
        self.k=k
Exemple #3
0
                     "--tst",
                     type=int,
                     help="starting position (optional)")
 parser.add_argument("-n", "--n", type=int, help="duration (optional)")
 parser.add_argument("-m",
                     "--mdir",
                     type=str,
                     help="model DB dir (optional)")
 parser.add_argument("-p",
                     "--mscale",
                     type=int,
                     help="multi-scale/process (optional)")
 args = parser.parse_args()
 if (len(sys.argv) < 2):
     parser.print_help()
     tl.error("parser")
 #--- check sequencefn ---#
 if (args.iseqfn != None):
     iseqfn = args.iseqfn
 else:
     parser.print_help()
     tl.error("parser")
 #--- check l-step-ahead ---#
 if (args.lstep != None):
     lstep = args.lstep
 else:
     parser.print_help()
     tl.error("parser")
 #--- check output dir ---#
 if (args.outdir != None):
     outdir = args.outdir
Exemple #4
0
 parser.add_argument("-w",
                     "--wd",
                     type=int,
                     help="sampling window size (optional)")
 parser.add_argument("-s",
                     "--swd",
                     type=int,
                     help="smooth window size (optional)")
 parser.add_argument("-o", "--outfn", type=str, help="output seq filename")
 args = parser.parse_args()
 #--- check sequencefn ---#
 if (args.seqfn != None):
     seqfn = args.seqfn
 else:
     parser.print_help()
     tl.error("parser")
 #--- check window ---#
 if (args.wd != None):
     wd = args.wd
 else:
     wd = 1
 if (args.swd != None):
     swd = args.swd
 else:
     swd = 1
 #--- check output ---#
 if (args.outfn != None):
     outfn = args.outfn
 else:
     parser.print_help()
     tl.error("parser")