Thursday, December 19, 2013

Controlling the world's largest telescope with a Nexus 7

it's 5:30 in the morning, and I'm playing with my tablet. But this isn't a Candy Crush all-nighter, or even a Minecraft marathon. This is work - I'm using the tablet to observe. Via a combination of free apps from the Google Play store, I've taken control of the biggest telescope in the world, the Arecibo 305-m.
Remote observing allows observers to connect to the telescope from anywhere in the world (if they have an internet connection). People use Linux boxes, Macs, Windows PCs and, nowadays, tablets. I'm using a +Nexus 7, its high-resolution screen making it ideal for this sort of task.
To connect to the telescope, I'm using two pieces of software - an SSH  client and a VNC viewer. The first of these isn't, strictly speaking, necessary. I use it only to log in to the Arecibo Linux network and start up a VNC server, something I could do from a different computer at an earlier time. However, computers crash and there's no absolute guarantee that a VNC session started earlier will still be running, so I like to have the SSH client to hand. I use JuiceSSH, which is simple and does everything I need it to do.
The second app, the VNC client, is absolutely essential. By connecting to a VNC session running on the Arecibo system, it transforms the tablet into a remote terminal that can do (almost) anything I could do from the control room. I use the bVNC app, which supports SSH tunnelling in its free version, allowing me to connect through the gateway machine to a computer in the control room.
Once I'm in, the operator turns over control of the telescope to me, and I'm away. I can tap a source on the graphical display and bring up its information, then hit another button to send the telescope to point at that source. I can tweak the settings for the observations, or even change to a completely different observing mode. I can call up monitoring software and watch the data flow in, or even run a quick data reduction script to see if I've found anything.

This is all great fun, right up to the point where the operator says "time's up" and I have to hand the telescope over to the next user. And to think - I can do all this from the comfort of my armchair, with a computer I can hold in the palm of my hand!

Monday, December 9, 2013

When the network became a notwork

