Translation Issues

Where on earth did the time go? One minute I was looking at ice sculptures and wading through snow drifts and now the snow is gone (mostly) and various wildlife has emerged from hiding.

Look, beavers!

I’ve also managed to get out on the water myself. And eat bacon while doing it. Canadian bacon is Different.

riverbaconRiver bacon!

Perhaps the main reason I’ve lost track of time in the last few weeks is that whether I’ve been awake or asleep, this keeps on flashing in front of my eyes.


I haven’t been able to escape it. My office desktop has looked like this on and off for the whole month. I hope to later show what this has resulted in, but in the meantime I’m going to moan about the amount of pain it’s caused me.

The main source of trouble was that this code was originally written in Matlab. I decided to save us from having to acquire a Matlab license by translating the many scripts that make up the code into R.

Initially this was tedious. There are enough syntax differences (not to mention different names of functions etc) between R and Matlab that this required me to go through the code line by line. Then, even when I done this a number of errors arose simply due to the differing ways that the two programs handle data. I’ll post a guide based on what I learnt in separate post, featuring less pictures of beavers.

Much hair pulling later I got the code running, fed it my data and got a result. These results were consistent with some previous findings obtained using simpler methods. So far so good.

I then decided that instead of feeding my data to the code all in one go, it would be useful to give it one day at a time and then collate the results. “Fine” I thought. “Just modify my overarching processing code, no trouble”.

I was wrong.

c149182a696e73890de876f3d392e2da(Found via googling evil Matlab)

Once again the way in which the two programs handle data required me to make a lot of modifications to the various scripts. Cue more hair pulling. I should also mention that I’ve written this code to be run in parallel, utilising all of my computers cores to increase speed, which means R’s normal debugging tools don’t work.

Finally I got the code to run again and got a result. However, something had changed. A previously suggested relationship had completely reversed in direction. Was this simply due to the new way of feeding the data in? Or was it due to a bug in my code? Or due to me deleting some faulty data? I ran the code again using the original way of processing the data.

Even using parallel processing, this code can take anything from several hours, to all night to run. This meant that getting results was a slow process. So after waiting several hours for the code to run again using the original data processing, once again I got results.

The relationship had flipped direction in these results too.


This suggested that the changes I’d made to accommodate the new data processing method had resulted in a COMPLETELY DIFFERENT RESULT. On the one hand, this was good. It meant that the biologically unrealistic result was due to my error rather than a fundamental problem with the methods. On the other hand, this is the sort of thing that can wake a scientist up at night screaming. A series of small changes in the way data was analysed leading to completely misleading results. In this case we’d caught it before we went too far, but if we’d approached this naively it might have been very easy to miss.

So, now I needed to work out which of my changes had caused this change. Luckily I save all my working files in Dropbox, which keeps a backup of all previous versions. I found a word document containing graphs I’d made to show my supervisor before I’d made changes and reverted all my code to a date before then. Then one by one I reinstated my changes.

In the end I pinned it down to one file. In that file, one line of code.


One line of code had resulted in huge, significant changes to my final result. As I said, the stuff of nightmares.

In the end I stripped out all the changes I’d made and carefully rewrote the scripts to deal with the new method of data processing. So my tale of woe has a happy ending, the code now works and perhaps I’ll even have some results soon. For everyone who made it this far, here is a view of Gatineu Park:


Chickadees are hard to take photos of



I think I’ve been in Canada almost two months now. It’s hard to say as the initial turmoil of moving to a new country slowly changes into everyday routine. This generally involves getting up, trying to do some science until some time in the evening and drinking far too much tea.

I’ve met my study species properly now. A few weekends ago we went for a walk at a place called Muddy Lake (currently frozen and definitely not muddy). When walking along the paths you will generally be followed by a cloud of chickadees, who live in hope that you will be one of the many people that feed them. They whiz around your head, dancing from branch to branch, waiting for the food to be provided. If you DO have food, they will quite cheerfully eat out of your hand.


Despite their tameness taking a photo of them in a more natural setting is challenging, due to their dislike of sitting still for more than a second.


As well as having met my study species properly, I’ve also been working to get to grips with both social network analysis and the study of personality in animals. I had a passing interest in both of these topics before, but now I’m having to rapidly learn about how these analyses are done.


