python4oceanographers

Turning ripples into waves

How well does iris "speak" Ocean Models?

The problem

Iris works great when loading 1D coordinates cube datasets mapped to a "regular" rectangular grid. But modern ocean models rarely falls into that description, they usually have 2D coordinates mapped to curvilinear staggered grids.

So how well does iris perform with modern numerical ocean models? How about the ...

Testing xray for ocean models output

xray is an interesting package that has been under my radar for a while.

According to the docs xray is:

... an open source project and Python package that aims to bring the
labeled data power of pandas to the physical sciences, by providing
N-dimensional variants of the core pandas data ...

New website using hyde

I am building a new website with Jekyll hyde, and this post consists of some notes for my future self.

(The website source is hosted on GitHub here, and the page is rendered as gh-pages here.)

Hyde is a python alternative for ruby's Jekyll. The project seems to be ...

Dissecando Análise de Componentes Principais

  • Warning 1: This post is written in Portuguese.
  • Warning 2: Most of what I have here I got from other posts/examples online. All links are provided and I encourage you to take a look at them.

A Análise de Componentes Principais (em inglês PCA) é o nome comum dado ...

Filtering out tides with pandas, iris and numpy

This is a short post on how to filter out tides from a time-series using pandas, iris, and numpy.convolve.

Our data consists of hourly measurements of currents, temperature and salinity as follows:

In [2]:
from datetime import datetime
from pandas import read_table

url = 'https://raw.githubusercontent.com/ocefpaf/python4oceanographers ...

Analyzing software dependencies with networkX

I wanted find out a minimal conda-requirements.txt file for my projects using only the information from the conda-recipes repository. In order to do that I had to parse all conda recipes, to extract the dependencies of each package, from my conda-recepis files.

A typical conda recipes file (meta.yaml ...

Gridding data part 2

(This post is the second part of Gridding data.)

In the first part we implemented a function to interpolate scattered observations to a grid. Our function took a correlation length and an estimated error and, using a fixed Gaussian correlation function, interpolate the observations to a rectangular grid. Remember that ...

Finding CF-standard Names

The CF conventions uses standard names for any variable stored using the CF-rules. I often find myself looking for possible names for a specific variable (e.g.: currents or temperature). Sadly, the answer is not that easy. Take a look at the CF Standard Names table and check confusion you ...