R-GMT HexMap

Hexmap example

I’m just finishing up a contract making maps of telemetry data from satellite tagged animals. Basically just finding daily positions and making a pretty map out of them. It’s taken me a little while to write the code for it and while I’m not sure a whole lot of other people will be able to use it, I thought it might help one or two people out if I posted it online. The boss ended up wanting that as part of the contract too so pretty good motivation.

It’s not completely automatic but if you want pretty hexmaps of animal positions and you’re reasonably proficient in R (with maybe a little knowledge of GMT), then this may save you a good bit of time (or least let you skip some of the stumbling blocks I ran into). There’s also a function to read the output from the Douglas Argos Filter which could be handy if you’re working with Douglas filtered data in R.

The project page is here. Feel free to leave any comments or suggestions below.

Biologist
Programmer

Comments (1)

Permalink

When Do Leatherback Turtles Migrate South?

ResearchBlogging.orgCover of volume 19 issue 2 Behavioral Ecology

I’ve had this blog a year and a half now and although I’ve had a good time, I’ve never really wrote about anything I’m actually (somewhat) knowledgeable. So I think I’ll do a few posts on leatherback turtles. I’m no turtle expert but I did spend a couple years working on their migration and movement. My first first-author paper just got officially published so I’ll start with that. <ego>It made the cover of Behavioral Ecology</ego> which isn’t really a big deal but I thought it was kind of cool. The paper was about leatherback turtles migrating from their summer feeding grounds near Nova Scotia to head down to wintering and nesting areas in the south. (If you don’t feel like reading all this, you could just skip to the pretty cool {at least to me} movie down at the bottom).

Map of Nova Scotian waters

First a little background. If you don’t know much about Nova Scotian geography, don’t feel too bad a lot of my relatives in Michigan were surprised when I told them I was in Canada but still south of them. Here’s a map for orientation. Leatherback turtles come up to Nova Scotian waters to eat jellyfish in the summer and then head back south to nest, mate and presumably avoid the cold waters. Leatherback turtles are pretty cool animals and I’ll probably do another post with more details on them later. For now, you just need to know they’re big animals reaching more than half a ton and their size, blubber and counter-current heat exchange allow them to maintain a high body temperature in cold waters almost like a warm-blooded animal.

So back to the paper, my coauthor Mike James has tagged a whole bunch of turtles now and we were curious if we could see any pattern in when they begin their migration. One problem was that unlike migratory birds it’s pretty hard to define when a turtle begins migrating. Luckily the state space models of Ian Jonsen provide a method to estimate turtle behavior as either foraging or transiting. By finding the last foraging in a season, we could have a pretty good idea of when the turtles began their migration.

Once we figured out when the turtles began their migration, we tried to figure out what might be triggering it. We guessed it would have something to do with colder temperatures or declining prey abundance. I could get temperature from satellite data but there isn’t an easy way to measure jellyfish (leatherback food) abundance. As a rough proxy, we used chlorophyll estimates from satellite images. As a side note, it’s really cool that NASA provides their data for free. Just to cover as many bases as possible, we threw position, day length, the North Atlantic Oscillation index, water depth and the sex and size of the turtle into the mix and stuck it all into a stats model. After a bit of calculating, the model came back predicting that the position of the turtle and temperature and chlorophyll of the water appear to correlate with departures.

Predicted departure of leatherback turtles

The biggest factor for predicting departure was the position of the turtle. Northern turtles appear to leave earlier than southern turtles and turtles around the longitude of Georges Bank (abundant shelf ecosystem) and Nova Scotia (the study area and lots of jellyfish) stay longer. The contour plot to the right shows the relative probability of departure from low (red) to high (yellow). The contour lines and dates show when we would expect 50% of the turtles in a region to depart. Knowing these dates could be pretty useful for conservation since regulations could be lifted after their departure.

