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:

Using the oce colormap function in R 2016-04-09 When I talk to fellow colleagues about why I use R as my language of choice for scientific data analysis, I typically point out all the advantages, and because I’m honest, the disadvantages. Typically the biggest disadvantage, especially for those coming from the java-GUI world of Matlab, is the non-interactive graphics. Now, I’ve managed to convince myself that I actually prefer making plots this way (because it forces me to script rather than noodling around with a mouse, the final plot is predictable, etc), but there are always a few things that I wish were easier. ...
Calculating buoyancy frequency for argo/section objects using the apply() family 2016-02-29 The most recent CRAN release of oce includes some nice new functionality for reading and converting argo objects (see http://www.argo.ucsd.edu/ for more information about the fantastic Argo float program). One question that arose out of this increased functionality was how to calculate \(N^2\) (also known as the buoyancy or Brunt-Väisälä frequency) for such objects. Buoyancy frequency The definition of $N^2 $ is: \[ N^2 = \frac{-g}{\rho} \frac{\partial \rho}{\partial z} \] ...
A Valentine's day map 2016-02-14 In the spirit of Valentine’s day, I made a map that uses the beautifully weird bonne projection. The code uses the proj4 facilities in the oce package. library(oce) data(coastlineWorld) msg <- "HAPPY VALENTINES DAY!" msgtop <- "You mean the WORLD to me" msglon <- 130 msglat <- -30 par(mar=c(1,1,1,1)) mapPlot(coastlineWorld, col='pink', proj='+proj=bonne +lat_1=85', xlim=c(-13700000, 13700000), ylim=c(-18079625, 8008557)) mapGrid(longitude = c(-180, 180), lwd=4, col=2, latitude=NULL) text(0, 8005400, msgtop, cex=2, font=3) nc <- nchar(msg) lon <- seq(-msglon, msglon, length. ...
oce package version 0.9-18 is released! 2016-02-11 Today we released a new version of oce, and it has been uploaded to CRAN. Only the source version is available as of the time of writing, but binary versions for all platforms should become available in the next few days. As always, the best way to install the package is to do: install.packages("oce") at an R prompt. Then you can do stuff like: library(oce) ## Loading required package: gsw ## Loading required package: testthat library(ocedata) data(levitus) data(coastlineWorld) cm <- colormap(levitus$SSS, col=oceColorsSalinity, breaks=seq(30, 37, 0. ...
An R function to shift vectors by a specified lag 2016-02-09 Quite of bit of my work involves looking at “shifts” between two time series. There are lots of reasons why shifts are interesting, including such things as: phase differences in the tides at two different locations, physical separation between sensors on a profiling instrument, and clock drifts between two logging sensors. To accomplish the actual shifting of the vectors (I’m not going to discuss here how to determine the amount by which the series should be shifted, since that depends on the parameters of the problem), I created the following function: ...
Using the R apply() family with oce objects 2015-09-01 Introduction In the oce package, the various different data formats are stored in consistently structured objects. In this post, I’ll explore a way to access elements of multiple oce objects using the R lapply(), from the apply family of functions. Example with a ctd object The objects always contain three fields (or “slots”): metadata, data, and processingLog. The layout of the object can be visualized using the str() command, like: ...
Hello R Markdown 2015-07-23 R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com. You can embed an R code chunk like this: summary(cars) ## speed dist ## Min. : 4.0 Min. : 2.00 ## 1st Qu.:12.0 1st Qu.: 26.00 ## Median :15.0 Median : 36.00 ## Mean :15.4 Mean : 42.98 ## 3rd Qu. ...
Lorem Ipsum 2015-01-01 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Switching from Matlab to R: Part 1 2014-01-19 Introduction I was thinking recently about how best to help someone transitioning from Matlab(TM) to R, and did my best to recall what sorts of things I struggled with when I made the switch. Though I resisted for quite a while, when I finally committed to making the change I recall that it mostly happened in a matter of weeks. It helped that my thesis supervisor exclusively used R, and we were working on code for a paper together at the time, but in the end I found that the switch was easier than I had anticipated. ...
Sample Post 2012-12-25 This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com. When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this: summary(cars) ## speed dist ## Min. ...