Posts from 2011-08

Buy Electronic Parts in the USA

If you need small electronic parts such as a AND gate in TTL logic, you may read on, how to find the parts you need and where to buy them.

To find out what part would fit your needs best, check out the manufacturers websites such as Texas Instruments:

Read on

Lenses for SLR and DSLR cameras

This is a table how the focal lengths of the old lenses for 35mm analogue SLR cameras translate to those of newer APS-C sized Canon image sensor based digital SLRs. I wrote this post to know about the equivalent focal lengths for my Canon Rebel T3 and my old...

Read on

Canon Rebel T3

The Canon Rebel T3, in Europe called EOS 1100D is the entrance level digital SLR camera from Canon. The kit comes with the Canon EF-S 18-55mm f/3.5-5.6 IS II lens.

The kit includes

  • EOS...

Read on

ezyfit - An Alternative to Matlab's Curve Fitting Toolbox

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 :

y = 30 +...

Read on

Handle 16bit TIFF Images in Python

There seem to be quite a lot of problems with 16-bit grey scale TIFF images (especially with the Python Imaging Library - PIL). If you can, you may want to use FITS instead of TIFF. There are good and up-to-date libraries for Python: PyFITS.

For me, however, the FreeImage...

Read on

hub teaches git about GitHub

Hub is a useful extension to make git GitHub aware.

catch lines:

hub introduces git to GitHub
hub teaches git about GitHub


brew install hub


See hub's webpage for introductory examples and its man page for further reference.


Read on


IPython: Productive Interactive Computing

IPython provides a rich toolkit to help you make the most out of using Python interactively. Its main components are:

  • Powerful interactive Python shells (terminal- and Qt-based).
  • Support for interactive data visualization and use of GUI toolkits.
  • Flexible, embeddable interpreters to load into your own projects.
  • Tools for high level...

Read on

Get a CLEAN installation of OS X Lion

There had been some concern that users can’t perform a clean install of Mac OS X 10.7 (Lion) as the upgrade comes without any physical media. You can, however, install Lion as an upgrade of your existing system first. The OS X Installer automatically creates a "Recovery HD" partition on your...

Read on

Use the Python Module MacFSEvents to Monitor Directories for Changes on Mac OS X

MacFSEvents is an up-to-date solution to monitor directories for changes on Mac OS X when using the scripting language Python. It is a binding to FSEvents, Mac OS X's filesystem monitoring framework.

Install MacFSEvents

pip install macfsevents


from fsevents import Observer, Stream


Read on

Make RS232 Serial Devices Accessible via Ethernet


The RFC 2217 standardizes the transmission of serial connection data via Ethernet, allowing to change remote serial port parameters (such as speed, parity, stop bits) over TCP using NVT (Network Virtual Terminal).


