# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python [default]
#     language: python
#     name: python3
# ---

import gbeflow
import os
import bebi103
import bokeh.io
bokeh.io.output_notebook()
import matplotlib.pyplot as plt

import altair as alt

alt.data_transformers.enable('json')

from imp import reload

reload(gbeflow)

# # Data import and setup 

name = '20180110_htl_glc-CreateImageSubset-02_sc11_htl_rotate_brt'

# %%time
vf = gbeflow.VectorField(name)

vf.add_image_data(os.path.join('../data',vf.name+'.tif'))

p = vf.pick_start_points()

vf.save_start_points(p)

vf.starts

# # Test a variety of $\Delta t$ values

Ldt = [1,30,60,120,180]

for dt in Ldt:
    vf.calc_track_set(vf.starts,dt,name='dt '+str(dt),timer=False)

vf.tracks.head()

alt.Chart(vf.tracks
         ).mark_point(
        ).encode(
            x='x:Q',
            y='y:Q',
            row='track:N',
            color='name:N'
        )

fig,ax = plt.subplots(len(Ldt),2)
for j,dt in enumerate(Ldt):
#     ax[j,0].imshow(vf.img[0],cmap='Greys')
#     ax[j,1].imshow(vf.img[-1],cmap='Greys')
    
    for i in [0,1]:
        df = vf.tracks[vf.tracks['name'] == 'dt '+str(dt)]
        ax[j,i].scatter(df.x,df.y)

fig,ax = plt.subplots

StarcoderdataJupyterScriptsDedupFiltered