# Optimizing code for iso-surfaces using Fortran, Cython, and Numba

A very common operation for ocean modelers is to extract an iso-surface from 3D the model results. The application ranges from fancy isopycnals 3D views to simply getting any variable sliced at some arbitrary depth.

In this post I will explore a few different ways compute iso-surfaces. First we have ...

# Using get_variables_by_attributes with xray

In my last post I showed the new get_variables_by_attributes method that will be available in netCDF4-python 1.2.0. But what if you want to use that now? You can just copy the method as a local function and change the self argument to take the the netCDF4.Dataset (nc ...

# netCDF4 python and the get_variables_by_attributes

netCDF-Java users like to brag about the Get by Attribute method in the Java version of the netCDF library. This method allow the user to query for using the information in the variable attribute. That is much better than browsing the all variables names to find what you need. I ...

# An open source story: from the classroom to a bug fix

Last week I had the pleasure of teaching my first Software Carpentry Workshop at UFBA. After the 2-day workshop we had another 3 extra days of python training for oceanographers.

We did not had internet connection for the workshop, nor a room with enough power outlets. That was a bummer ...

# Iris "hidden" feature

I had to create a figure showing the data used to create the World Ocean Atlas climatology (WOA). WOA has that information in each file already, so that part was easy. Let's check the metadata:

In [3]:
import iris

url = ('http://data.nodc.noaa.gov/thredds/dodsC/woa/WOA09 ...

# Beer Cake

## Ingredients

### Dough

• 250 g butter
• 1 cup of pilsen/larger beer
• 250 g flour
• 1 cup cocoa
• 1 3/4 teaspoon baking powder
• 1/2 teaspoon salt
• 1 teaspoon sodium bicarbonate
• 2 eggs
• 2 teaspoon vanilla extract

### Topping

• 400 g cream cheese
• 2 teaspoon vanilla extract
• 1 cup of butter ...

# Three ways to make a choropleth

Making choropleths is fun. I will leave at that! Want more explanation? Follow this link.

In this post I will show three way to create choropleths with Python. The Good, the Bad and the Ugly (or in the original: Il buono, il brutto, il cattivo)!

The Ugly: geopandas

Choropleths with ...

A common task when plotting data on a map (or reduce the number of points in KDTree search ;-) is to mask either the land or the oceanic part of the data. In this post I will show how to do mask land using a shapefile and shapely.

Let's start ...

I saw an issue on GitHub over the weekend that got me thinking: how does one read non-standards dates from dataset like simulations of Earth past climates?

I will use an example of a common dataset out there in the wild for this post. Let's try to read it ...

# Reading GPX files directly with fiona

In a previous post I said I would try to build a GPX loader for GeoPandas. If you try to load a GPX file right now this is what you get.

In [3]:
import geopandas as gpd

fname = './data/2014_08_05_farol.gpx'