Tag: python

Polygon | 2.0.4 & 3.0.4

New versions of my python package Polygon have been released today for python 2 and python 3. The source can be checked out from https://svn.origo.ethz.ch/polygon/tags/2.0.4/ and https://svn.origo.ethz.ch/polygon/tags/3.0.4/ , binary packages will follow in the next days. The changes include: added a function Utils.gpfInfo() to check files for the number of contours, holes and points and…


Reading dymolas mat-files with python

INFO: This post is outdated! Please have a look here. Dymola stores its simulation results in regular mat-files, but the program uses a special variable structure to store the data efficiently. An easy way to access the data is MATLAB, but I was looking for a more pythonic solution. If you want to access the…


How to convert a csv file to netCDF with 7 lines of python code

When preparing files for the ncDataReader2 I often have to convert text files that contain values separated by TABs or commas. In most simple cases this can be done with some lines of python code. An example is here: import sys, pupynere ll = [l.strip().split(‘,’) for l in open(sys.argv[1]) if not l.startswith(‘#’)] vv = zip(*[map(float,…


Polygon | reading and writing gpc files

A user pointed me to a problem when reading and writing gpc files. GPC understands two kinds of files, with or without hole-flags. Polygon supports both formats, but this was not yet documented. When using the Polygon() constructor with a filename or the read() or write() methods you may specify an optional  second boolean argument….


Making Windows work – free software essentials

Although working mostly with linux  I need to install or to use a MS Windows machine from time to time. Being spoiled by the large amount of software available for linux I really miss a lot of functionality on a “naked” windows computer. After the installation and update process of windows I usually install a…


Polygon | 2.0.3 & 3.0.3

Versions 2.0.3 and 3.0.3 of this python package have been released today. Both branches 2.0.x (for python 2.x, x>=5) and 3.0.3 (for python 3.x)  will be in sync in the future with identical features and an  almost identical API. For 2.0.3 only one new function (tileBSP()) was added. Have a look here for more information….


Reading Arexx TL-500 with Python on Linux – Part II

My first script was changed a little bit to get nicer output. It can now log the raw data received from the Arexx unit (in hexadecimal form) and uses separate log files for the sensors. Sensor numbers can be mapped to other names using a dictionary. I use two TL-3TSN, one TSN-50E (long range) and…


Reading data from the Arexx TL-500 on Linux

Some days ago I was looking for a temperature monitoring solution for some rooms and 19″-racks at the university. The Arexx TL-500 looked promising and I bought it. Unfortunately there are only Windows drivers available. But some people already analyzed the communication protocol and hacked a simple version of a linux driver: http://www.algorithm-forge.com/techblog/2010/01/linux-usb-driver-for-the-arexx-tl-500-part-ii/ There’s even…