Tag: programming

DyMat | Reading Modelica results with python

The simple module has turned into a complete python package including a script, documentation and more output options. This package is released under the BSD License.  The development is hosted on github.com, feel free to contribute! Project homepage: http://www.j-raedler.de/projects/DyMat Development hosting: https://github.com/jraedler/DyMat Highlights: documentation (well,  some …) command-line script DyMatExport export to CSV, Gnuplot, MATLAB…


DyMat

| View all articles regarding DyMat | This package contains some modules to read and process the result files from Dymola and OpenModelica with python. A script is included that will help you to browse and export the contents of these files to other formats. Both simulation systems save their results in regular mat-files, but…


Polygon | new package 3.0.4a

The source  package for Polygon 3.0.4 was missing a lot of files. This was caused by a bug in python’s setuptools package. I packaged a new file for version 3.0.4a . The source code was not changed but the contents should be complete now. Sorry for any problems you had with this issue!


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…


Polygon used in new VPython

I’m glad to see that the Polygon package is now used by the popular VPython software to support the creation of the new extrusion objects. The VPython authors even made a special license agreement that allows the use of GPC (and thus Polygon) free of charge for every purpose as part of the VPython distribution:…


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,…


ncDataReader2 | 2.2.4

A new release 2.2.4 of ncDataReader2 is out. Some bugs were fixed and the API has slightly changed. This version should work both with Dymola and OpenModelica on Linux and Windows. When you have a DAP-enabled netcdf library  it will even fetch data from the web in background. I already did some Dymola simulations with…