Northern turtles leaving earlier was pretty much what we expected since northern waters get colder sooner. So it was pretty surprising when the model also predicted that turtles are actually more likely to leave when the water is warmer and greener. Now I’m not sure exactly why this is but one possible guess is that warmer chlorophyll-rich waters provide more nourishment sooner and allow turtles to head south earlier. Another possible explanation is that jellyfish population might decrease earlier since many jellyfish die off after reproducing and warmer waters and increased prey allow jellyfish to reproduce sooner. Of course, a final possibility is that the correlation is just a funny coincidence in the data but hopefully this is unlikely.

Inferred foraging locations of northern and southern leatherback turtles and departure tracks

Since turtles didn’t appear to be leaving when the water cooled off, why were they still leaving early from the north? One guess might be that turtles leave earlier from the north if they have farther to swim to their southern nesting grounds but the difference from the southern and northern foraging areas is only about 500 km. Since leatherbacks can easily swim 2 km/hr, they could cover this distance in 10 days or less but we observed differences of more than a month. Without temperature or distance to explain it, the disparity could possibly be related to some difference in habitat quality. Unfortunately this will remain just a hypothesis until we get a lot more data on jellyfish distribution and feeding rates. It is interesting to note that although many leatherbacks are still foraging in southern waters (blue dots in the figure to the right), no northern foraging turtle (red dots) has been observed moving into southern foraging grounds late in the season (red tracks).

Now that you made it through all that text, here’s a video I made of the turtles foraging, transiting and migrating (higher quality here). By the way, it costs quite a bit of work and money to get a transmitter on a leatherback so each one of those points is a good bit of work done by my coauthor Dr. James.

A couple extra interesting things to watch for are turtles hitting the Gulf Stream east of the continental shelf and being swept to the northeast and turtles getting stuck in the Bay of St. Lawrence (there used to be a channel between Cape Breton Island and mainland Nova Scotia but it was recently filled in with a causeway). See the map above if you need help finding those. Anyway, that movie’s pretty much the highlight of my thesis. I must have seen it several dozen times already but I still get a kick out of watching the turtles swim around.

Reference

Sherrill-Mix, S.A., James, M.C., Myers, R.A. (2007). Migration cues and timing in leatherback sea turtles. Behavioral Ecology, 19(2), 231-236. DOI: 10.1093/beheco/arm104

Biologist
Leatherback

Comments (11)

Permalink

WP_Texticon

Matrix-like Texticon example Letters Texticon example DNA-like Texticon example

I realize I’m getting in the dead horse beating side of automatic avatar creation plugins but brainsolid asked for a plugin to generate binary avatars that looked like the text from the matrix and I figured it wouldn’t take too long to change WP_Identicon over to it. Of course, then other things came up and I managed to take quite a while to get around to it but it’s done now so here is WP_Texticon. It generates avatars with an array of colored characters. It’s sort of hard to describe so it’s probably easier to just show a few examples.

So I guess it’s mostly for anyone that likes that text in the Matrix, writing about code (with 0 and 1’s or 0-9 and A-E if you want to get fancy) or biologists (give every commenter their own DNA sequence with ATCG) or maybe general literature (with some random letters and a white background).

Features

  • Dynamically generated avatars for each commenter
  • Matrix/DNA/Binary-like text array icons
  • Customizable character selection
  • Gravatar support
  • No theme edits necessary

Current Version:

WP_Texticon

Installation instructions:

Unzip wp_texticon.zip. Upload wp_texticon.php and the texticon folder. Make sure the texticon folder is writable. If your unzipping program creates a wp_texticon folder please only upload the contents (wp_texticon.php and the texticon folder). That should be it. Texticons should now appear next to your commenter’s names.

You can adjust the background colors, the type and number of characters making up the Texticons and CSS in the Texticon Control Panel. If you’d like to change the fonts used for the characters, add or remove any Truetype Fonts (files that end in .ttf) you’d like to the texticon/fonts folder. You can also clear the Texticon image cache in the control panel.

For Advanced Users:

