Posts with the tag scientific calculations
I want to run popcount on a large set of 144-byte-long bytearrays. Doing so in Python can be a pita! First, I was using the naive approach with
bin(b).count('1') but it was very slow. I did some research on the internet for faster algorithms and I found some. But running...
False color (or more exactly pseudo color) can be useful when a device / detector records a grayscale image and a human has to interpret it. Fine differences are hard to see in grayscale images und a false color mapping allows us to map the 255 shades of gray...
First, you need to install XCode 4 which can be found in the Mac App Store. You need it because it's providing the compiler and the git binary. Then install Homebrew using
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)".
Installing ROOT using
make is fairly easy. I recommend the...
ezyfit can prevent you from buying the Curve Fitting Tool that Matlab does not come with by default. This is how I use it to fit data according to a function :
x=15:45 y = 30 +...
You can use the following Python function to convert a photon energy (in electron volts) to the corresponding wavelength (in nano meters):
def wavelength_from_energy ( electron_volts): """Returns a photon wavelength in nm from a photon energy given in eV.""" ...
SciPy (updated to CODATA 2010)
Installation (easiest using
- Install Fortran as described for your OS on http://www.scipy.org/Installing_SciPy (or via
brew install gfortranon Max OS X)
- Install SciPy itself:
pip install scipy
from scipy.constants import * print "The Planck constant h:", <span...
This is a fancy flat-field focusing, holographic grating as opposed to the previously used Rowland gratings.
- Aberration-corrected Laminar-type Replica Diffraction Gratings for flat-field Polychromators in the range of Extreme Ultra-Violet Light(EUV:13nm). Suitable for the next generation of semiconductor lithography.
- Less high order light due to laminar type grooves configuration, Low...
Estimate the transform limited beam duration of a laser pulse from its spectral width in nm in Python
Here are a couple of Python functions to find the minimum duration of a gaussian pulse with a certain spectral FWHM (measured in nm) at a given central wavelength plus the...