Chickadees are highly social and tend to move about in small flocks. We have information about which birds were with which other birds at feeders.This is generated by special feeders which can identify individual birds fitted with RFID readers.

Picture1An RFID feeder, photo by Teri Jones

We also have information about how certain birds reacted to personality tests as well as which birds are dominant and which are subordinate. There are quite a few interesting questions we could answer by bringing these datasets together. Wrangling the various files together is and working out how to analyse them is the main thing I’m currently dealing with. This involves spending a lot of time shuffling data about in R. I’m also trying to automate and improve some of the workflow for generating this type of data.

We’ve  had a few quite heavy snowfalls. This was my building the day after a particularly severe one:


and this was the window to our office on the same day as the sun was steadily blotted out:


A few weeks ago I gave a departmental seminar on my ENTIRE PHD. This involved talking for longer than I ever had before, which made it very easy to lose track of time. I was extremely afraid of speaking for too long and boring everyone to death.

Picture2So many slides!

I felt it went quite well. My main mistake was towards the end. I glanced at a clock (the WRONG clock) as it turned out and was convinced I’d gone overtime. I sped up for the last few slides (which is unfortunate as they are the most interesting) and then apologised at the end for speaking for so long. As it turned out, I’d looked at the wrong clock and came in under time. At least it left lots of time for the many questions, which hopefully indicate that people are interested in what I spent about four years of life doing.

I have been finding time to try and do some more CANADIAN things. For example, I’ve now tried Poutine which according to Wikipedia is Canada’s national food. It’s basically chips, cheese and gravy. I think that undersells it, it’s warm, tasty, cheesy, potatoey goo.


I also ambled up to Winterlude (a winter festival thing held in Ottawa), where the international ice sculpture championship:IMG_0759OWL


This included a demonstration of ice carving, which is apparently mostly done with powertools now!


I clearly need to find some more CANADIAN things to do. Someone mentioned something called Nanaimo bars..


Snowy owls, snowmobile trails and beaver tails

So I think I’ve been in Canada for nearly two weeks now. I am gradually learning things.

For example, when someone talks about getting beaver tails, they actually mean some sort of delicious pastry:


I also learned how to write some basic video analysis stuff in python, and that a single chickadee in a controlled environment is an easier thing to track than multiple shags on the ocean:vlcsnap-2016-01-23-23h49m11s193I learnt that they deliberately thicken the ice here:


This is so the canal (which I walk along on the way to the office) can be turned into a massive ice skating rink. It opened for the first time today. I saw many people gliding effortlessly along, as well as some children being dragged along on sleds, which looks more my speed.  Since I got here I have occasionally been asked if I skate, to which I give a rueful laugh. I don’t think me and skates would really mix.

Another thing I learned is that batteries drain very quickly in the cold weather. Today myself and the grad students in my research group went to see if our lab vehicle still worked after sitting in a garage for a month or so. The answer was, it didn’t.


Battery is flat.

However once a man from the Canadian AA turned up and jump started it, the car had to be driven somewhere to charge the battery. So I got to go on jaunt to one of the field sites where chickadees are studied, alongside a snowmobile trail. This was great as I was keen to get out of the city and see some Canadian countryside, and see some chickadees in the wild.


We found many chickadees, but also a bald eagle!



Shortly after seeing this I left the trail to go and look at a heap of rusty farm machinery buried in the snow. When I came back to the path, I knew something was afoot. It was then that I learnt that Canadian ambushes are exceptionally polite, as I was warned I might want to put my binoculars away:

12615379_10208372060120941_7821439240601366873_oArg! (Photo by Teri Jones)

It was then decided that we would head back toward Ottawa and try and find some snowy owls that had been reported in the area. On the way we would stop for “Timbits”. I did not know who Tim was, or the answers to any related questions. I found out:


It seems that Timbits are a big box full of the centres of various doughnuts! These tided us by as we headed toward where we might find snowy owls.

We stopped at the edge of a field in the general area where the owls had been seen. We all climbed out of the car and had a general scan of the trees and hedgerows. Nothing. We got back in the car to try a different spot. This was rather similar to my previous experience of attempting to see specific birds, so I wasn’t overly hopeful about finding a snowy owl in an expanse of snowy fields.

