Grad School Headaches

By Florence Sullivan, MSc student GEMM lab

Over the past few months I have been slowly (and I do mean SLOWLY – I don’t believe I’ve struggled this much with learning a new skill in a long, long time) learning how to work in “R”.  For those unfamiliar with why a simple letter might cause me so much trouble, R is a programming language and free software environment suitable for statistical computing and graphing.

My goal lately has been to interpolate my whale tracklines (i.e. smooth out the gaps where we missed a whale’s surfacing by inserting artificial locations).  In order to do this I needed to know (1) How long does a gap between fixes need to be to identify a missed surfacing? (2) How many artificial points should be used to fill a given gap?

The best way to answer these queries was to look at a distribution of all of the time steps between fixes.  I started by importing my dataset – the latitude and longitude, date, time, and unique whale identifier for each point (over 5000 of them) we recorded last summer. I converted the locations into x & y coordinates, adjusted the date and time stamp into the proper format, and used the package adehabitatLT  to calculate the difference in times between each fix.  A package known as ggplot2 was useful for creating exploratory histograms – but my data was incredibly skewed (Fig 1)! It appeared that the majority of our fixes happened less than a minute apart from each other. When you recall that gray whales typically take 3-4 short breathes at the surface between dives, this starts to make a lot of sense, but we had anticipated a bimodal distribution with two peaks: one for the quick surfacings, and one for the surfacings between 4-5 minutes dives. Where was this second peak?

Histogram of the difference in time (in seconds) between whale fixes.
Fig. 1.  Histogram of the difference in time (in seconds on x-axis) between whale fixes.

Sometimes, calculating the logarithm of one of your axes can help tease out more patterns in your data  – particularly in a heavily skewed distribution like Fig. 1. When I logged the time interval data, our expected bimodal distribution pattern became evident (Fig. 2). And, when I back-calculate from the center of the two peaks we see that the first peak occurs at less than 20 seconds (e^2.5 = 18 secs) representing the short, shallow blow intervals, or interventilation dives, and that the second peak of dives spans ~2.5 minutes to  ~5 minutes (e^4.9 = 134 secs, e^5.7 = 298 secs). Reassuringly, these dive intervals are in agreement with the findings of Stelle et al. (2008) who described the mean interval between blows as 15.4 ± 4.73 seconds, and overall dives ranging from 8 seconds to 11 minutes.

Fig. 2. Histogram of the log of time difference between whale fixes.
Fig. 2. Histogram of the log of time difference between whale fixes.

So, now that we know what the typical dive patterns in this dataset are, the trick was to write a code that would look through each trackline, and identify gaps of greater than 5 minutes.  Then, the code calculates how many artificial points to create to fill the gap, and where to put them.

Fig. 3. A check in my code to make sure the artificial points are being plotted correctly. The blue points are the originals, and the red ones are new.
Fig. 3. A check in my code to make sure the artificial points are being plotted correctly. The blue points are the originals, and the red ones are new.

One of the most frustrating parts of this adventure for me has been understanding the syntax of the R language.  I know what calculations or comparisons I want to make with my dataset, but translating my thoughts into syntax for the computer to understand has not been easy.  With error messages such as:

Error in match.names(clabs, names(xi)) :

  names do not match previous names

Solution:  I had to go line by line and verify that every single variable name matched, but turned out it was a capital letter in the wrong place throwing the error!

Error in as.POSIXct.default(time1) :

  do not know how to convert ‘time1’ to class “POSIXct”

Solution: a weird case where the data was in the correct time format, but not being recognized, so I had to re-import the dataset as a different file format.

