<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HiBlog: HiRISE Team Blog &#187; Linux</title>
	<atom:link href="http://hirise.lpl.arizona.edu/HiBlog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://hirise.lpl.arizona.edu/HiBlog</link>
	<description>High Resolution Imaging Science Experiment</description>
	<lastBuildDate>Tue, 08 Nov 2011 23:39:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Zooming In</title>
		<link>http://hirise.lpl.arizona.edu/HiBlog/2008/03/11/zooming-in/</link>
		<comments>http://hirise.lpl.arizona.edu/HiBlog/2008/03/11/zooming-in/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 16:09:13 +0000</pubDate>
		<dc:creator>GuyMac</dc:creator>
				<category><![CDATA[HiRISE]]></category>
		<category><![CDATA[Outreach & Education]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ames]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[IAS viewer]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JP2]]></category>
		<category><![CDATA[JPIP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[NASA Ames]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[tile pyramids]]></category>
		<category><![CDATA[tiles]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Zoomify]]></category>

		<guid isPermaLink="false">http://hirise.lpl.arizona.edu/HiBlog/?p=156</guid>
		<description><![CDATA[The IAS Viewer is our preferred tool for looking at HiRISE images in full resolution. It provides excellent support for the JP2 file format and the interactive streaming protocol for JP2 which is called JPIP. It is written in Java and installs automatically in a secure &#8220;sandbox&#8221; on your computer when you visit a link [...]]]></description>
			<content:encoded><![CDATA[<p>The IAS Viewer is our preferred tool for looking at HiRISE images in full resolution. It provides excellent support for the JP2 file format and the interactive streaming protocol for JP2 which is called JPIP. It is written in Java and installs automatically in a secure &#8220;sandbox&#8221; on your computer when you visit a link to it. These links are in a section labeled &#8220;JP2 Quicklook (IAS Viewer)&#8221; on <a href="http://hirise.lpl.arizona.edu/">the HiRISE web site</a>; every observation will have that on the right-hand side of the page. </p>
<p>We use the IAS Viewer ourselves in most cases. A prerequisite is having Java installed already on your computer; I&#8217;m pretty sure that both Microsoft Vista and Apple&#8217;s OS X do that by default, and most older versions of those operating systems do too. You can check by going to <a href="http://java.com/">java.com</a> and clicking on the &#8220;Do I Have Java?&#8221; link.</p>
<p>I have tested the IAS Viewer on a 2001-era computer (an iMac DV) with a low-speed wireless connection. Surprisingly, it worked about as good as on our work machines (dual or quad-core Macs with gigs of memory and ultra-fast Ethernet connections to nearby servers). With much older PC&#8217;s or via dial-up it may not be usable, I expect. But the bottom line is, you do not need to have the latest and greatest in computing technology to fill your screen with a steady source of high-res HiRISE pixels.</p>
<p>Early in the mission, our partners at NASA Ames put together <a href="http://marsoweb.nas.nasa.gov/HiRISE/hirise_images/">a site</a> using a Flash applet called Zoomify. They still maintain this site; however, it takes time and effort for them to keep up with our releases. Zoomify uses &#8220;tile pyramids&#8221;, or multiple copies of image data at each zoom resolution. So not only must the data be transferred, it must then be rendered into many tiles, occupying slightly more space than the original data. For that reason, they convert to JPEG, which eliminates some of the highest resolution information. Still, it may be faster because the lower resolutions are pre-rendered and the highest resolution has been decreased. Flash, like the IAS Viewer, is supported on Windows, Mac, and (x86 flavors of) Linux.</p>
<p><span id="more-156"></span></p>
<p>Because it is closed-source software, we can&#8217;t make improvements to the IAS Viewer. Or, if we did, we could not redistribute them under the terms of our license agreement. But here are some features I would like to see it have someday:</p>
<ul>
<li>Press page-up (etc) for navigating one screenful at a time</li>
<li>The ability to open a URL to a particular region at a particular resolution</li>
<li>The ability to copy the URL for the view you are looking at</li>
<li>Voice interface (like the zoom scene in <i>Blade Runner</i>)!</li>
</ul>
<p>The middle two items would, I think, eliminate the need to email multi-megabyte screenshots around for the purposes of scientific discussion.</p>
]]></content:encoded>
			<wfw:commentRss>http://hirise.lpl.arizona.edu/HiBlog/2008/03/11/zooming-in/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Race Is On</title>
		<link>http://hirise.lpl.arizona.edu/HiBlog/2006/12/24/the-race-is-on/</link>
		<comments>http://hirise.lpl.arizona.edu/HiBlog/2006/12/24/the-race-is-on/#comments</comments>
		<pubDate>Sun, 24 Dec 2006 15:15:38 +0000</pubDate>
		<dc:creator>GuyMac</dc:creator>
				<category><![CDATA[Downlink]]></category>
		<category><![CDATA[HiRISE]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[EDRgen]]></category>
		<category><![CDATA[HiDog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[pipeline]]></category>
		<category><![CDATA[race condition]]></category>

		<guid isPermaLink="false">http://hirise.lpl.arizona.edu/HiBlog/?p=67</guid>
		<description><![CDATA[The HiRISE project has developed a fairly significant amount of software. I&#8217;ve been privileged to play a part in that development, which continues even as we get deeper into the primary mission. So, rather than space science or operations, this post will discuss one of the nittier, grittier aspects of our work.
The processing pipelines have [...]]]></description>
			<content:encoded><![CDATA[<p>The HiRISE project has developed a fairly significant amount of software. I&#8217;ve been privileged to play a part in that development, which continues even as we get deeper into the primary mission. So, rather than space science or operations, this post will discuss one of the nittier, grittier aspects of our work.</p>
<p>The processing pipelines have been introduced in earlier entries. Thanks to the efforts of HiRISE developers (mostly before my time with the project) these have provided a very solid foundation for our automated ground data system. There has been very little need for trouble-shooting or fine-tuning of the core software.</p>
<p>One issue that did come up earlier in PSP however was a strange failure that happened periodically, though not predictably. If you are a programmer, there is nothing so dreadful as a bizarre, non-repeatable bug&#8230; not counting Monday morning meetings, of course.</p>
<p><span id="more-67"></span></p>
<p>This particular bug happened when a new observation came down. Each processing pipeline needs to make a new directory, a new folder in the file system where it can store a log of its work. Starting with the transition phase, most of our pipelines have two or more instances running in parallel on a small Linux cluster, each working on part of the observation.</p>
<p>The bug was that, occasionally, the directory creation would fail. Someone from downlink would have to investigate and take corrective action. Or, if the way forward was unclear, to call in somebody from the software development crew.</p>
<p>In this case, the problems seemed to happen downstream from &#8220;my&#8221; pipelines: I was blissfully unaware that it could effect HiDog and EDRgen as well.</p>
<p>Then on Thursday, Rich emails to say that the workarounds put in place by two other developers seemed to have helped their pipelines, could I add them to my code as well?</p>
<p>A little shocked, I replied (no doubt too haughtily) that I&#8217;d rather understand the problem than apply some hasty workarounds. It had all the classic hallmarks of a multi-threaded problem: notoriously hard to repeat &amp; difficult to debug, but always when two processes were going after the same thing.</p>
<p>The particular bit of code&mdash;a subroutine shared by each pipeline to create a log directory&mdash;looked absolutely fine on first inspection. It uses the perl language and invokes a function called <tt>mkdir</tt>. That really should be no problem, I thought. Perhaps if there were a permissions problem. But this succeeded more often than not.</p>
<p>So that evening, I decided to try a little test: a small program that I&#8217;d run simultaneously in two windows. Each one would try to make the same directory, whose name would contain the current time in seconds. Since the <tt>mkdir</tt> operation should take much less than a second, there should be frequent &#8220;collisions&#8221;&mdash;if that was really what the problem was.</p>
<p>As a developer, you grow accustomed to the fact that almost nothing works right on the first try; you have to take small steps and constantly check yourself. So I first tried a test in just a single window. It looked like this:</p>
<pre><code><tt>
% <b>while 1</b>
? <b>perl -e 'print "mkdir failed!" unless(mkdir $ARGV[0]);' `date '+%S'`</b>
? <b>end</b>
</tt></code></pre>
<p>That should succeed every time, I thought, then I&#8217;ll move on to trying it in two terminal windows at the same time. But lo and behold, I pressed return and started getting many failure messages!</p>
<p>In the blinding flash of the obvious, I realized what I should have known: that <tt>mkdir</tt> returns false, indicating it failed to make the directory, <i>because it already been created</i>. My test script was interfering with itself, succeeding when it was a new second and failing every other time.</p>
<p>This explained the bug. It was what is called a <a href="http://en.wikipedia.org/wiki/Race_condition">race condition</a>. The condition in this case was the creation of a directory. Two pipelines were racing to create the same directory. Occasionally they were close enough that they were calling the same subroutine, and both bypassed its initial check that the directory already existed. One got to the <tt>mkdir</tt> step a fraction of a second ahead of the other, probably due to a slightly heavier load on the machine, or other variables.</p>
<p>Compounding the problem, the workarounds that had been added in several previous versions (retrying up to five times with random delays) failed to check properly. A single check after <tt>mkdir</tt> would remove the race condition. Testing this (in parallel) works as expected.</p>
<p>Or a simpler way is to call the Linux <tt>mkdir</tt> command with an option so that it does what I (and perhaps the other developers) thought it should: to return true (success) if the directory exists or was created.</p>
<p>Tracking down a mystery like this is a fun part of the job. But only if it happens infrequently. <tt> <img src='http://hirise.lpl.arizona.edu/HiBlog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </tt></p>
]]></content:encoded>
			<wfw:commentRss>http://hirise.lpl.arizona.edu/HiBlog/2006/12/24/the-race-is-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We&#8217;ve Been Busy</title>
		<link>http://hirise.lpl.arizona.edu/HiBlog/2006/11/22/weve-been-busy/</link>
		<comments>http://hirise.lpl.arizona.edu/HiBlog/2006/11/22/weve-been-busy/#comments</comments>
		<pubDate>Wed, 22 Nov 2006 23:38:16 +0000</pubDate>
		<dc:creator>GuyMac</dc:creator>
				<category><![CDATA[HiRISE]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[caption]]></category>
		<category><![CDATA[ExpressView]]></category>
		<category><![CDATA[JPEG2000]]></category>
		<category><![CDATA[JPIP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[reprocessing]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://hirise.lpl.arizona.edu/HiBlog/?p=57</guid>
		<description><![CDATA[Here we are over two weeks into PSP, and we haven&#8217;t even finished releasing our TRA images!
Actually, today we got 31 TRA images out the door, just about completing that set. In addition, the previous 32 grayscale images have been reprocessed with our improved geometry&#8212;no more jagged edges on the reprojected &#8220;Red Mosaics&#8221;. 
Furthermore, the [...]]]></description>
			<content:encoded><![CDATA[<p>Here we are over two weeks into <abbr title="Primary Science Phase">PSP</abbr>, and we haven&#8217;t even finished releasing our <abbr title="Transition">TRA</abbr> images!</p>
<p>Actually, today we got <a href="http://hiroc.lpl.arizona.edu/images/">31 TRA images</a> out the door, just about completing that set. In addition, the previous 32 grayscale images have been reprocessed with our improved geometry&mdash;no more jagged edges on the reprojected &#8220;Red Mosaics&#8221;. </p>
<p>Furthermore, the full-res images are now available as <b>lossless</b> JPEG-2000 (JP2) files. At HiROC we are using the <a href="http://www.lizardtech.com/download/dl_options.php?page=plugins">ExpressView application</a> from a company called LizardTech&#8230; a subsidiary of some Japanese company (that has no affiliation to us FWIW).</p>
<p>ExpressView is available for Mac and Windows. Their download page describes it only as a browser plug-in, but the installer contains an application as well.</p>
<p>ExpressView provides progressive rendering (though you still have to have the entire file first&mdash;we are considering moving to a streaming model using the JPIP protocol but there are even fewer clients available). It should also reduce the amount of memory (RAM) needed to view our largest images.</p>
<p>There are a few options available to Linux users, but nothing we have tried is as fast or as feature-rich. In any case, <a href="mailto:webmaster@pirl.lpl.arizona.edu">let us know</a> what works or doesn&#8217;t work for you. </p>
<p>All of these images are available at <a href="http://hiroc.lpl.arizona.edu/images/TRA/">the usual location</a>.</p>
<p>A system for streamlining the process of editing captions, highlighting cut-out areas and pushing out web pages is in the works. We <i>will</i> get caught up.</p>
<p>In the meantime, look for the first set of PSP releases by this time next week.</p>
<p>P.S. Happy Thanksgiving.</p>
]]></content:encoded>
			<wfw:commentRss>http://hirise.lpl.arizona.edu/HiBlog/2006/11/22/weve-been-busy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