For even more control, you can disable the automatic placement in the Texticon Control Panel and add an Texticon to any comment with texticon_build($comment->comment_author_email, $comment->comment_author);. For example, find the comments.php of your current theme (it should be in the folder wp-content/themes/[currentThemeName]/). Open it up and look for something similar to foreach ($comments as $comment). Inside this loop there should be code that displays the comment author’s name or metadata like <p class="comment-author"> or <p class="comment-metadata">. Just before all this enter:
<?php if (function_exists(texticon_build)) echo texticon_build($comment->comment_author_email, $comment->comment_author); ?>
If you would prefer to base the Texticons on the commentor’s IP address instead of the commentor’s email just replace $comment->comment_author_email in the above with $comment->comment_author_IP.

Change Log:

  • v0.52 3-27-2007:
    • Fixed missing gravatar bug
  • v0.51 3-27-2007:
    • First Public Version

Blogger
Programmer
Web

Comments (8)

Permalink

Can Elephants Gallop?

ResearchBlogging.org

I watched 10,000 BC yesterday and was pretty disappointed in the animal animations (which were the main reason I went). Most of them looked rather cheap and computer generated. The most unnatural looking was when the elephants galloped with their back feet moving together. That seemed completely wrong to me but I’m no elephant expert so I took a look at the literature when I got home.

You can see tiny bits of the offending gallop in this preview at around the 40 second and 2 minute mark:

If you can manage to get a glimpse of the mammoths’ movement in that, then compare it to this example:

Luckily there is a Nature paper addressing this issue pretty directly. I think the title “Are fast-moving elephants really running?” is a pretty good give away. If you’re getting published in Nature for determining if an animal runs, it’s pretty unlikely said animal is galloping around.

A marked running elephant from Hutchinson et al

So the authors (Hutchinson, Famini, Lair and Kram) went to Thailand, got a bunch of elephants, painted motion capture dots on their joints and had the elephants run a 30 meter dash on video camera. You can see a speedy elephant video in their supplementary material. The elephants reached speeds of 25 km/hr. First to take care of the galloping question:

Elephant footfall patterns from Hutchinson et al

The fastest gait used by elephants has been variously described as a walk, amble, trot, pace, rack or a running walk… …trotting and galloping are running gaits with footfall patterns that are distinct from walking… Our elephants maintained the same walking footfall pattern…

That’s a lot of …’s but I think it gets the point across. Elephants are certainly not galloping. Since that was a little anticlimactic I thought I’d also cover the more interesting question, are elephants running?

The authors first seek to define “running”. Running can be defined as a gait which includes periods where no foot touches the ground and where each foot touches the ground for less than 50% of the time. The second part is new on me but I’m not a kinematicist. It turns out elephants always have at least one foot on the ground but their feet are on the ground only 37% of the time.

Since that didn’t settle the question, the authors turn to physics. The Froude number is a measure of intertia vs gravity often used in boat physics. Apparently scientists also apply it to animals as velocity2/acceleration of gravity/hip height. The authors explain that most animals begin running at at a Froude number of .5 and start to gallop around 2.5. Elephants had Froude numbers as high as 3.4 which seem too high to be a walk.

As a final shot, Hutchinson and his coauthors decided to look at the movement of the center of mass. They explain that in a run the center of mass is lowest at midstride, while in a walk it is highest. Since they couldn’t directly measure the center of mass, the scientists used the position of the elephant’s shoulder and hip to estimate it. Funnily enough, the shoulder and hip were moving in opposite directions with the shoulder indicating walking and the hips indicating running.

So it looks like fast-moving elephants aren’t walking but they’re not really running either. They certainly were not galloping. Which brings us back to the movie 10,000 BC. I can’t understand why they wouldn’t do even rudimentary research (or watch Lord of the Rings which if I remember right got the gait correct) into the movement of animals filling such a central role in the movie. The galloping mammoths look completely fake even without knowing anything about elephants. But I guess with the general lack of concern for history, it’s not too surprising they wouldn’t worry too much about accurate biology either.

Reference