Error in data.frame(Whale.ID = Whale.ID, Site = Site, Latitude = Latitude,  :   arguments imply differing number of rows: 0, 2, 1

Solution: HELP! Yet to be solved….

Is it any wonder that when a friend asks how I am doing, my answer is “R is kicking my butt!”?

Science is a collaborative effort, where we build on the work of researchers who came before us. Rachael, a wonderful post-doc in the GEMM Lab, had already tackled this time-based interpolation problem earlier in the year working with albatross tracks. She graciously allowed me to build on her previous R code and tweak it for my own purposes. Two weeks ago, I was proud because I thought I had the code working – all that I needed to do was adjust the time interval we were looking for, and I could be off to the rest of my analysis!  However, this weekend, the code has decided it doesn’t work with any interval except 6 minutes, and I am lost.

Many of the difficulties encountered when coding can be fixed by judicious use of google, stackoverflow, and the CRAN repository.

But sometimes, when you’ve been staring at the problem for hours, what you really need is a little praise for trying your best. So, if you are an R user, go download this package: praise, load the library, and type praise() into your console. You won’t regret it (See Fig. 4).

Screenshot (74)
Fig. 4. A little compliment goes a long way to solving a headache.

Thank you to Rachael who created the code in the first place, thanks to Solene who helped me trouble shoot, thanks to Amanda for moral support. Go GEMM Lab!

Why do pirates have a hard time learning the alphabet?  It’s not because they love aaaR so much, it’s because they get stuck at “c”!

Stelle, L. L., W. M. Megill, and M. R. Kinzel. 2008. Activity budget and diving behavior of gray whales (Eschrichtius robustus) in feeding grounds off coastal British Columbia. Marine mammal science 24:462-478.

Smile! You’re on Camera!

By Florence Sullivan, MSc. Student, GEMM Lab

Happy Spring everyone!  You may be wondering where the gray whale updates have been all winter – and while I haven’t migrated south to Baja California with them, I have spent many hours in the GEMM Lab processing data, and categorizing photos.

You may recall that one of my base questions for this project is:

Do individual whales have different foraging strategies?

In order to answer this question, we must be able to tell individual gray whales apart. Scientists have many methods for recognizing individuals of different species using tags and bands, taking biopsy samples for DNA analysis, and more. But the method we’re using for this project is perhaps the simplest: Photo-Identification, which relies on the unique markings on individual animals, like fingerprints.  All you need is a camera and rather a lot of patience.

Bottlenose dolphins were some of the first cetaceans to be documented by photo-identification.  Individuals are identified by knicks and notches in their fins. Humpback whales are comparatively easy to identify – the bold black and white patterns on the underside of their frequently displayed flukes are compared.  Orcas, one of the most beloved species of cetaceans, are recognized thanks to their saddle patches – again, unique to each individual. Did you know that the coloration and shape of those patches is actually indicative of the different ecotypes of Orca around the world? Check out this beautiful poster by Uko Gorter to see!

Gray whale photo identification is a bit more subtle since these whales don’t have dorsal fins and do not show the undersides of their fluke regularly.  Because gray whales can have very different patterns on either side of their body, it is also important to get photos of both their right and left sides, as well as the fluke, to be sure of recognizing an individual if it comes around again.   When taking photos of a gray whale, it’s a good idea to include the dorsal hump, where the knuckles start as it dives, as an easy indicator of which side of the body you are looking at when you’re trying to match photos.  Some clues that I often use when identifying an individual include the placement of barnacles, and patterns of pigmentation and scars.  You can see that patience and a talent for pattern recognition come in handy for this sort of work.

While we were in the field, it was important for my team to quickly find reference features to make sure we were always tracking the same whale. If you stopped by to visit our field station, you may have heard use saying things like “68 has white on both fluke-tips”, “70 has a propeller scar on the left side”,  “the barnacles on 54’s head looks like a polyp”, or “27 has a smiley face in front of the first knuckle left side.” Sometimes, if a trait was particularly obvious, and the whale visited our field station more than once, we would give them a name to help us remember them.  These notes were often (but to my frustration, not always!) recorded in our field notebook, and have come in handy this winter as I have systematically gone through the 8000+ photos we took last summer, identifying each individual, and noting whenever one was a repeat visitor. With these individuals labeled, I can now assess their level of behavioral and distribution consistency within and between study sites, and over the course of the summer.

Why don’t you try your luck?  How many individuals are in this photoset? How many repeats?  If I tell you that my team named some of these whales Mitosis, Smiley, Ninja and Keyboard can you figure out which ones they are?

#1
#2
#2
#3
#4
#4
#5
#5
#6
#6
#7
#7
#8
#8
#9
#9
#10
#10

 

Keep scrolling for the answer key ( I don’t want to spoil it too easily!)

 

 

 

 

 

Answers:

There are 7 whales in this photoset. Smiley and Keyboard both have repeat shots for you to find, and Smiley even shows off both left and right sides.

  1. Whale 18 – Mitosis
  2. Whale 70 -Keyboard
  3. Whale 23 -Smiley
  4. Whale 68 – Keyboard
  5. Whale 27 -Smiley
  6. Whale 67
  7. Whale 36 -Ninja
  8. Whale 60 – “60”
  9. Whale 38 – has no nickname even if we’ve seen it 8 times! Have any suggestions? leave it in the comments!
  10. Whale 55 – Smiley

 

New Zealand’s mega-fauna come to Newport, Oregon.

By Olivia Hamilton, PhD Candidate, University of Auckland, New Zealand.

The week leading up to my departure from New Zealand was an emotional rollercoaster. Excited, nervous, eager, reluctant… I did not feel like the fearless adventurer that I thought I was. D-day arrived and I said my final goodbyes to my boyfriend and mother at the departure gate. Off I went on my three-month research stint at the Hatfield Marine Science Center.

Some thirty hours later I touched down in Portland. I collected my bags and headed towards the public transport area at the airport. A young man greeted me, “Would you like to catch a taxi or a shuttle, ma’am?” “A taxi please! I have no idea where I am”, I responded. He nodded and smiled. I could see the confusion all over his face… My thick kiwi accent was going to make for some challenging conversations.

After a few days in Portland acclimatizing to the different way of life in Oregon, it was time to push on to Newport. I hit a stroke of luck and was able take the scenic route with one of the girls in the GEMM lab, Rachael Orben. With only one wrong turn we made it to the Oregon coast. I was instantly hit with a sense of familiarity. The rugged coastline and temperate coastal forest resembled that of the west coast of New Zealand. However, America was not shy in reminding me of where I was with its big cars, drive-through everything, and RVs larger than some small kiwi houses.

The Oregon Coast. Photo by Olivia Hamilton.
The Oregon Coast. Photo by Olivia Hamilton.

We arrived at Hatfield Marine Science Center: the place I was to call home for the next quarter of a year.

So, what am I doing here?

In short, I have come to do computer work on the other side of the world.

Dr. Leigh Torres is on my PhD committee and I am lucky enough to have been given the opportunity to come to Newport and analyze my data under her guidance.

My PhD has a broad interest in the spatial ecology of mega-fauna in the Hauraki Gulf, New Zealand. For my study, megafauna includes whales, dolphins, sharks, rays, and seabirds. The Hauraki Gulf is adjacent to Auckland, New Zealand’s most populated city and home to one of our largest commercial ports. The Hauraki Gulf is a highly productive area, providing an ideal habitat for a number of fish species, thus supporting a number of top marine predators. As with many coastal areas, anthropogenic activities have degraded the health of the Gulf’s ecosystem. Commercial and recreational fishing, run-off from surrounding urban and rural land, boat traffic, pollution, dredging, and aquaculture are some of the main activities that threaten the Gulf and the species that inhabit it. For instance, the Nationally Endangered Bryde’s whale is a year-round resident in the Hauraki Gulf and these whales spend much of their time close to the surface, making them highly vulnerable to injury or death from ship-strikes. In spite of these threats, the Gulf supports a number of top marine predators.  Therefore it is important that we uncover how these top predators are using the Gulf, in both space and time, to identify ecologically important parts of their habitat. Moreover, this study presents a unique opportunity to look at the relationships between top marine predators and their prey inhabiting a common area.

The Hauraki Gulf, New Zealand. The purple lines represent the track lines that aerial surveys were conducted along.

 

Common dolphins in the Hauraki Gulf. Photo by Olivia Hamilton
Common dolphins in the Hauraki Gulf. Photo by Olivia Hamilton

 

A Bryde’s whale, common dolphins, and some opportunistic seabirds foraging in the Hauraki Gulf. Photo by Isabella Tortora Brayda di Belvedere.
A Bryde’s whale, common dolphins, and some opportunistic seabirds foraging in the Hauraki Gulf. Photo by Isabella Tortora Brayda di Belvedere.

 

Australisian Gannets and shearwaters foraging on a bait ball in the Hauraki Gulf. Photo by Olivia Hamilton.
Australisian Gannets and shearwaters foraging on a bait ball in the Hauraki Gulf. Photo by Olivia Hamilton.

To collect the data needed to understand the spatial ecology of these megafauna, we conducted 22 aerial surveys over a year-long period along pre-determined track lines within the Hauraki Gulf. On each flight we had four observers that collected sightings data for cetaceans, sharks, predatory fish, prey balls, plankton, and other rare species such as manta ray. An experienced seabird observer joined us approximately once a month to identify seabirds. We collected environmental data for each sighting including Beaufort Sea State, glare, and water color.

The summary of our sightings show that common dolphins were indeed common, being the most frequent species we observed. The most frequently encountered sharks were bronze whalers, smooth hammerhead sharks, and blue sharks. Sightings of Bryde’s whales were lower than we had hoped, most likely an artifact of our survey design relative to their distribution patterns. In addition, we counted a cumulative total of 11,172 individual seabirds representing 16 species.

Summary of sightings of megafauna in the Hauraki Gulf.

Summary of sightings of megafauna in the Hauraki Gulf.My goal while here at OSU is to develop habitat models for the megafauna species to compare the drivers of their distribution patterns. But, at the moment I am in the less glamorous, but highly important, data processing and decision-making stage. I am grappling with questions like: What environmental variables affected our ability to detect which species on surveys? How do we account for this? Can we clump species that are functionally similar to increase our sample size? These questions are important to address in order to produce reliable results that reflect the megafauna species true distribution patterns.

Once these questions are addressed, we can get on to the fun stuff – the habitat modeling and interpretation of the results. I will hopefully be able to start addressing these questions soon: What environmental and biological variables are important predictors of habitat use for different taxa? Are there interactions (attraction or repulsion) between these top predators? What is driving these patterns? Predator avoidance? Competition? So many questions to ask! I am looking forward to answering these questions and reporting back.

Gray Whale Goofs

Hello there!  Florence here, signing in from Newport.  We had a fantastic trip south to Port Orford, and tracked another 53 whales bringing our season total up to 117 so far! This morning, we were back out at Boiler Bay and spent 5 hours staring at empty water – in keeping with the theme of this post, field work does not always go as planned.

Our two study areas couldn’t be more different.  At the Boiler Bay State Wayside, we are approximately 18 meters off the water.  In Port Orford, we are perched on the side of a 63 meter tall cliff. This extra height greatly increases our range and accuracy as well as changing the angle of our photography and the type of photo analysis we can do.  We’re quite excited to have a top down view of our whales, because the photos we are capturing will allow us to use certain photogrammetry techniques to measure the length and girth of the individuals.  With luck, when we compare the photos from the beginning of the season (now) to the end of our study (September) we may be able to see a change in the height of the post-cranial fat deposit, which would indicate a successful foraging season.  Gray whales do not eat from the beginning of their southward migration, through the breeding and calving season, until they reach productive foraging grounds at the end of their northward migration.  This means that all their sustenance for 6+ months is derived from their summer foraging success.  Did you know that they even generate their own water through an oxidation reaction which creates ‘metabolic water’ from their blubber stores?  So it will be rather fantastic if we manage to measure the change in whale body condition over the course of the summer – particularly if we are able to spot any mother-calf pairs who will have had an especially grueling journey north.

A foraging behavior where the whale turns on its side in shallow water. The triangle of the fluke resembles a shark fin
Sharking: A foraging behavior where the whale turns on its side in shallow water. The triangle of the fluke resembles a shark fin

So, while our photo database is advancing nicely, technical difficulties are to be expected when you’re in the field, and sometimes, troubleshooting takes longer than you would like it to.  This evening, let me introduce you to the elusive species known as ‘the Chinese land whale.’  It is a very rare breed which spontaneously generates itself from misaligned computer files.

When the theodolite beeps as we ‘mark’ a whale, a pair of horizontal and vertical angles are getting sent from the machine to a program called ‘Pythagoras’ on the laptop. Given our starting coordinates and a few other variables, the program auto-calculates for us the latitude and longitude of that whale.  While we hoped it would be a simple matter to upload these coordinates to Google Earth to visualize the tracklines, it turns out that Pythagoras stores the East/West hemisphere information in a separate column, so if we just plot the raw numbers, our whale tracks end up in the middle of a field in rural China! Hence, the rare ‘Chinese land whale’.  Now that we know the trick, it is not so difficult to fix, but we were quite surprised the first time it happened!

If you dont have your hemisphere correctly labeled, you end up in China instead of Oregon.
If you don’t have your hemisphere correctly labeled, you end up in China instead of Oregon.

Of course, that is not the only thing that has gone wrong with visualizing the tracklines.  When we first got to Graveyard Point survey site, it turns out that we had set our azimuth (our reference angle) the wrong direction from true north, so all our whales seemed to be foraging near the fish and chips restaurant in the middle of town.

If the azimuth is incorrectly referenced, you might end up on land instead of in the water.
If the azimuth is incorrectly referenced, you might end up on land instead of in the water.

After discovering that in order to rotate something 180degrees, you simply need to alter the azimuth angle by 90degrees, (we’re still not sure why this is working), the whales left the fish and chips to us and returned to the harbor.  Anyways, now that we’ve figured out these glitches, we can focus on identifying individual whales, and figuring out which track-lines might be repeat visitors.

Once all the kinks got worked out - the real trackline!  Dont worry, whale 60 did not go through the jetty, thats an artifact of the program wanting to draw straight lines from point a to b.  more likely we simply missed a surface as it transited around the point of the jetty.
Once all the kinks got worked out – the real trackline! Dont worry, whale 60 did not go through the jetty, thats an artifact of the program wanting to draw straight lines from point a to b. more likely we simply missed a surface as it transited around the point of the jetty.

In other outreach news, the OSU media department came out to the field and interviewed us a few weeks ago (on a day that the theodolite and computer were refusing to talk to each other due to a faulty connector cable – which is always delightful when one is trying to showcase research in progress). The resulting article has been posted should you wish to take a look:

http://oregonstate.edu/ua/ncs/archives/2015/aug/researchers-studying-oregon%E2%80%99s-%E2%80%9Cresident-population%E2%80%9D-gray-whales

More shallow sharking behavior
More shallow sharking behavior
Well known for having the shortest, toughest baleen of any of the great whales, here you can see the plates in its mouth!
Well known for having the shortest, toughest baleen of any of the great whales, here you can see the plates in its mouth!

Until next time,

Team Ro”buff”stus

Southern Sunshine Meets Oregon Wind: Interning with the GEMM Lab!

**GUEST POST**written by Cheyenne Coleman of Savannah State University

My first journey to the west coast, was spent on a six hour flight to Portland, Oregon in anticipation of my upcoming summer internship with the Geospatial Ecology and Marine Megafuana lab (GEMM Lab) at the Hatfield Marine Science Center (HMSC). I had never before been to the west coast, but luckily for me I did not have to make this long journey alone; my friend, Kamiliya Daniels, was also doing an internship at HMSC. After a long bus ride to Corvallis, Kamiliya and I, were warmly greeted by one of my GEMM lab members, Amanda Holdman. With her, was honorary GEMM lab member and Amanda’s dog, Boiler, who spent the greater part of the drive to Newport sleeping on my lap while I spent the drive asking Amanda several series of questions,

“Are there bears in these woods?”

“What do the dorms look like? How do I get around town? I hear it’s a small town, is there at least a Walmart?”

But without any answer to my curiosity, all of these questions were left with one reply:

“I’ll let you see for yourself.”

And then just as Amanda proposed, I did exactly that.

My name is Cheyenne and I am from Savannah State University in Georgia interning with LMRCSC (Living Marine Resources Cooperative Science Center) in Newport, Oregon. My expectations of the Oregon coast and the reality was vastly different than what I had pictured. I imagined the entire West Coast would match a California summer; Sunny and hot.

But on the contrary, upon arrival to Newport, I learned, it doesn’t. It is windy and chilly and hardly ever above 70 degrees. Thinking an Oregon summer would match a California summer, in my suitcase I possessed only three small sweaters and an abundant supply of shorts and tank tops. Needless, to say I was quickly off to buy an Oregon Coast sweatshirt that would double as warmth and a souvenir. Upon first entering Newport, I was mostly shocked at how small the town felt, and I noticed every structure was made of wood, and coming from Georgia this was strange to me. In Georgia, everything is made of bricks and cement. The dorms on first glance reminded me of summer camp for adults: slightly dated with bunk bed sleeping arrangements. Yikes!

However, my worries that come along with moving to a new place, were quickly diminished when I was welcomed to the GEMM lab; Florence greeted with a warm cup of tea, I was introduced to everyone who worked at HMSC, and even given my very own desk in the GEMM lab. After a day of transitions, and a much needed good night’s rest, I was introduced to my project on California Sea Lions (Zalophus californianus).

If you’ve been following along with all of the latest posts from GEMM lab students, you might think the lives of spatial ecologists revolve around glamorous fieldwork. We’ve got Amanda eavesdropping on porpoises, Florence surveying for foraging gray whales, and Leigh playing hide and seek with seabirds down in Yachats. I, however, am admittedly not spending my summer in the field this year and am learning that there is more to being a scientist than picturesque moments with charismatic study species in beautiful locations.

Prior to entering the GEMM lab, I had limited experience in computing and data analysis and spent my prior summer’s doing fieldwork on invertebrates, usually bagging sediment and collecting water samples. This internship was a new and unique opportunity for me to learn the next step of the scientific process. While I had always wondered, “What happens after data collection?” I was not given the experience to find out.  I quickly learned, that this includes a lot of sorting, categorizing, and modeling, all of which are very time consuming.

By using satellite tracking information of California sea lions collected by the Oregon Department of Fish and Wildlife (ODFW) from 2005 and 2007, I am able to measure movements and habitat use of California sea lions. By analyzing their routes between their initial and final locations, we can study their distributions patterns.

To some people, sitting at a computer doing analysis may not seem as glamorous as working in the field. Some people might question why someone would chose to spend their career in front of a computer screen. But my internship this summer, really showed me the value of having experience working at all stages of the scientific process. Seeing all of my efforts in processing, sorting, and categorizing come together to create an end result really enhanced my love for science. By connecting the questions to the answers, and making contributions to the scientific community, I feel rewarded for my hard work.

My internship has come to an end, and given my initial hesitations, I’ve grown accustomed to Newport and the GEMM lab. I enjoy sitting at my desk running through a wild assortment of data and hearing the wonderful ding of the teapot. In the last days of my internship, I was able to escape my computer screen to assist Florence in data collection on beautiful gray whale surveys. Last Thursday, a lab meeting was held and my lab mates and I were able to update each other on our research. We shared ideas on how to enhance everyone’s project, and who might be able to answer questions we were struggling with in our own data sets. As my internship comes to a close, I have gained more knowledge and real life skill then I would ever hope to gain just through courses at Savannah State. I learned new software programs like R Statistical Package and sharpened my own skills in ArcGIS. I gained the experience of collaborating with a lab, and understanding how powerful working with your peers and colleagues can be. Gaining this much experience has, without a doubt, given me an edge in the competitive field I will enter after graduation. I have made connections, hopefully life long, with the nicest people; I know that in the future, which ever path I may choose, I’ll always be a part of the GEMM lab.