Then Shannon who had been looking out of the moving car with her binoculars (I am fairly certain doing this would make me carsick) suddenly spotted something on an electricity pylon in the middle of a field. We parked as close as we could to have a look. The post was quite a distance from the road, but through our binoculars we could clearly see a snowy owl! I had never even seen an owl in daylight, let alone that clearly.

I tried to get a picture but even at maximum zoom it wasn’t enormously clear.


Still, the view through the binoculars was great. We stood and watched the owl for a bit, before deciding to head back down the road to try and find the female that was also supposed to be about. Once again I was sceptical. I think I’d just said finished muttering something along those lines when I suddenly has to ask:

“What’s that on the post?”


There, on a post right next to the road was another snowy owl. We parked up right next to it, getting a much better view than before. I decided I had to try and take a photo.

It was at this point was once again reminded that batteries drain incredibly fast in the cold. Like the car earlier, my camera refused to start up. I fumbled with the various spare batteries. None of them worked. This was absolutely typical but luckily the owl was fairly accomodating. Eventually through luck and the strategic warming up the batteries, my camera finally fired up:


Tomorrow: statistics course!

the Final Official (anticlimatic!) End and what happens after

Today I received this e-mail:


So that’s definitely it. More or less four years exactly after starting, the PhD is officially completed. I’d say that’s the end of shags for me except, as I’ve commented before, there are bits of my thesis that I’m keen to write up as papers. That process is still ongoing and I might enthuse about things  (like how pretty the graphs that python can produce are) at some point in the future. There is however, now an extra incentive to get those papers finished.

Back when I wrote about my viva experience I finished on a question:

“…but for the most part I now have to think about some big questions. Namely, what on earth do I do next?”

At the time that was a huge and scary question. With the viva over I felt like I was lacking in purpose. I had corrections and papers to work on, but those were distractions from the sudden looming nothingness that came from the sudden end of what had taken up three and a half years of my life. I’d stop being paid a while back and was relying heavily on the kindness of my friends, subsisting on my savings and whatever demonstrating work I could pick up, anything to avoid having to leave Falmouth.


This was important to me. I’ve lived here for over eight years now, and as such was reluctant to leave. I wanted to try and remain near the university in some capacity, where I could benefit from collaborations on papers and get advice from others’ experience while applying for jobs. I also felt it was important to try to maintain my independence.

However, I knew I was going to have to leave eventually. Eight years is quite a long time to remain at one institution and so any job I applied for would definitely not be down here. In some ways, the further away the better. My main objectives with finding a post-doc was that it would allow me to continue studying something relevant to my research interests (social information use, group behaviours etc.) and that my skills were adequate. Aside from that, I would go anywhere and study anything.

So here I was, malingering, doing teaching work, making pretty figures in python, trying to write papers, applying for some post-docs and getting used to rejection.

Then a friend in the office e-mailed me a job that they had seen advertised that they thought sounded relevant to my interests. Which it was, enormously. I spent a good long while checking my CV and cover letter were as good as they could be. There was a lot of proof reading by various people. To cut a long story short I got a skype interview and then, to my infinite surprise, came home late one night to find I’d been offered the job.

I always said that if I were to move away from Falmouth that I’d rather move a long way so as to make it a clean break. I definitely succeeded with this job. The reason that I was interviewed using skype was because this particular post-doc happened to be at the University of Ottawa, Canada.

I am very excited about this.

Canada was a place that was definitely on my list of places that I’d like to visit, but at the time of application this seemed of secondary importance compared to the project. I deliberately avoided thinking about it, as I didn’t want to get too excited about a job I might not get. I received quite a lot of mockery upon telling the office that I’d got that job, when they realised I hadn’t even looked at where  Ottawa was on a map. I have to admit, I always pictured Canada to be something like this:

2008-05-19-082With apologies to Three Panel Soul


Still, now I have to face the reality of moving there. I moved down to student accommodation in Falmouth eight years ago. I’ve never properly moved to a new city, let alone a new country. There are a million things to do before I go and it’s all somewhat terrifying. Very exciting as well.

I’ll definitely try to keep this blog going. I’m not quite done with studying shags just yet and there will no doubt be amusing trials and tribulations as I move to Canada and start my new job.

I may have to consider a new name though. The chickadee project doesn’t really roll off the tongue.