Connection between your serial device and the Ethernet

  • YPort - a hardware and software solution (microcontroller AVR ATmega based...

Read on

Light Wavelength from Energy

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."""

Read on

Physical Constants in Python

SciPy (updated to CODATA 2010)

Installation (easiest using pip):

  1. Install Fortran as described for your OS on (or via brew install gfortran on Max OS X)
  2. Install SciPy itself: pip install scipy


from scipy.constants import *
print "The Planck constant h:", <span...

Read on

Install matplotlib on Mac OS X

Installation of the pre-built binaries for OS X

Read Installing OSX binaries in the matplotlib Installation FAQ.

Installation via pip

This is a good way if you have an up-to-date Python installation on your computer and pip installed. It takes, however, some time (~ 20 mins for me) to install as it...

Read on

Easy Usage of XML with Python

The builtin Python modules to work with markup languages can be found on For XML these are mainly DOM (incl. minidom), SAX and ElementTree.

A comparison of minidom and ElementTree including good examples can be found on

Other than the default Python modules there is also a very...

Read on

Use the Python Module Watchdog to Monitor Directories for Changes

Watchdog is a cross platform solution to monitor directories for changes on Python and has been initiated by Yesudeep Mangalapilly. Very helpful is the readme file of the watchdog module.

Requirements and Installation

You may want to have a look at its source code on GitHub.

The dependencies of watchdog...

Read on

Watching Directories for Changes using Python : An Overview

Operating System Independent Solutions

Read on

Image Functions in Matlab

Matlab has several functions to handle images:

info = imfinfo(filename)
A = imread(filename)

Create an animated GIF image

x = 0:0.01:1;

Read on

Use XML files in Matlab

Here are the solutions I've found on the web:

Read on

P-Rocket XM-L 850+ Lumens Compact LED Flashlight

I bought this P-Rocket XM-L 850+ flashlight from ShiningBeam and it is really good and bright. This blog post serves as a reminder of its specifications and about the compatible batteries.

Possible Batteries

2x CR123A

Common Name Other Common Names IEC Name ANSI/NEDA Name Typical Capacity (mAh) / Nominal Voltage (V) Terminal layout Dimensions Comments
CR123A Camera Battery,...

Read on


ENUM can be used to find out if you can call someone via VoIP instead of a regular call when all you have is the phone number. It works by sending a DNS like query for the phone number.

Possible ENUM servers are:

  • official!

To query +43 780 004711 on run:


Read on

Install an Asterisk Server on Debian from Source

Get Requirements

We need gcc, g++ and some libraries:

sudo apt-get install build-essential libxml2-dev ncurses-dev

Get the source, compile and install

cd ~/Downloads
# get the source code
# untar it
tar -xf asterisk-
cd asterisk-
# clean the build directory (of crap from previous runs)
make distclean
# configure and compile Asterisk:
# install Asterisk...

Read on

Control the 6 channel Pfeiffer MaxiGauge TPG 256A pressure gauge controller via Python

update in 2014: The script from this blog post evolved into its own Python software repository on Github: pklaus/MaxiGauge. Please use that for the latest code and functionality.

original post:

I wrote a Python module for this pressure gauge controller. The module can be found on Using the module...

Read on

Access Serial Connections via LabView

To access devices that have a serial port using LabView, you should build a state machine (essentially a case structure inside a while loop, see this forum topic). More about that on



Read on

Tektronix TDS3054B 500 MHz 4 Channel Digital Phosphor Oscilloscope - with Python

One problem that I found out when trying to set the Tektronix TDS3054B up for network access is certainly a firmware bug: You can set the network adapter to get an IP address via DHCP or set it manually (the bug occurs on both). Let's say you choose to set the...

Read on

DAQScope PCI-5102

This is a 20 MS/s digital oscilloscope in the form of a PCI extension card. It is quite old.


Read on

Newport Motion Controller MM4006

The Newport MM4006 Motion Controller can control automated stages and stepper motors in general. It has a RS232 and a GPIB interface.

Remote Commands

Cf. chapter 3 of the manual.

Here are the most important remote commands:

  • MO to switch the motor control of the MM4006 on
  • XXPAYY absolute movement of motor xx to position...

Read on

Obtaining a Kansas Driver's License as an Alien on a J-1 visa

In this blog post I'm going to describe you how to obtain a driver's license in Kansas, USA. This is based on my experience in summer 2011.

First, you want to find a DMV office near to you. You can find...

Read on

Hamamatsu ORCA-Flash2.8 camera C11440-10C – Scientific CMOS Camera

Hardware Properties

Imaging details:

Image sensor Wavelength sensitivity Intensity of signal Frame rate at full resolution Exposure time Spatial resolution (pixel size)
type 2.8 megapixel scientific CMOS Visible Low light 45 frames per second 20 microseconds to 10 seconds 3.63 microns

More Technical Details:

Property C11440-10C
Imaging device CMOS image sensor FL-280
Wavelength (min.) 300 nm
Wavelength (max.) 1000 nm
QE (max.) 67%
Active pixels 1920(H) x 1440(V)
Pixel size 3.63(H) x 3.63(V)µm
Active sensor...

Read on

Sniff Serial Connection


Read on

Serial Port Terminal Applications

Mac OS X


Putty works!



install minicom:

sudo apt-get install minicom

use minicom:

minicom -o -s

How it works:

  • -o do not try to initialize a modem first
  • -s...

Read on

Stanford Research High Voltage Power Supply PS350 - Control via GPIB


The GPIB Interface

Example Session

Sent commands are marked using the symbol >. This character was not actually sent, it only serves to see if a line has been...

Read on

A PID Controller in Python


Read on

LabJack on Mac OS X

LabJack sells some nice ADC/DAC, digital I/O devices with quite good Linux / Mac OS X support. The cheapest products from LabJack are the U3 devices in the versions U3-LV (low voltage) and U3-HV (high voltage).

Exodriver - Native libusb low level driver

Python Module

Read on

Shimadzu 30-002 - Laminar-type Replica Diffraction Grating for the Soft X-ray Region

This is a fancy flat-field focusing, holographic grating as opposed to the previously used Rowland gratings.

Product Description

  • 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...

Read on

Adjust Spindown Time for HDDs on Mac OS X

If you want to adjust the spindown time of the hard disk drives of your Mac OS X based computer, you can simply run the following command (which will set the spindown from the default 10 minutes to 30 minutes for all HDDs on your system):

pmset -a spindown...

Read on