Greenland sunset

Welcome!

I am a physical oceanographer interested in how ocean water is mixed and transformed. I am a Research Scientist at the Bedford Institute of Oceanography in Halifax, Nova Scotia.

Recent Posts:

Migrating this site from Github+Jekyll to Netlify+Hugo (with the amazing blogdown package) 2020-08-30 When updating my blog last week, for the first time this year, I was reminded that while I have really liked being able to use Github pages combined with jekyll to build a free static blog/website, maintaining the jekyll dependencies and ensuring that I can locally build my site on a number of different computers/OSes has turned out to be a bit of a pain. Lately it has seemed that every time I go to make an update, something was broken and I would have to spend an hour or so Googling how to fix it, only to have to go through it all again when I updated from a different computer. ...
A new default colormap for the `oce` package 2020-08-17 Introduction A lot has happened since my last post (and really, I mean A LOT). However, in the spirit of that last post, one good thing that has happened is that in the upcoming 1.3-0 release of the oce package on CRAN we have changed the default colormap (or “palette” as it’s often referred in the R world) to something not nearly sucky as the classic “jet” colormap (originally made popular by Matlab). ...
Discrete colorbars with R and the oce package 2019-12-28 Introduction Making plots in oceanography (or anything, really) often requires creating some kind of “color map” – that is, having a color represent a field in a plot that is otherwise two-dimensional. Frequently this is done when making “image”-style plots (known in MatlabTM parlance as “pcolor” or pseudocolor plots), but could also be in coloring points on a 2D scatter plot based on a third variable (e.g. a TS plot with points colored for depth). ...
CO2 concentration at birth 2019-12-27 Introduction There is a recent trend in places like Twitter to include in your bio the atmospheric CO2 concentration when you were born. I like it, since it is both a neat measure of the range of ages of people that you can interact with (without being really about age per se), and also since it is a sobering reminder of just how much damage we as a species have done in a very short amount of time. ...
A perfect CTD profile 2019-11-14 I love the \(\tanh\) function. A lot. It’s such a perfect model for a density interface in the ocean, that it is commonly used in theoretical and numerical models and I regularly used it for both research and demonstration/example purposes. Behold, a \(\tanh\) interface: \[ T(z) = T_0 + \delta T \tanh \left( \frac{z-z_0}{dz} \right) \] T <- function(z, T0=10, dT=5, z0=-25, dz=5) T0 + dT*tanh((z - z0)/dz) z <- seq(0, -60) plot(T(z), z) But whenever I use it, especially for teaching, I’m always saying how it’s idealized and really doesn’t represent what an ocean interface actually looks like. ...
Negating functions and function definitions: an 'opposite' function to the wonderful `%in%` operator 2019-11-13 Introduction R has some neat functions, and even some weird quirks, that you aren’t likely to discover on your own but can either be immensely helpful or horribly confounding. For example, the “+” operator (i.e. addition) is actually a function, and can even be called using the typical “bracket” notation: 1 + 2 ## [1] 3 We can use backticks to evaluate the function as a “regular” function: `+` ## function (e1, e2) . ...
A Shiny app that uses 'reactive' data 2019-10-21 Introduction A powerful, and increasingly useful, tool available to users of R, is the interactive app package known as Shiny. Shiny provides a framework for building interactive web apps that can be used for visualization, exploratory data analysis, data quality control – really anything that could benefit from an interactive environment. This post will not go into the basics of Shiny. There are many resources on the web for getting started, and of particular value is the RStudio Shiny gallery. ...
Using the oce package to make nice maps 2019-07-12 Introduction Making maps is a pretty important part of doing, and presenting, ocean data analyses. Except for very small domains, using map projections is crucial to ensure that the map is not distorted. This is particularly true for polar and high latitude regions, such as the Arctic (where I do much of my work). In this post I will give a brief introduction to making projected maps with the oce package, including not just the land/coastline but also various ways of plotting the bathymetry. ...
The (ocean) physics of The Ocean Cleanup's System 001 2019-01-06 Introduction The Ocean Cleanup, brainchild of Dutch inventor Boyan Slat, was in the news again this past week after announcing that in addition to the fact that their system is unable to collect plastic as intended, it suffered a mechanical failure. “Wilson” is currently being towed to Hawaii, where it will undergo repairs and upgrades, presumably to be towed back out to the garbage patch for a second trial. ...
Recording and replaying plots with the `recordPlot()` function 2017-12-11 This post is not going to focus on anything oceanographic, but on a little trick that I just learned about using base graphics in R – the recordPlot() function. R plot systems First, for those who either don’t use R or who have been living under a rock, there are (in my opinion) two major paradigms for producing plots from data in R. The first is the original “base graphics” system – the sequence of functions bundled with R that are part of the graphics package which is installed and loaded by default. ...