Scilly Swim 2015

I can never manage to stay away from the Scillies. A few months after the last time I was there I’ve been back again, to once again help out with safety cover on the Scilly Swim Challenge. Once again, about 180 mad swimmers attempted to swim between and walk across 5 (6 if we count a brief walk across Samson) of the islands, starting from St. Mary’s. This is a total of 15 km of swimming in waters several degrees colder than those around the mainland.

12004886_10207527983297343_8931950399790079652_nPhoto credit: Joanna Clegg

As before our job was to escort the swimmers, keep them going in the right direction and help them if they got into trouble. Things were a little different this year. The swimmers were divided into different pods depending on their swimming speed. I was at the back right of the red pod, which contained the fastest swimmers. We also weren’t quite so luck with the weather. There was a fair amount of wind and not quite so much sun. Nevertheless the swim went ahead.

11218977_985302754855073_8331219076574987428_nPhoto credit: Jo Kehyaian

Despite the wind the first few legs were fine, with the wind dropping for the first leg to St Martin’s and various islands providing shelter for the next few legs. We were well fed at every stop, with more cake than the mind can comfortably comprehend.

As with the previous year, it was the leg from Bryher to St. Agnes that proved tricky. As before, the swimmers became more and more spread out over this long stretch. The other kayakers at the back of my pod fell back to keep an eye on stragglers, leaving me alone. Large swell was also coming in from the Atlantic, as well as rolling up the main channel between the islands, resulting in a messy sea that made it difficult to keep track of swimmers. The swimmers were having trouble seeing where they were going when being lifted up and down by the waves. These conditions were tricky to hold position or paddle slowly in and I can only imagine how incredibly difficult it was to swim in.

The sea became calmer as we got closer to St. Agnes and a large number of our pod successfully swam the entire way. Nevertheless some of the stragglers had to be pulled out and the decision was made to cancel this leg for the slowest pod. The final swim of the day (St. Agnes to St. Mary’s) was postponed to the following morning.

12039570_10153758815670039_1356434781389106719_nPhoto credit: Lucy Burniston

The conditions the next day couldn’t have been more different. The sun was shining and the wind had decreased significantly, making the final leg significantly easier. Last year the tide had adversely affected this leg, leading to swimmers clambering up rocks to escape the strong current. This year the tide helped the swimmers, who got to finish on a sunny beach instead of climbing out early and jogging along a coast path.

 12002743_10153758809845039_6876654144773484895_nPhoto credit: Lucy Burniston

Some of us then took the opportunity to paddle around St Mary’s in the sunshine, before heading back to prepare for the party that night.

12011272_10153347582514262_1324079127412321459_nPhoto credit: Gary Ringrose

It was great to see and paddle with many of the same kayak support team from last year again, as well as several new faces. The swimmers were once again fantastic, remaining cheerful in the face of all the potentially tricky conditions and chilly weather Thanks to all the organisers, swimmers and fellow kayakers for another fantastic weekend.

11904747_10153661329751474_7521079177259851366_nPhoto credit: Sarah McCartney

The viva


This sign has been at the  bottom of my road all week. Constantly reminding me that my viva is imminent (SOON. DON’T FORGET. DON’T STOP THINKING ABOUT IT FOR EVEN A SECOND. DID YOU STOP THINKING ABOUT IT? LOOK AT THIS SIGN! etc). Making it impossible to forget that on Monday I was going to have to defend my thesis.

This translates into me sitting in a room for several hours while experts in my field discuss my thesis in great detail. One of these was Matt Witt from my own university, who I at least knew. The other was Ian Couzin, who I did not. I had seen him give a plenary at Behaviour in Newcastle. This talk basically seemed to consist of one extremely clever experiment after another, all flowing naturally into each other.

Now almost all the people I’d spoken to about their own vivas had told me that I should enjoy it, as it was the only opportunity I’d ever have to discuss my work with experts in my field and the only time anyone would ever care about my work that much. I told them they were filthy liars and went back to worrying about having to talk to these people, both of whom had done a ridiculous amount of fantastic science, about my little corner of shag-related study.

The final week of fretting eventually ended and the big day arrived. People in my office were treated to the strange and comical sight of my head protruding from a suit.


