Skip to content

Instantly share code, notes, and snippets.

View alexlib's full-sized avatar
:octocat:
Working

Alex Liberzon alexlib

:octocat:
Working
View GitHub Profile
@alexlib
alexlib / settling_velocity_app.py
Created May 26, 2024 19:38
Streamlit app that estimates settling terminal velocity of a sphere
import streamlit as st
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
def drag_coefficient(Re):
"""Calculate the drag coefficient using the empirical correlation."""
if Re < 1:
return 24 / Re
elif Re < 1000:
@alexlib
alexlib / post_processing_trajectories.ipynb
Created February 28, 2024 14:05
Post processing, linking and plotting in 3D trajectories created by OpenPTV using Flowtracks (aka postptv), pandas and plotly
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlib
alexlib / trackpy_4view_spliiter.ipynb
Last active May 24, 2023 17:16
trackpy, pims, matplotlib and imageio to get movie with tracks from particle movies
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlib
alexlib / embed_video.tex
Created April 22, 2023 11:01 — forked from FedericoTartarini/embed_video.tex
Embed a video into LaTeX wihout using Flash
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \embedvideo{<poster or text>}{<video file (MP4+H264)>}
% \embedvideo*{...}{...} % auto-play
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[bigfiles]{pdfbase}
\ExplSyntaxOn
\NewDocumentCommand\embedvideo{smm}{
\group_begin:
\leavevmode
@alexlib
alexlib / pivpy_plot_vorticity.ipynb
Created March 28, 2023 20:20
pivpy_plot_vorticity.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlib
alexlib / openvpiv_test.ipynb
Created March 15, 2023 09:53
openvpiv_test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlib
alexlib / graph.py
Created December 9, 2022 06:15 — forked from aasensio/graph.py
import napari
import numpy as np
import matplotlib.pyplot as pl
import h5py
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
#from qtpy.QtWidgets import QApplication, QMainWindow, QPushButton, QMenu, QVBoxLayout, QSizePolicy, QMessageBox, QWidget, QPushButton
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import sys
import streamlit as st
# streamlit preparation
st.title('Four dependent sliders')
# Session state callbacks
def callback_x1():
"""The callback renormalizes the values that were not updated."""
# Here, if we modify X1, we calculate the remaining value for normalisation of X2, X3 and X4
remain = 100 - st.session_state.x1
@alexlib
alexlib / another_attempt.ipynb
Last active November 28, 2022 09:32
Create colored vector field on image background using napari, based on https://napari.org/stable/gallery/add_vectors_color_by_angle.html
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexlib
alexlib / pivpy_read_vec_files.ipynb
Created November 3, 2022 16:26
pivpy_read_vec_files.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.