Hutchinson, J.R., Famini, D., Lair, R., Kram, R. (2003). Biomechanics: Are fast-moving elephants really running?. Nature, 422(6931), 493-494. DOI: 10.1038/422493a

Biologist

Comments (5)

Permalink

10,000 BC Review

10,000 BC Poster

In another adventure in early morning cinema, we decided to go see 10,000 BC. I can report that there are definitely not large crowds in the theater at 10AM on Daylight’s Savings Time Sunday.

So I went into this expecting it to be pretty horrible (Rotten Tomatoes is giving it a 8%.) but I like the theme and wanted to see the CGI animals. Unfortunately, the whole thing seemed recycled from other movies and forced. They really wasted a good theme by not even bothering to accurately portray the animals or the history. That said it did keep me and the girlfriend mildly entertained (then again we still haven’t bought a TV so our entertainment criteria is pretty low).

The movie starts out with what I would assume is a fairly good guess at what life was like in 10,000 BC; huts, fire and hunter gatherers. After a few adventures, the characters reach another tribe of people who are just starting to grow their own crops. Again pretty accurate. 10,000 BC is right around when people are thought to have discovered agriculture. After a few more adventures, the history goes right out the window as the heroes run into a full fledged Egyptian culture complete with writing, pyramids, maps of the world and sailing ships. The movies takes one sentence to explain this anachronism as either aliens or Atlantis. This seemed pretty silly to me since we would definitely have archaeological records of such an advanced civilization. Why not just call it 2,000 BC? (Probably because they couldn’t have mammoths then.) As a final punch in the historical gut, the movie ends with the hero receiving a gift of seeds including corn. Pretty annoying (and completely unnecessary) since corn is from the Americas and would not reach the Old World for another 11,500 years. That’s about all I have to say about the history and the plot.

The movie had quite a few (I feel) bad movie making decisions. First right at the start of the movie, everyone decides to cover their faces in mud (a la Braveheart). I’m sure mud facial decorations were common in many ancient tribes but I really don’t think it’s the best idea when the audience is just being introduced to the characters. Then throughout the movie it continually flashes over to show an old witch doctor lady from the village. Besides her being pretty uncharismatic, I thought this was pretty unnecessary to the plot. (Yes I realize they were setting up the ending but I think the mammoth had that taken care of already). Also, the tribe talks in an assortment of phony accents. I saw in a preview/advertisement that the director wanted to do the whole thing in subtitles (a la Apocalypto). I like subtitles much more than dubbing in foreign flicks but since no one has any idea how they spoke 12,000 years ago this seemed kind of stupid. I guess funny accents were the next best thing for him. If you do watch the movie, I swear somewhere in the first part at the village someone is doing a Scarface impression. Let me know if you catch it too. Also, there was a huge amount of noisy pixels in some of the dark shots. I’ve never noticed this in a Hollywood movie before. Not sure why they’d let that through into the final copy.

Finally the part that let me down the most was the computer generated animals. We only get three types in this movie; mammoths, some sort of giant bird and a sabertooth tiger. The birds seemed animated well enough but you never get a real good look at them. The tiger seemed pretty good in the dark but in the light it really looked fake and didn’t seem to move quite right. Also contrary to what the poster would have you believe, the tiger gets about 45 seconds of screen time. The mammoths are in a lot of the movie and oddly enough are often shown galloping with two front feet in the air followed by two back feet. I’m no elephant expert but this looked completely phony to me so I decided to look through the literature once I got home and it looks like it is in fact completely phony (I’ll post about this tomorrow Update: here). Overall the CGI seemed about equivalent to a Discovery channel show which is sort of a let down when they’re supposed to be a highlight of a Hollywood movie.

Now after all those negatives, I do have to give it some credit. Despite all the shortcomings, I was entertained for the parts where I wasn’t groaning at the accents, history or biology. It’s not a horrible movie, it’s just not all that good.

Rating: 2 out of 5

Scott Sherrill-Mix, March 10th, 2007

Reviewer

Comments (4)

Permalink