Saturday 27 April 2013

Does Corsair enjoy our company?

We work full time and as such, the cats spend most of their time without us at home. And of course when we do come home, we lock them inside for the night, so they are stuck with us all night, despite the pitiful banging on the locked cat door.  Which raises the question, do the cats spend more time at home when their humans are home?






Do they really all sleep on our bed all day, or did someone just forget to turn off the electric blanket?

It is a Sunday, this morning we attached the GPS logger to Jumble.  Jumble is our oldest cat, he is 13. So far despite us gently encouraging him to go out and collect interesting GPS data, he has spent over an hour sitting on me, another hour sitting on Nigel helping him play computer games and a couple of hours sleeping in the sun in the back yard. Magellan is stalking an orange cat in the back yard and Corsair is asleep on the bed.

So we ask the question, are they more likely to stay home if we are home?  We have a couple of housemates who provide ancedoctal evidence that says the cats are less likely to hang around the house when we are away on holiday.

So we pulled Corsair's GPS logging data from Saturday. Nigel was home all day Saturday. I was home Saturday afternoon. This data provides an interesting contrast to the three days of Corsair's travel data from last week, presented in the last post. Those three days of data were weekdays. Nigel came home in the evenings and I was out doing fieldwork so didn't come home at all for two of them.

The data shows that on Saturday morning Corsair got up, wandered over to House B at around 8am, probably for breakfast, then came home and spent pretty much the entire day at our house.I left the house at about 7am for an early morning bike ride. One of our housemates fed the cats and unlocked the cat flap as she left for work at about 7:30am. Nigel, with the house to himself enjoyed a leisurely sleep in and got out of bed around mid morning. Co-incidently, around the same time Corsair came home from her morning wanderings.

Ths map shows how many points we recorded within each property on Saturday. The vast number of points were recorded in our house with 265 points. The second most number of points were our immediate neighbours, with 116 and 58 points respectively.  House B only recorded 23 points and House B's southern neighbour recorded 47 points.  She also appears to have wandered through less properties on the weekend, 24 as opposed to 30+ and she spent more time on our side of the street.



We should also point out that the GPS logger cost all of $50, its a cheap device and there is every possibility that even with us filtering out the bad data, the good data is probably only accurate to within 10m and the OK data is probably only accurate to within 20m. So some of those points in our immediate neighbours properties are probably innaccurate and the cats are actually within our garden. We have to acknowledge the potential margin of error.

The map below illustrates the margin of error problem quite clearly. The data is time stamped and colour coded accordingly: 0 stands for midnight, 1 = 1am, 2 = 2am etc. Corsair was locked inside between 8pm and 7am and asleep on our bed for most of that. Yet the map shows points being recorded up to three houses away.  Which shows that even with the data being filtered for horizontal dilution of precision the GPS is still fairly innacurate.  That or Corsair has super escapey powers and there is a secret cat door that we are unaware of.  This map does clearly show that Corsair wandered over to House B in the early morning and that once Nigel got out of bed, the focus of activity was our house.  At 3pm the batteries on the GPS ran out :)


Now you can get GPS's with sub-centimetre accuracy. The GPS units we use in the field doing archaeology look something like this. A large ruggardised tablet sized device attached to a 2m aerial. Not really something you can attach to a cat. Also these units cost thousands of dollars.



So does any of this tell us if our cats really love us? Or does it just point out the limitations of GPS?  Do our cats really appreciate our company?  I notice that on days when I work from home, they are more likely to spend time inside. When I used to work from home full time, I certainly had company all day, even if only one cat at a time. I know Magellan has sat on my desk and watched me type most of this post. I know that when I came home from my bike ride yesterday afternoon I found Jumble and Nigel napping in the hammock.


 I don't know what you think, but that looks like love to me.




Friday 26 April 2013

Does Corsair have a second home?

So our initial research question was 'does Corsair have a second home'. Our early GPS logging experiments showed that it looked like yes, she was appearing to spend quite a bit of time at a house across the street. But then we began to question the quality of our data. The last couple of posts detail the methods we have used to refine our data and determine good data versus bad data.

So having solved the data issue, we attached the GPS logger back to Corsair and sent her out to collect some interesting data.





Corsair can be a very appealing kitten, would you feed her if she showed up on your door step and looked at you with big eyes?

