Fedor Baart Blog

Visualizing the Alcatraz escape

In the night of June 11, 1962 three inmates escaped from Alcatraz.
Here are some visualizations of the escape. This is work in progress. The model and visualizations are created together with Olivier Hoes, Martijn Siemerink and Gena Donchyts.
Created with 3Di, python-subgrid, matplotlib, VTK, cloudmade.

An overview

Escape at 10 PM

Escape at 0 AM

Escape at 2 AM

Escape at 4 AM

Python for engineers

These are some notebooks and the material used by the Python for Engineers course.

Name Size Creator Creation Date Comment  
PDF File presentation.pdf 5.27 MB Fedor Baart 29-11-2013 14:24 Presentation
File Weibull Symbolic.ipynb 21 kB Fedor Baart 19-11-2013 15:16    
File 1d diffusion.ipynb 33 kB Fedor Baart 19-11-2013 15:16    
File Excel example.ipynb 56 kB Fedor Baart 19-11-2013 15:16    
File OO and statistics.ipynb 405 kB Fedor Baart 19-11-2013 15:16    
File starter.ipynb 9 kB Fedor Baart 19-11-2013 15:16    
File Signal.ipynb 41 kB Fedor Baart 19-11-2013 15:16    
L&R python lunch lecture

This is the lunch lecture that I gave at the L&R faculty.

One of the questions that came up was what the preferred way is to install python on OSX. This was related to some recent problems that people had with the latest version of OSX. Some of the issues that you can run into while installing extra packages are a missing png library issue and missing compilers .

Some of the options you have under OSX are, in my personal order of preference:

You probably don't want to use the python version that comes preinstalled with OSX. Using one of the other options keeps your python environment separate from your system environment and you'll have a more recent python version.

You can also use virtualenv to use multiple different python environments.

You need flash player installed to preview ppt and pdf files

Get Adobe Flash player

Interactive model
Name Size Creator Creation Date Comment  
Multimedia File 2013-02-18_1729.swf 26.60 MB Fedor Baart 18-02-2013 17:36 Interactive modelling  
Example of Jakarta sea-level using the R sealevel package

This is an example of how to use the sealevel R package. This package is part of OpenEarth and available through r-forge for the convenience of R users. See Trends in Sea-Level Trend Analysis for a discussion on sea-level trend analysis.

This example generates an overview of tide gauges near Jakarta and generates a plot of the measurements of the nearby stations.

Labels: sealevel, r
R sealevel package now available from r-forge

I just made the sealevel R package, which we used for the sea-level rise articles, available. It provides some functions to quickly download, read and analyse the global tide gauges and satellite data.
All suggestions, patches, comments are welcome. This package is part of OpenEarth but available through r-forge for the convenience of R users.


The code below generates the plot of the Dutch tide gauges.

Notice that after the last 6 years of (average) sea-level decline we are about to see a rising sea level at the Dutch coast again for the next 12 years.

Labels: sealevel
Sea level trends

This presentation was given at the Deltares statistics community lunch lecture. It discusses some best and worst practices in estimating sea-level rise. The presentation is based on two articles:

Name Size Creator Creation Date Comment  
PDF File present.pdf 28.89 MB Fedor Baart 13-05-2012 21:37 Presented at statistics community at Deltares
Aeolian transport at EGU 2012

At the EGU, in the session about aeolian transport , we presented the integrated coastal model.

Please find the EGU Aeolian transport presentation in the attachments.

You need flash player installed to preview ppt and pdf files

Get Adobe Flash player

More info can be found here:
Sourcecode: http://oss.deltares.nl (under xbeach, info on compiling)
Dune: http://www.comphys.ethz.ch/hans/dunes.html

Name Size Creator Creation Date Comment  
PDF File present.pdf 13.00 MB Fedor Baart 28-04-2012 11:27  
Compiling dunexbeach under Windows

If you want to compile the coupled version of Dune and XBeach under windows you need the following.

  • Cygwin (including gfortran, gcc, libtool, automake, libfftw3-devel, libfftw3)
  • MPICH2 source code release
  • netcdf>=4.1 source code
  • The following XBeach branches:
  • trunk
  • branches/esmf
  • branches/dune/Muller
  • branches/XD_XB_coupling

You can follow these steps:

  • Install cygwin
  • Compile MPICH2 using gfortran and make install (check if mpif90 is available)
  • Compile netCDF using gfortran and make install (check if nc-config is available)
  • Compile XBeach (--with-netcdf --without-mpi, mpi is not supported yet ), should generate a file called libxbeach.la
  • Compile dune in branches/dune/Muller (should generate a file called libdune.la)
  • Compile esmf (use settings like in settings under condition wl01485) (should generate a file called esmf.mod)
  • Compile XD_XB_Coupling (double check the Makefile.am, to see if it uses the correct locations for the libraries that were made in the previous steps). (should generate a file called xdunexbeach)

Setting up a simulation:

  • Create a directory with both dune and xbeach input (default.par, data/, params.txt)
  • Create a coupler setup file (see examples in coupler directory)
  • run xdunexbeach from the current directory.

