Skip to content

Instantly share code, notes, and snippets.

View RemDelaporteMathurin's full-sized avatar

Rémi Delaporte-Mathurin RemDelaporteMathurin

View GitHub Profile
@RemDelaporteMathurin
RemDelaporteMathurin / coincidence.py
Last active April 18, 2025 14:11
coincidence count
import numpy as np
def coinc_2(Ch1_TIME, Ch2_TIME, Ch1_AMPL, Ch2_AMPL, t_window):
Ch1_TIME = np.asarray(Ch1_TIME)
Ch2_TIME = np.asarray(Ch2_TIME)
Ch1_AMPL = np.asarray(Ch1_AMPL)
Ch2_AMPL = np.asarray(Ch2_AMPL)
# For each Ch1 time, find window in Ch2 where match is possible
@RemDelaporteMathurin
RemDelaporteMathurin / read_unstructured_vtk.py
Created March 8, 2025 03:18
read unstructured vtk grid into dolfinx
import pyvista as pv
import numpy as np
import ufl
import basix
from dolfinx.mesh import create_mesh
from mpi4py import MPI
import dolfinx
# Define the points
points = [
@RemDelaporteMathurin
RemDelaporteMathurin / read_vtk.py
Last active March 8, 2025 02:54
convert vtk to dolfinx
import numpy as np
import dolfinx
import pyvista as pv
import basix
import ufl
from dolfinx.mesh import create_mesh
from mpi4py import MPI
xrng = np.arange(0, 20, 5, dtype=np.float32)
yrng = np.arange(0, 20, 5, dtype=np.float32)
@RemDelaporteMathurin
RemDelaporteMathurin / plot.py
Last active February 15, 2025 14:58
Registration Treemap for OSSFE2025
import pycountry_convert as pc
import pandas as pd
import plotly.express as px
from pypalettes import load_cmap
import matplotlib.colors as mcolors
cmap = load_cmap("blaziken")
# read registrations.csv
import matplotlib.pyplot as plt
import squarify
import pandas as pd
from pypalettes import load_cmap
from highlight_text import fig_text
dark_mode = True
cmap = load_cmap("Acadia")
@RemDelaporteMathurin
RemDelaporteMathurin / example_freezing.py
Created January 9, 2025 18:22
Example tritium release models with transient mass transport coefficients
from libra_toolbox.tritium.model import Model, ureg
import numpy as np
baby_diameter = 14 * ureg.cm # TODO confirm with CAD
baby_radius = 0.5 * baby_diameter
baby_volume = 1 * ureg.L
baby_cross_section = np.pi * baby_radius**2
baby_height = baby_volume / baby_cross_section
@RemDelaporteMathurin
RemDelaporteMathurin / sort_files.py
Created December 28, 2024 18:43
Script for sorting photos by date
import os
import shutil
from datetime import datetime
from PIL import Image
from PIL.ExifTags import TAGS
import sys
def get_exif_data(image_path: str):
image = Image.open(image_path)