It's also worth noting that in an attempt to discourage people from feeding her, we have attached little tags to all the cats collars saying 'Do Not Feed'.  This actually does appear to be working as she now reliably comes home hungry for dinner, which she wasn't before. Either that or the white plastic blinking box attached to her collar is scaring people.

So we have taken three days worth of data and plotted it on a map. We've stripped out the 'bad' data and only presented the good data on this map.


So you can see that like Magellan, Corsair is really only wandering less than 200m from our house. However, unlike Magellan, there are two focal points of activity. One based around our house and one based around the house of a neighbour who lives a block over.

So we refined the data a bit more, trying to determine roughly how much time she was spending in other locations. The map presented below shows how many points occur within each property boundary. We've looked at how many points for each property and colour coded them according to how many points have been recorded in that area. Corsair is wandering through at least 33 different properties. There are two properties with over 284 recorded points. Those are our house (House A) and a neighbouring house a block over (We will call that House B). The houses adjacent House A and House B have the next highest number of points recorded in them. Interestingly she does seem to be spending more time in the block over the road, rather than within our block. She does seem to spend approximately the same amount of time at both our house and House B, with 416 points being recorded within our property boundaries and 417 points recorded in House B. This suggests its probably about time to go knock on the door of House B, or at least leave a polite note in the letter box.



I know the neighbours immediately to the south of us have cats, the neighbours immediately to the north of us do not have cats.  Our neighbourhood demographic is largely older Italian people and younger Middle Eastern (muslim) families.

Our neighbourhood seems to have quite a few cats, but no dogs, or at least I don't hear dogs barking, or see people walking dogs. I do see quite a few cats, usually those being chased out of our back yard by Magellan or Jumble.  Corsair on the other hand smiles at the other cats, makes friends, invites them in the back door and shows them the location of the food bowl.  She is a caring sharing type and looking at the size of her ginormous belly, I suspect a bunch of the cats reciprocate.

That said, we also suspect that our cats have 'infrared vision'. We turned on the ducted heating for the first time this year as the weather is getting colder. Within five minutes, all three cats were inside sitting on the heating vents. Maybe they will spend more time at home in winter.


Above is a photo of a Corsair in her natural habitat.

We don't have night time data for Corsair, she has been reliably coming home for dinner and getting locked inside. Although she has not yet learned that banging on the cat door at night won't make it open. Her preferred sleeping position is at the foot of our bed.

So next week - it's probably about time Jumble got to wear the GPS logger.

So my dear readers, are there any questions about our experiments you would like answered? If we can answer them with the data we have we are happy to try.








Friday 19 April 2013

Where does my cat go at night?

Its fairly well established that you should lock your cats in at night. The theory says, cats are more likely to get in trouble overnight, it is their natural hunting time, they are more likely to have fights and they are more likely to get hit by a car. Additionally many local councils in Australia have a cat curfew, were you are required to keep your cats inside at night.  So as responsible cat owners, we try to lock our cats in at night.

But there are some nights, they just don't come home, regardless of calling of them or attempting to entice them with tins of tasty cat food. 

So the question becomes what does my cat do at night? A question I am sure all cat owners have asked themselves. Where is my cat? At an all night raves? Having wild kitty sex? Hunting the native wildlife? Is my black cat chasing cars in the black night? Given Magellan didn't come home the other night while wearing the GPS logger, we decided to find out.


Firstly, to go back to our previous post,  where we talked about the search for accurate data. Nigel has finishing his coding, built his data base and has produced data sets with all the required attributes and we can now filter the cats movements using horizontal dilution of precision, these filters can then be used to show us the accuracy of the data.

The map below shows 13 days worth of data from Magellan. This data is filtered using horizontal dilution of precision and then presented using colour coding.  By doing some clever maths you can assign dilution of precision values.  I'm really bad at maths, if you like maths - read this link to explain how it all works

http://en.wikipedia.org/wiki/Dilution_of_precision_%28GPS%29

In the map below, the green dots represent data we consider to be good precision. Yellow is okay precision. Orange and red is most likely to be really bad and unreliable data.

So you can see if the non geek was was looking at the straight output from the GPS logger it would appear that Magellan is travelling up to 520m from our house in any direction. However, once you filter out the unreliable data, it appears he is much more of an home body and is only travelling around 120m in any direction from our house. Its also something of a relief to note that he is only regularly crossing one street and it is the quiet suburban street in front of our house.

Now we only have one nights worth of data for his night time adventures.. This data has been filtered to only show data between 7pm and 7am (which is pretty much between dawn and dusk at this time of year).