Run the command path/to/xdunexbeachdir/libtool --mode=execute gdb path/to/xdunexbeachdir/xdunexbeach.

Creating illuminated lines

If you want to give your plots a bit of a high tech look you can use a green phosphor style.
Let's try and create some illuminated storm tracks. The basic technique is to draw a line with a glow around it. This can be done by plotting transparent lines on top of each other. Below you see the basic glow effect. It is a bit exaggerated but it still looks ok.

Now make the lines a bit smaller.

When you create more than about 1000 lines there's no need to add the background lines anymore.
I got the dataset from NOAA

2 Comments  |  Labels: plotting, glow, lines
Calling fortran from python

Calling fortran from the outside world. Using iso_c_bindings this is a bit easier. Here you can find some fortran examples and see how you can call these functions from python using ctypes and numpy.

The fortran code.

The corresponding python code.

Reconstructing an 18th century storm using paintings

The following paper was just published in NHESS. It was a cooperation between TUD, Deltares and TNO.

Abstract: For the design of cost-effective coastal defence a precise estimate is needed of the 1/10 000 per year storm surge. A more precise estimate requires more observations. Therefore, the three greatest storm surges that hit the northern part of the Holland Coast in the 18th century are reconstructed. The reconstructions are based on paintings, drawings, written records and shell deposits that have recently appeared. The storm-surge levels of these storms have been estimated using numerical modelling of the coastal processes. Here we show how these reconstructions can be used in combination with extreme value statistics to give a more confident estimate of low probability events.

Using 18th century storm-surge data from the Dutch Coast to improve the confidence in flood-risk estimates

Mini-symposium Nederlandse Commissie voor Geodesie

This is the presentation I gave at the mini symposium. I discussed the trends in sea-level trend analysis.

Name Size Creator Creation Date Comment  
PDF File present.pdf 23.53 MB Fedor Baart 12-10-2011 11:34 Presentation for the Dutch Geodetic Committee
XBeach XDune coupling

I'm currently working on the XDune XBeach coupling.


The test case, which Jaap set up, is located at https://repos.deltares.nl/repos/XBeach/branches/XD_XB_coupling/tests.


The following tasks can be separated:

  • Create an XBeach library https://repos.deltares.nl/repos/XBeach/branches/fedortmp
    I plan to merge this into the trunk, but it would be convenient for maintenance if we'd merge the libxbeach.F90 and xbeach.F90 and apply the library by default approach (xbeach.F90 depends on libxbeach.F90).
  • Create an XDune library https://repos.deltares.nl/repos/XBeach/branches/dune
    We still have to merge back changes to the main dune line, for better cooperation with the dune people. I have to check the revision and what Martijn Muller checked in.
  • Create a fortran and c compatible interface for XBeach. The libxbeach wrapper exposes all functions using iso_c_binding. The most incovenient of this is that you have to pass the string length to character functions, not sure how to prevent this.
  • Create a fortran and c compatible interface for XDune (https://repos.deltares.nl/repos/XBeach/branches/dune). I first created a simple c compatible library (wrapper.cc) but found that the trick I used for exposing pointers to c++ classes (as part of a c structure) was not compatible with fortran. I switched to a version with a global model and global parameters. This is ugly but I have not figured out a better way yet.
  • Create an ESMF wrapper for XBeach (gridded component) https://repos.deltares.nl/repos/XBeach/branches/XD_XB_coupling/esmf_xd_xb_coupler I created a gridded component earlier. It seems to work fine. I moved it from the xbeach directory to the xd_xb coupling directory to keep all esmf specific code together and out of the XBeach trunk.
  • Create an ESMF wrapper for XDune (gridded component) https://repos.deltares.nl/repos/XBeach/branches/XD_XB_coupling/esmf_xd_xb_coupler. I have implemented most of the code. The only part that is missing is the grid. I have to look into how the grid is defined and map that to the ESMF types.
  • Create a coupler https://repos.deltares.nl/repos/XBeach/branches/XD_XB_coupling/esmf_xd_xb_coupler The coupler and app are running. Features that are missing are configurable time, output and timestep definitions
  • Test data exchange. I'm still missing the grid of dune so I can't match the grids. I'm discussing with ESMF user mailling list on how to best implement the rotating grid.
  • Test timestep. Timesteps of both Dune and XBeach align (tested for cases where dune has timesteps >= esmf timestep)
  • Test on h4 (not done)
Journal of Coastal Research bibtex style file (.bst)

There was no latex style file available for the Journal of Coastal Research. Below you can find a .bst file that you can use to format your bibliography in the style of JCR.

You can use the file like this:

The file is made using the jcr.dbj file that is also attached. If you want to make some changes, change the jcr.dbj file and call:

This will result in a new jcr.bst file.

For formatting the rest of the latex file you'll also need the following macros:

After using this your paper is pretty much well formatted, except from some details in section header formatting. I didn't know how to fix these so I did those by hand.

Name Size Creator Creation Date Comment  
File jcr.dbj 27 kB Fedor Baart 03-10-2011 14:47 Journal of Coastal Research bibtex style docstrip source file  
File jcr.bst 30 kB Fedor Baart 03-10-2011 14:46 Journal of Coastal Research bibtex style file