Skip to content

Instantly share code, notes, and snippets.

@tjlane
tjlane / find_edges.py
Last active December 12, 2015 08:08
Simple filter for noise for CSPAD data. Good for finding the center.
import numpy as np
from scipy.ndimage import filters
def find_edges(image, threshold=0.01, minf_size=3, medf_size=10):
"""
Applies an edge filter followed by a noise reduction filter. Very good
at locating powder rings and filtering everything else out.
Parameters
----------
@tjlane
tjlane / score.py
Created February 15, 2013 17:10 — forked from anonymous/score.py
"""
This file contains methods to score a geometry optimization method against
known standards: AgBe, Ag.
"""
import numpy as np
from scipy import optimize
@tjlane
tjlane / correlation benchmark(1).ipynb
Last active December 16, 2015 04:48
correlation benchmark
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tjlane
tjlane / Simulate onto polar detector.ipynb
Last active December 16, 2015 08:49
A quick intro to doing x-ray scattering simulations using thor's Rings class.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tjlane
tjlane / install_odin_dep.sh
Created May 14, 2013 17:03
quick install script for Odin's less common dependencies
# this will install some of the less common dependencies for Odin
# assumes you have:
# -- numpy
# -- scipy
# -- matplotlib
# note you might have to upgrade the below if you already have them
# in that case, do "$ pip install -U <package-name>"
@tjlane
tjlane / fit_ellipse.py
Last active December 17, 2015 08:29
Perform a simulation on a tilted detector using Odin.
"""
Some simple functions TJ was using to fit ellipses. May be
useful, may not be.
"""
import numpy as np
from scipy import optimize
@tjlane
tjlane / run_water_sim.py
Created June 14, 2013 04:37
TJ's attempt to run Lee-Ping's water model in OpenMM 5.1
#!/usr/bin/env python
"""
Run a simple water simulation.
"""
from __future__ import print_function
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
@tjlane
tjlane / cheetah_pixmap_to_odin.py
Created June 17, 2013 00:03
This script converts cheetah pixelmaps from the explicit-pixel cheetah format (which stores the x/y/z values for each pixel) to an Odin Detector object, which employs a basis representation.
#!/usr/bin/env python
"""
This script converts cheetah pixelmaps from the explicit-pixel cheetah format
(which stores the x/y/z values for each pixel) to an Odin Detector object,
which employs a basis representation.
-- TJL June 2013
"""
@tjlane
tjlane / Computing Dihedrals.ipynb
Created June 22, 2013 06:50
How to compute dihedrals in msmbuilder.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.