Interestingly it shows pretty much the same level of travel as his daytime roaming, in fact at night time he apears to be roaming even less, with the furthest distance from our house being 86m.  So when you are calling them at night, its not that they can't hear you, it is that they are ignoring you. He appears to be going no further than 3 houses away.  But then I guess when you are cat sized, the world is your jungle and you find your adventures where you can.




Now I realise that one nights worth of data is a statistically insignificant data set, but we are still trying to keep them in at night. So it is probably time to return to our original question of does Corsair have another home?  Or does Jumble really sleep all day?  Its time to take the logger off Magellan's collar and collect more data from the other cats that we can analyse using the new data collection protocols.






Sunday 14 April 2013

The search for accurate data

As we discussed last post, we are having issues determining what data is accurate and what data is not accurate. In today's post we discuss the steps we have taken to get more information and be able to get more accurate data.

We first sorted the data by adding a simple filter to strip out points where the cats are travelling at 0kph and at speeds of faster than 10kph.

However cats can go faster than 10kph, so our initial filter based on speeds wasn't a very good way of sorting out good data from bad data.  According to Google a cat can pretty much travel at 5kph indefinitely and get up to speeds of 50kph over short distances.  So yes, Magellan could easily travel further distances than he does. However, I still don't believe he made it to the industrial zone in the next suburb over in the space of 20 seconds.

So let me explain how the data is gathered.

Warning: This post contains Technical Information alert.  I'll add cute cat photos below to keep the non geeks interested.

The GPS logger is attached to the cat's collar at the start of the day. They are fed and then the cat door is opened.

In the evening, the cats are called inside, fed and locked inside. The GPS logger is removed and plugged into the computer to charge and for us to download the data.

The data from the device is retrieved using a program called @trip. The data is then exported from into gpx format. The gpx data that is produced using @trip only provides data on latitude, longitude, elevation and speed.

The gpx file format does support other data such as recording the number of satellites used, horizontal dilution of precision and vertical dilution of precision.

So the question becomes can the GPS logger actually record that additional information about satellites and precision?


So we went to Google for answers.

Corsair likes it when we sit still and play on the computer.



After a long time Googling we found a document that someone had assembled explaining how the data is actually stored and extracted from the GPS unit.  They had gathered this information by reverse engineering the protocol that @trip uses to communicate with the GPS. They used this to build an open source program called igotu2gpx.  

We installed igotu2gpx and used the program to extract some data from the logger and export it as gpx.

This data set contained longitude, latitude, elevation and number of satellites. But it didn't present data on the horizontal dilution of precision or speed.

We wanted to know speed and the horizontal dilution of precision so we had to change the program to do that. It was surprisingly easy to do, as the guys who had written the software had already found those values in the data and made them available, it just wasn't being shown in the data outputs.  So with a little C++ scripting the software was adapted to give us the data we wanted. Hooray for Open Source Software!

Magellan also has excellent coding skills.



Next step is to build the PostGIS database.  And possibly clean our desks before posting pictures of them to the internet :)

Next post will present some maps using our new refined data and seeing if that makes a difference.

Also Magellan didn't come home for dinner a couple of nights ago and so we have some night time data. It will be interesting to see is there is a difference in the night time versus day time roaming habits.

And Nigel wants to buy two more GPS loggers so we can track all three cats at once....

If you are enjoying this blog, or would like to critique our methodology, please comment and let us know.

Thanks for reading








Friday 12 April 2013

Does Magellan have superpowers?

Magellan has been wearing the GPS logger for a couple of weeks now.

On Day 1 he managed to lose his collar. Luckily a search of the back garden found the collar tangled in the netting which is theoretically there to protect the tomato plants from things like being eaten by birds and to prevent cats sitting on the seedlings.

On Day 2 he managed to get locked in the garage all day.

On Day 4 he managed to get onto the roof and then couldn't get down again.

Yesterday I had a day off work and he spent most of the day inside keeping me company despite being exhorted to go outside and collect some interesting GPS data.

However, on Day 3 he exhibited super powers.

Does this look like a cat with super powers to you?



He wandered around our house,  exploring the neighbourhood in an approximately 100m radius. Then suddenly he zoomed off, out of our little residental suburb, through the reserve, over the creek and into the industrial zone in the next suburb over. A distance of approximately 1.5km.  Wow!  That is a huge distance for a little cat, and the creek wouldn't be easy to cross unless he used one of the pedestrian bridges.

