Python CSV Plotter

During my Master Thesis I had to deal a lot with CSV files coming from different sources. If I just wanted to quickly peek into them I always had to open them with matlab to plot them.

I decided to write a Python script which could simply plot CSV files on the fly from the console. Different devices generate different CSV files, therefore there is a need to specify in which format (i.e. how many header lines there are and in which columns the different data are). For each different device there is a flag you can set. All the options can be seen by starting the script with the --help flag.

You might want to add the script to your Pythonpath so that you can easily access it from anywhere 😉

Things still to be done:

  • Here I assume that the x axis is always the time in seconds while the y axis is always in Volt. It would be nice to be able to specify those things for the plot.
  • An automatic format recogniser would be handy (and not that difficult to write)
  • A small GUI to select the file instead of having to use the terminal

Image converter

Here a handy Python script to convert/resize pictures


Git Checker Script

I often have the problem that I forget to commit changes I do in my git repositories. Further, working on more than one PC, I have the much bigger issue that I forget to push my commits to my remote. To solve this problem, I wrote a script which looks into my local git repositories and tells me if there is some modified file or some unpushed commit.

A configuration file stored in my home directory lists all the git repositories and the relevant branches I want to monitor. The script performs three checks:
1) With a git ls-files -m the modified files are located
2) With a git ls-files --others --exclude-standard the untracked files are detected
3) Finally, a git log origin/branch..branch checks if there is an unpushed commit

The source code can be found here.

I'm planning on adding a simple icon in the statusbar to indicate the status of the git projects. I'll keep you updated.

Filed under: git

KiCad Resistor Library generator

Im currently developing a circuit using KiCad. I'm trying to prepare my PCB for production and I'm facing the classic problem of library management of PCB design tools. Should I have a general component and add the Manufacturers Part Name and Footprint afterwards for every component? Or have a component for every value and footprint in my library? I opted for the second one. It might seem a little tedious but I guess the initial work will pay off.

I could add a component manually every time I need a new one or generate the whole library with a script, guess what I've decided...
The basic idea is to have a template resistor and add it to the library with its properties: Value, Manufacturer Part Name, footprint and Description.
I'm not yet 100% sure what the value of the resistor should be: r_0603_1k? 1k_0603? I will see what the best option is after using it for a while, the cool thing of having a script it that it can be easily changed later 😉

Library Format

How does the KiCad library look like? Details can be found here. I'm not going to read the description, I opened a  normally created library containing two resistors to see what repeats.

Manufacturer Part Name Format

For my standard resistors I decided to use the D11/CRCW0603 E24 series from Vishay. The Manufacturer Part Name format is as follows:

The VALUE is has 4 positions, allowing the following multiplier: R (x1), K (x1'000) and M (x1'000'000).
A 1K Ohm resistor has the VALUE 1K00, the unused values are padded with zeros.


I then wrote a script to generate the Manufacturer Part Name based on the E24 resistors between 1 Ohm and 10 MegaOhm.

The code can be found here. Some settings like your preferred footprint and output location have to be adapted in to optimally work for you. Afterwards you can execute the script and smile :)

\LaTeX plots from CSV files with pgfplots

plots from CSV files with pgfplots">

First of all we need a CSV file. I have one in which the third column (beginning to count at 0) contains time values and the fourth one contains some time dependent data. Then we need to make sure that the packages pgfplotstable and pgfplots are installed. The former is needed to read CSV files and the latter to generate the nice plots.

At some point in our code we can then insert the following code:



Charging capacitor curve fitting in matlab

How to get the time constant and the amplitude of a charging capacitor?

In this example I'll show you how to estimate the two parameters in matlab.

We know that the curve follows an exponential function:

v(t) = A\cdot\left(1-e^{-t \cdot b}\right)


The first thing we do, is to generate a data set:

we add some noise to the signal in order to make it more realistic. Usually you would get the data from your scope in a csv file format an import it.

The second thing we do, is to call the fitting function. As parameter we give the curve function.


We see that matlab fitted our function very nicely. In fit1.a amd fit1.b we can see the fitted values, which correspond to our given amplitude and charging constant.

But what if our recording does not start with an empty capacitor? We simply shift our time values  with an additional parameter c:


Counter Strike 1.6 Launcher wine


Ubuntu Eagle CAD desktop entry


ZHAW add a printer on Ubuntu

  1. Log in to smb:// via nautilus (ctrl + L) and save your credentials forever (I think this is needed in order to be able to access to the printer, set the Domain to ZHAW)
  2. In System Settings -> Printers add a new printer
  3. From "Network Printer" select "Windows Printer via SAMBA"
  4. Add the URL of your printer smb://zhaw/panther/pr-bw-XXYYY-Z and do not set the authentication
  5. Click "Forward" and select "Provide PPD file" if you have the PPD file or select a printer from the database if it is available

Tested under Ubuntu 14.04 64bit

Blaue Cumulus Bons selber ausdrucken

Verlorene Cumulus Bons selber ausdrucken:

  1. Sich auf der Cumulus Plattform einloggen
  2. Unter "Blaue Cumulus-Bons" die Nummer des Bons kopieren
  3. Auf dieser Webseite die Nummer des Bons ins "Data" Feld einfügen
  4. Bei Barcode den Typ "Code-2of-5 Interleaved" auswählen
  5. DPI auf 300 erhöhen (sicherheitshalber)
  6. Barcode generieren lassen und herunterladen
  7. Ausdrucken auf zirka 4 cm Länge