"When sorrows come, they come not single spies but in batallions" has certainly felt true over the last week. Firstly there were problems with the car, next with the wireless router, and finally with the wifi on the PC.
On Wednesday evening the car suddenly started making a metallic grinding noise. This was tracked down to the vicinity of the front driver's-side wheel. Being not much of a mechanic myself, I diagnosed this as needing to be taken to someone who was. Ideas included a problem with the brakes and a problem with the wheel bearing (all too common with Puerto Rican roads, alas).
So on Thursday morning I drove rather gingerly down the road to our local garage and dropped the car off. The mechanic didn't know whether he'd get a chance to look at it that day or not, but as I wasn't about to drive the car anywhere until it was fixed I left it there and walked home (about 5 minutes up the road).
I was able to get lifts in and out of work on Thursday and Friday, although this meant that I got home about 3:30 on Friday, intending to do more work at home. Unfortunately, we had (apparently) no internet connection. This isn't that uncommon an occurance, so I phoned up my ISP to find out what was happening. They told me there were no problems at their end, and that they could see my router. This was a bit unusual, so I tried plugging the PC straight into the modem. We had internet - but the router couldn't see it!
At this point I switched tasks, as 5pm was approaching, and walked back down to the garage to check on the status of our car. This turned out to be 'mysterious' - the noise had been there on Thursday when they had moved the car around, but had vanished by Friday when they had had time to look at it. They had checked the brakes, wheel bearing, gearbox, etc. and all were fine, so they said to bring the car back if it started making the noise again. They also said - and this is one of the bonuses of being in Puerto Rico - that they hadn't fixed anything, so there was no charge for the time spent looking for the problem!
So, back home and back to working on the router. Following instructions on Belkin's website, I tried resetting the router and running the setup utility, and (when that failed to improve matters) gave them a call. It turned out that the router was still under warranty, if it was a hardware problem, but that my free over-the-phone support had expired so if it was software I would have to re-instate this, at a cost. It did, of course, turn out to be software, so I gritted my teeth and gave them my credit card number. That's when things turned surreal...
The support lady came back to me to say that they couldn't process a card with a Puerto Rican address, as it wasn't in their system. They could take cards from the US or Canada, but not US territories, so she couldn't tell me how to fix the router! She even checked with her supervisor, but 'the system' was king, and there was no way for me to give them my money, so I said goodbye and decided to do some poking myself.
I started by plugging the PC back into the modem. Nothing - the internet had gone down at the ISPs end while I had been on the phone. Fortunately it came back rather quickly, which enabled me to discover that the hive-mind of the internet has very little useful to say on how to fix faulty routers. With a bit of poking around in the settings, I was able to get the router to pass on the connection wirelessly using 'Access Point' mode (which didn't require an IP address for the router). The downside of this was that none of the router functions were available, so I only had the single IP provided by the ISP and (for some reason) I could only access this from the PC, not from the tablet. At this point I gave up and went to bed for the night.
The next morning, the wifi on the PC had stopped working. There was a wifi signal coming from the router, but the PC could no longer see it (the tablet could, but it couldn't get an IP address from the ISP). Time for a trip to Office Max! There we found a USB wifi aerial, and also spotted a wireless router that actually cost less than Belkin's telephone support. It was only single-band, while the older router was dual-band, but we had only ever used the s-band wifi as the c-band signal doesn't pass through our walls, so no real loss there.
Back home, the new router and the USB aerial were easy to install (although the PC is now perilously short of USB ports), and we finally had a network instead of a notwork!
Codicil: I celebrated having the internet back by tweeting "Back online with a new router. Won't be buying @belkin again, at least not until they can give customer service to Puerto Rico!" This led to a reply from @BelkinCares: "Hi Robert, allow us to assist you. What is your #Belkin product?" I've been trying a few things with them - so far the only thing they got me to do that I hadn't already tried was running the setup from the CD (which I had forgotten I had). Unfortunately this turned out to be identical to the setup I had run from the PC before, so I haven't yet got two working wireless routers...

Sunday, December 1, 2013

Exercise - why bother?

It seems that the HR department up at USRA would like us to take more exercise. At least, that's what they keep telling us. They even have events to encourage people to exercise, such as walking competitions and the 'New York minute'. However, I haven't felt inspired to take part in any of these.
Leaving aside the somewhat dubious science behind some of the 'healthy living' advice in the 'New York minute', and the off-putting name (can anything associated with New York be good for you?), there was the chance to win an iPad mini - surely motivation enough? Alas, no. You had to reach a certain number of 'points' to go into the draw. Like the earlier walking competition, this meant that if you weren't already exercising a lot and following their (pseudo-scientific) idea of a healthy lifestyle, there wasn't much chance of winning anything. Rather than encouraging exercise, the competitions reward the already-fit and discourage those who are ostensibly being targetted.
Yet last week I took part in the Observatory's Thanksgiving 'Turkeython'. This event had no significant prizes - not an iPad in sight - but it was fun and social. This was exercise and team-building done right. I had a good time even though, like last time I entered, I ended up limping.
Maybe fun is a better motivator than iPads and competition! 
(Photo by Tony Acevedo)

Sunday, November 24, 2013

Why men should advocate gender equity - the case against the business case

A few weeks back, an article appeared on the Women in Astronomy blog by Ed Bertschinger on 'why men should advocate gender equity'. The main reason put forward was that this would ultimately benefit their departments. This argument, or variants on it, is often heard and was something I had been thinking on prior to the post appearing. I commented on Ed's post that this utilitarian argument missed the point - men should support equity because it is right, not because of some expected benefit in the future; Ed responded that his argument was indeed utilitarian, but that, while he was motivated by social justice, he was also a pragmatist.
My feeling is that utilitarian arguments, while they may have their place in making business cases (as I said in my original response), do a great disservice to the social justice movement when advanced more generally as a reason for people to support causes. They do not encourage people to act out of a desire for social justice, but for selfish reasons; they do not challenge anyone to 'check their privilege', but merely to reach some pragmatic goal of 'equity'; and they actively discourage anyone from speaking out against inequitable treatment that benefits them personally.
Yet these utilitarian arguments remain pervasive. Another example that everyone will probably have heard is that we need to build diverse groups because that leads to better decision making. But, an objector might ask, how often do we take group decisions in science? The PI system, where there is one team leader and a group of junior researchers, does not fit this model. Maybe team cohesion - which is negatively affected by diversity - is more important?
This leads to another question I touched on in my response to Ed: whether these utilitarian arguments are truly pragmatic. In academia, the employment situation is (in general) what economists refer to as 'Pareto-optimal' - any improvement in the prospects of getting a job for one person will reduce the prospects for another. This means that it makes no sense from a utilitarian prospective for a job-seeking member of a privileged group to promote the prospects of an under-privileged group.
It appears, therefore, that the utilitarian 'good of the department' argument can only be used pragmatically when dealing with those whose performance is measured by how well the department (or institute) as a whole performs - the heads of departments and the administrators. It has no pragmatic appeal to those already in permanent positions at the top of the promotion ladder, it only appeals to those seeking promotion (or tenure, where the tenure-track system is used) inasmuch as it has already been identified as a departmental priority (and even then visible support of the priority is more important than effective action), and it actually has negative appeal for post-docs, other junior researchers, and non-permanent (non-tenure track) faculty.
Fortunately, there are many people who are inspired by pro-social ideals, and these people should be encouraged. It is important (but difficult) to distinguish between those seeking affirmation for doing something they believe in, and those who are after 'cookies' or 'liberal brownie points'. The need for affirmation is human and should not be disparaged, or people may get discouraged and give up on the good they are trying to do. Those working for social justice may do so from a religious perspective, or may be secular humanists; they may have a well-developed philosophy or may be acting out of an instinctive sense of fairness; they may even believe that they are acting pragmatically 'for the good of the department' - but fundamentally they will be doing good because it is right, not because they expect to benefit from doing so.
The utilitarian argument leads to the conclusion that we should only act for a definite benefit, and only then if the cost of acting is less than the expected gain. The social justice principle, in contrast, says that we should always act, even if no benefit can be identified and even at personal cost. It is nice when doing the right thing brings a benefit, but if we are only doing it for that reason and not because it is right, we are acting selfishly, not justly.

Tuesday, November 19, 2013

Exploding the myth of e-reader battery life

It would have been interesting to have been in the room when the marketing folks revealed how they were going to spin the battery life of e-readers. Was the headline 'battery lasts for weeks, not hours' greeted with a standing ovation? Was the small print 'based on a half hour of reading per day' met with hushed reverence? Did the engineers bury their heads in their hands? (Quotes from's Kindle Paperwhite Touch page.)
Whatever the initial reception, there can be no doubt that it worked. In their comparison of e-readers and tablets, the respected technology site CNET says:
The other big advantage of e-ink readers is battery life, which is measured in weeks, not hours. Instead of using a reading app on a phone or tablet that will cut into the battery life you might need for other tasks, you can read as long as you'd like on an e-ink reader, and keep the phone ready for phone calls, email, or web browsing instead.
Hook, line, and sinker. This review is now quoted on Wikipedia as an authoritative source for the idea that e-readers have better battery life than tablets, but it is entirely based on marketing hype.
The Amazon Kindle Paperwhite claims a battery life of up to eight weeks, with wireless off and the brightness turned down. The Google Nexus 7 (2013 model) tests as having up to 9 hours of battery life in mixed-use tests at Surely there should be no contest? I decided to test the Nexus 7 under similar conditions to the Kindle to see what I would find...
The test setup was quite simple. I charged the tablet fully, turned off wireless, turned down the screen brightness to a point where I could still read comfortably, and read until the battery hit 90%. I used two epub readers for the test - Aldiko and Moon Reader+, both available for free from the Google Play Store. The OS was Android 4.3 (the 4.4 update that is supposed to improve battery life hasn't reached me yet). One mistake was that a weather app I had used earlier turned out to still be trying to check its server in the background; this was responsible for 5% of battery usage during the test period.
My first finding was that the screen dominates battery usage, taking about 85% of the power. The Nexus 7, like virtually every modern device, powers down unused parts of the CPU, so I was running on a single core at a low clock speed. The epub apps and the OS took about 10% of the power between them. Battery usage did not seem to depend significantly on which e-reader app I used.
The big shock, however, was how long the test lasted: I ended up taking the tablet to bed with me instead of the Kindle. To use up just 10% of the battery took 3.25 hours, implying a total life of 32.5 hours. Or 9 weeks, if it were marketed like an e-reader.
I was surprised. I had known that the Nexus would be a lot closer to the Kindle than the official figures implied, but that it actually had better battery life was astonishing. It may be that I got lucky - but 'up to 8 weeks' for the Kindle implies the best possible result is 8 weeks, so I don't feel I'm being unfair. Another potential problem may be that battery usage would change as the charge level dropped, but I've not noticed any such variation in general usage of the Nexus and have no reason to suspect that the battery meter isn't reporting correctly. It might also be suggested that I shouldn't have turned down the screen brightness - but I adjust the screen brightness to suit the conditions when using the Kindle, and in anything other than bright sunlight would have it on a higher setting than the one Amazon uses for their test.
In conclusion, the idea that e-readers have longer battery life than tablets is due to marketing hype and their different patterns of normal usage - comparing apples and oranges. When the Nexus 7 was used solely as an e-reader - comparing apples to apples - it actually had better battery life than the Kindle.