Skip to content

Instantly share code, notes, and snippets.

View trbritt's full-sized avatar
⛓️
on chain

Tristan Britt trbritt

⛓️
on chain
View GitHub Profile
@trbritt
trbritt / process_wafers.py
Created August 23, 2023 21:02
A quick diagnostic for the WIK wafer dataset
import pickle
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from tqdm import tqdm, trange
from scipy.ndimage import zoom, binary_fill_holes
from skimage.color import label2rgb
from skimage.filters import sobel
from skimage.measure import label
#Libraries
from pyueye import ueye
import numpy as np
import pyqtgraph as pg
from scipy.signal import savgol_filter
import warnings
from contextlib import contextmanager
class uEye_camera:
def __init__(self, HID=0):
@trbritt
trbritt / generate_parametric_curve_Blender.py
Created August 16, 2022 19:47
Generate parametric curve from a functional form in Blender. User defined functions are implemented.
"""
Create a Blender curve from a 3D parametric function.
This allows for a 3D plot to be made of the function, which can be converted into a mesh.
I have documented the inner workings here, but if you're not interested and just want to
suit this to your own function, scroll down to the bottom and edit the `f(t)` function and
the iteration count to your liking.
This code has been checked to work on Blender 2.79 and Blender 2.80b.
@trbritt
trbritt / generate_3d_surface_blender.py
Created August 16, 2022 19:45
Generate a 3D surface from 2D array (with 1D X and Y arrays for location and scaling) and create corresponding object in Blender
#!/usr/bin/python
"""\
3D plot of all spectra in a single 2D scan, using Blender to render surfaces.
Must have Blender installed. Uses bundled version of Python.
Requires Blender
Usage:
Unless you build Blender yourself as a stand-along package, your scripts