Blog Archives

Lomb-Scargle periodogram for unevenly sampled time series

January 10, 2013
By
Lomb-Scargle periodogram for unevenly sampled time series

In the natural sciences, it is common to have incomplete or unevenly sampled time series for a given variable. Determining cycles in such series is not directly possible with methods such as Fast Fourier Transform (FFT) and may require some degree o...

Read more »

Lomb-Scargle periodogram for unevenly sampled time series

January 10, 2013
By
Lomb-Scargle periodogram for unevenly sampled time series

In the natural sciences, it is common to have incomplete or unevenly sampled time series for a given variable. Determining cycles in such series is not directly possible with methods such as Fast Fourier Transform (FFT) and may require some degree of interpolation to fill in gaps. An alternative is the Lomb-Scargle method (or...

Read more »

Producing animated GIFs and Videos

January 2, 2013
By
Producing animated GIFs and Videos

It took me a while to figure out how to use the animation package on my Windows OS. In making an animated GIF, the problem seems to have been quite simple in the end (and I should have been more patient in reading the instructions!) - Following installation of the program ImageMagick, one has...

Read more »

Spirograph with R

December 30, 2012
By
Spirograph with R

Just had to figure out how to replicate this old toy of mine with R! I had no idea how long it's been around:Read more »

Read more »

Finding a pin in a haystack – PCA image filtering

December 4, 2012
By
Finding a pin in a haystack – PCA image filtering

I found the following post regarding the anomalous metal object observed in a Curiosity Rover photo to be fascinating - specifically, the clever ways that some programmers used for filtering the image for the object. The following answer on mathematica.stackexchange.com was especially illuminating for its use of a multivariate distribution to...

Read more »

DINEOF (Data Interpolating Empirical Orthogonal Functions)

October 30, 2012
By
DINEOF (Data Interpolating Empirical Orthogonal Functions)

I finally got around to reproducing the DINEOF method (Beckers and Rixon, 2003) for optimizing EOF analysis on gappy data fields - it is especially useful for remote sensing data where cloud cover can result in large gaps in data. Their paper gives a nice overview of some of the various methods...

Read more »

Create polygons from a matrix

April 27, 2012
By
Create polygons from a matrix

The following function matrix.poly allows for the addition of polygons to a plot based on a matrix and defined matrix positions. I have used this function on occasion to highlight specific matrix locations (e.g. in the above figure). You can do the same by overlaying another image (left in above plot) but with this...

Read more »

Adding a transparent image layer to a plot

April 19, 2012
By
Adding a transparent image layer to a plot

The following example shows how to add a transparent image-type layer to a plot. The add.alpha function (below) simply adds transparency to a vector of colors which is then introduced in the "col" argument of an image plot. Read more »

Read more »

Working with Globcolour data

April 2, 2012
By
Working with Globcolour data

The Globcolour project (http://www.globcolour.info/) provides relatively easy access to ocean color remote sensing data. Data is provided at http://hermes.acri.fr/and the following parameters are available:· Chlorophyll-a (CHL1 and CHL2)· Fully normalised water leaving radiances at 412, 443, 490, 510, 531, 550-565, 620, 665-670, 681 and 709 nm (Lxxx)· Coloured dissolved and detrital...

Read more »

Add a frame to a map

April 2, 2012
By
Add a frame to a map

Here is a function that adds a frame of alternating colors to a map (un-projected). One defines the extension of each bar (in degrees) and an optional width of the bars (in inches). It uses the "joinPolys" function of the package to trim the bars near the map corners where the axes meet.the map.frame...

Read more »