After about twenty minutes of wearing a hole in our office carpet I finally headed to the room where the viva was due to take place. My thought process at this point basically consisted of white noise and the occasional “This is it!”. I’d been doing this all day yesterday as well: “By this point tomorrow, it will be over”, “One more sleep” and so on.

So as I lurked in the corridor waiting to be asked in, all I could think about this was going to be the culmination of about three and a half years worth of work.

I am not sure how much I can say about the actual viva. It’s all a bit hazy. Facts:

  • I was in there for about three and a half hours (hey, that’s about an hour for each year of PhD!).
  • The examiners tried to put me at my ease immediately (which definitely  helped, but I was probably still extremely tense throughout the whole thing)
  • We opened with a discussion about working with shags. I think I may have chuckled ruefully as some point.
  • We discussed a lot of interesting ways that the field of collective behaviour might go and how technological development might help that.
  • There were biscuits at one point.

Then it was over. That was it, done! I picked up my thesis and proceeded to the traditional cake and bubbly celebration in our common room.

11855442_10155927591285268_882798125_nCake! (By Sheridan)

There were also presents, the main one being a rather nifty knife/multitool with a custom message on it:

And a shag’s skull in amber from my friend Sarah:


Then, it being a Monday lunchtime, everyone shuffled off back to work. Leaving me wondering what to do next. I went and had some lunch myself, then hurled myself into the sea to try to counteract the effect of the bubbly I’d been drinking. It felt extremely odd to have finished.

In the evening we celebrated by visiting my normal haunt, The Waterfront which actually appeared on the front of my viva card, courtesy of Emma Wood:

IMG_0573The Front!

Followed by a curry, and then more drinks at the Front. I did my best to cope with the many drinks and not fall asleep before midnight.


Falmouth on a Monday night being what it is (not to mention that I was feeling extremely sleepy at this stage) after midnight we returned to my house for some viva whisky. This ended up taking a while.

So it’s all over. I have some minor corrections to make but for all intents and purposes I have finished my PhD. Naturally I’d like to try and get some of the other chapters published, which will mean going back through the data and writing I’ve already collected/written, but for the most part I now have to think about some big questions. Namely, what on earth do I do next?





Leaving the Scillies (again)

Every time I come back from the Isles of Scilly it sort of feels like it might be the last visit for the foreseeable future. But every time I think it’s all over, I always find myself going back. Sometimes it’s so I can go to seabird meetings or to support Scilly swims. This time it was so I could attend my 5th Isles of Scilly fieldcourse, something I also thought I’d never get to do again!

shags3Oh good, they still do that

I attended this field course myself as an undergrad (and did a project about shag diving behaviour, little knowing the future). During my PhD I went out every year with the field course and was abandoned on the island at the end of it.

byeA familiar sight, watching the Scillonian leave me behind

This year was different. At the end of the course I came home with the rest of the staff and students. Also different this year was the date of the field course. Previously the course had always taken place in April/May which often resulted in mixed weather conditions. This year it was in June! In the sunshine! This made quite a difference (certainly it resulted in less tent based destruction).

There was also a complete changeover of staff, with myself being the only one who had done the previous field courses. This led to quite a lot of headscratching as I did my best to recall how things had worked in previous years.


It was lovely to get back to the islands and catch up with many of the islanders who had helped me during my fieldwork, and to catch up with the local wildlife. There were definitely more puffins spotted on our boat trip than there had been when the course had been earlier in the year (resulting in less instances of staff members nearly getting thrown overboard).

We were also treated to the sight of several red kites getting mobbed by most of the gulls on St. Agnes (more kites than had been seen on the islands for almost a decade)  and with the help of Will Wagstaff (Who I just discovered has a wikipedia page!) some of us also got to see a bee eater.


Of course there were also plenty of shags hanging about. It was very nice to see the rafts in the flesh again, not squinting at tracked individuals moving on a screen. During a trip to St. Martins we travelled past a large raft, allowing me to enthuse about what I (think) I have found out about them. Some of the students might even have been interested!

puffinbumBye then..

On leaving the islands, I once again have no idea when I might be back. It’s unlikely I’ll ever have another chance to spend so much time in such a fantastic place. I’m incredibly grateful to have had the opportunity, and to all those who have made living and working in the Scillies such a pleasant experience.

But I’m sure I’ll be back.