Exemplo n.º 1
0
    if 0:

        foh = 0.01
        fhv = 0.02
        fvh = 0.01
        num_step = 2000
        noise_level = 0.2

        t_end = 50.0
        t = numpy.linspace(0, t_end, num_step)

        peak_t0 = 3.0
        peak_t1 = 7.0
        peak_max = 3.0
        a_array = simulate.triangle_bump(t, peak_t0, peak_t1, peak_max)

        peak_t0 = 9.0
        peak_t1 = 12.0
        peak_max = 3.0
        a_array = a_array + simulate.triangle_bump(t, peak_t0, peak_t1,
                                                   peak_max)

        peak_t0 = 12.0
        peak_t1 = 15.0
        peak_max = 2.0
        a_array = a_array + simulate.triangle_bump(t, peak_t0, peak_t1,
                                                   peak_max)
        acum_array = a_array.cumsum()

        o_array, h_array, v_array = simulate.run_fly_trap_model(
Exemplo n.º 2
0
    import pykalman
    from simulate import triangle_bump, run_fly_trap_model

    foh = 0.01
    fhv = 0.02
    fvh = 0.01
    num_step = 2000
    noise_level = 0.2

    t_end = 50.0
    t = numpy.linspace(0,t_end,num_step)

    peak_t0 = 3.0
    peak_t1 = 7.0
    peak_max = 3.0
    a_array  = triangle_bump(t,peak_t0,peak_t1,peak_max)

    peak_t0 = 9.0
    peak_t1 = 12.0
    peak_max = 3.0
    a_array  = a_array + triangle_bump(t,peak_t0,peak_t1,peak_max)

    peak_t0 = 12.0
    peak_t1 = 15.0
    peak_max = 2.0
    a_array  = a_array + triangle_bump(t,peak_t0,peak_t1,peak_max)


    o_array, h_array, v_array = run_fly_trap_model(foh, fhv, fvh, a_array) 

    a_array_w_noise = a_array + noise_level*numpy.random.randn(num_step)*a_array.max()