So we looked at the data a little more.  It appears he made his journey to the industrial zone in approximately 20 seconds. Supercat powers activate!

This meant it was time to take a look at the data, was it possible the GPS could be recording erroneous points?  It was quite possible, and there are known issues with the GPS, particularly in urban areas with regards to interference, lines of site, buildings in the way, signals bouncing off buildings that sort of thing.

Google for 'multipath reflection' if you want to learn more about this issue.

So we needed to refine the data, because as all good geeks know, if your data isn't accurate, it is pretty much worthless.

So we applied a filter in the GIS software to only show data where the speed was greater than 0kph and less than 10kph. So yes, we also aren't interested in knowing when he is sitting still, only when he is moving. Then the map looked more like this.







The green dots represent what we believe are the good data and the red dots represent points were the speed is recorded at greater than 10kph. This shows that Magellan is much less adventurous than initially thought. In fact it also shows that he appears less adventurous than Corsair, confining his wandering to primarily our house and the neighbours either side.  But of course, it also calls into question the initial data we got for Corsair, did she really wander off in a straight line for 600m, or is that another example of erroneous data?

So we applied the same filter to the data from Corsair's adventures back in Febuary.  See the original map here.
The new map with the filter applied is presented below.


And we got some very surprising results.  While some of the data shows Corsair moving at speeds of greater than 10kph, which we are considering unreliable data, we also have what we are considereing reliable data, which shows that she did make those journeys in straight lines out and back again.  She is roaming at least 600m from the house and she is also roaming a lot further than Magellan.

Initial conclusions we can make. Magellan probably doesn't have super powers. Corsair roams much further than Magellan and stays away from our house for longer periods of time.  I do not know how much of an impact Magellan's car accident had on him, while he does appear to be completely physically recoved, he does seem to spend more time at home than he used to.

Also - house cats can move very fast, especially over short distances. I'm not sure what the top speed on a house cat is. It looks like we need to investigate better ways of extracting data and being able to determine 'good' versus 'bad' data. 

Nigel is building a post GIS database in order to assist us to more effectively evaluate the data over time and make it easier to query the data.

Upcoming topics: Magellan stayed out all night with the GPS tracker, so we can find out if their night wanderings are different from their day wanderings

And its probably about time Jumble got a chance to wear the GPS tracker.














Saturday 6 April 2013

First Days of Data

How does the GPS logger work?

We have a little plastic holder that attaches to the cats collar. The GPS logger is easily inserted and removed from the holder (though it's significantly harder to insert and remove while the cat's attached!).  The GPS logger weighs 22 grams and is about the size of a matchbox. It charges via USB overnight. The product specifications say it has approximately 30 hours of battery life, however we've found that it more like 12 hours, although you can configure it to take more or less samples which would probably extend the battery life. The photo below shows the blue plastic GPS holder attached to Corsairs collar, it also shows her incredibly fatty belly!



We have configured it to record co-ordinates every six seconds.  Advice on the support forums suggests that configuring the device to record points less frequently actually uses more battery as it goes into sleep mode and then has to reacquire the satellite connection.

The GPS logger is not a real time GPS tracker (those were a lot more expensive), it just records data that we can download.

At the end of each day we download the data from the GPS logger into the software that came with it. That software is called @Trip PC. Then the data is exported as a .gpx file and loaded into QGIS where we can then view the data overlaid onto maps and manipulate the data, for example getting it to show time stamps which allows us to draw conclusions.

Does Corsair have another home?

So our initial research question was, does Corsair have another home?

As such I present our first two days of data logging of Corsairs daily movements. This data was recorded in late February (which is summer in Australia) and both days were sunny and warm with a top of 28C.

Each of the points on the map indicate a set of GPS co-ordinates collected by the logger. As you can clearly see the focus of activity is clustered around two houses, one is our house, the other is in the next street over. She also spends quite a bit of time in the two houses either side of us. She also goes wandering up to 600m on straight walks out and back. Its interesting to note that the bulk of her activity comprises of meandering in an approximately 100m radius. When she goes further it tends to be a direct walk, straight out and back in a fairly timely fashion.

Personally I'm relieved to learn she is not going down to the parkland near the creek. This would be the area that they would find native animals to hunt.  I have no issues with them hunting mice, but I would get upset if they started bringing home native birds and animals. I should emphasize that my cats are kept inside at night, are de-sexed, micro-chipped and vaccinated.  You are probably going to need to click on the map to view more detail.


 This second map shows only one day of Corsairs movements, but we have colour coded the points to show what times of day she goes where. The colour scale is gradiated, starting with dark red for morning and gradually changing through orange for late morning, yellow for early afternoon, green for late afternoon.



What this map shows us is that she pretty much spent all morning at our house and around our house, while pretty much the entire afternoon was spent at someone else's house.  Our house was the focus of activity for her morning adventures. House no. 2 was the focus of activity for her afternoon play.
This is only one day's worth of data, and looking at the first map, shows that while she spent a lot of time at House no. 2 on the first day, she spent very little time there on the second day. 

So we can't definitively say she has another home yet. 
Obviously the solution is we need more data!!!

Stay tuned for the next post - Does Magellan have superpowers? (otherwise titled the fallibility of data)







Thursday 4 April 2013

Research Questions

So what are our research questions?

We'd like to know if Corsair has a second home, or really to determine if there are any patterns we can figure out to see if we think neighbours are feeding her so we can knock on their door and ask them to stop.

What other research questions would we like answered by analysing the data from our statistically insignificant sample set?

- Can we justify spending $50 on a GPS logger?
- Are there recurring patterns in the cats daily movements?
- Do the cats stay within the residential area, or do they wander down to the open grassland and nature reserve near the nearby creek?
- Do they visit the local schools and if so, at what times?
- Does the age of the cats make a difference?
- Does the gender of the cats make a difference?
- What times of the day are the cats most likely to be at home and wandering?
- By comparing Magellan and Corsair's travel data - do we think the recent cat accident has inhibited Magellan's roaming?
- How far do they roam?
- Is the extent of their roaming weather dependant?
- Do they follow the sun?
- Do they stay home on rainy days?
- Is their roaming patterns affected by seasonal change?

 Please - I'd like to hear your suggestions for research questions we can answer - please comment with suggestions.

I think today's GPS today is going to show us that Magellan spent most of the day locked in the garage.


Can cats go further if they travel by bike?




Wednesday 3 April 2013

So Who Are We?



The Cat ‘Owners’

Renee is an archaeologist with a keen interest in landscape archaeology, history and GIS. Renee also believes that the internet is for cat pictures. Below is a photo of Renee knitting with Jumble's help.


Nigel is a geek and programmer extraordinaire and a firm believer in the scientific method.Below is a photo of Nigel and Corsair.





The Experimental Subjects

We live in a low density suburban area with a nice sized back yard. The cats are locked in at night and have access outside during the day. There is a cat door, so they have access to the house at all times.  All three cats are short hair domestic cats, all three are rescue cats who were adopted as young kittens. All three cats are desexed and healthy.

Corsair is a two year old female cat and fairly overweight for a young cat. She is an active young cat who likes ‘fetching’ things and bringing them inside to show off, said things include flowers, rubbish, leaves and mice. One of the goals of this research is to determine if she has a second ‘home’.

Magellan is a two year old male cat, he is underweight. He is also an active cat. Both Corsair and Magellan are the same age as they were adopted at the same time but they are not litter mates.  Magellan was in a car accident at the end of December 2012, he broke his pelvis, and while he appears to be fully recovered it will be interesting to know if the accident has slowed his wandering.When you name a cat Magellan you spend a lot of time explaining no you didn't name your cat after a GPS, he is named for the explorer, which is indicative of his personality.



Jumble is a thirteen year old male cat. He is a lovely cat who is slightly overweight. We assume because he is older, he much prefers sleeping on the couch and is much less active, but it will be interesting to see if that is the case.

What is Map My Cat?

So we have a cat, well we have three cats actually. One of them is a ‘little’ overweight, so we put her on a diet. She didn’t seem to loose any weight. We assume she is probably finding other food sources, like friendly neighbours. So what did we do next?  Well, normal people would do things like keep their cats inside (ours are kept inside at night but allowed out during the day), or maybe they would buy a tag that says do not feed. But we are geeks and needed a more sophisticated solution. So we brought a GPS logger and attached it to our cat. Then we collated the data, utilized  Open Source GIS software, Open Street Map and Google Earth to analyse her daily movement patterns – and well – this blog is to present the results of our experiments.

We will be presenting maps, our research questions and conclusions, GIS data on request and of course, lots of cat pictures.