<?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>Ultra High &#187; ROOT</title>
	<atom:link href="http://ultrahigh.org/category/root/feed/" rel="self" type="application/rss+xml" />
	<link>http://ultrahigh.org</link>
	<description>Cosmic Rays, Code and Life in New York</description>
	<lastBuildDate>Wed, 16 Sep 2009 21:05:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Building ROOT for Debian Lenny (testing)</title>
		<link>http://ultrahigh.org/2008/05/13/building-root-for-debian-lenny-testing/</link>
		<comments>http://ultrahigh.org/2008/05/13/building-root-for-debian-lenny-testing/#comments</comments>
		<pubDate>Wed, 14 May 2008 01:42:33 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[ROOT]]></category>

		<guid isPermaLink="false">http://ultrahigh.org/?p=36</guid>
		<description><![CDATA[Debian Lenny is currently the &#8216;testing&#8217; version, but it is pretty stable and that&#8217;s what my workstation runs at work. However the annoying bug I had before with libroot-python-dev is still present (short version: the package wants (python &#60; 2.5) but the version that ships with Lenny and Ubuntu Hardy is 2.5.)
Anyway, the easiest way [...]]]></description>
			<content:encoded><![CDATA[<p>Debian Lenny is currently the &#8216;testing&#8217; version, but it is pretty stable and that&#8217;s what my workstation runs at work. However the <a href="http://http://ultrahigh.org/2007/12/04/quickfix-libroot-python-dev-for-ubuntu-gutsy/">annoying bug I had before</a> with libroot-python-dev is still present (short version: the package wants (python &lt; 2.5) but the version that ships with Lenny and Ubuntu Hardy is 2.5.)</p>
<p>Anyway, the easiest way around it is to build the packages from source. So add this to your sources.list</p>
<code># Apt ROOT distribution.<br />
deb http://mirror.phy.bnl.gov/debian-root/ unstable main contrib<br />
deb-src http://mirror.phy.bnl.gov/debian-root/ unstable main contrib</code>
<p>Then do these commands</p>
<ul>
<li> <span class="monospace">mkdir temp/root/</span></li>
<li><span class="monospace">cd temp/root</span></li>
<li> <span class="monospace">apt-get source libroot-python-dev  </span> (this downloads the source)</li>
<li><span class="monospace">cd root-system-5.17.07</span></li>
</ul>
<p>Now we come up against another problem. The maxdb packages aren&#8217;t available in Lenny (I&#8217;m not sure why they were removed) but the source packages depend on them, so you&#8217;ll need to work around that. If the packages weren&#8217;t broken, you could do <code>apt-get build-dep libroot-plugin-python</code>. Instead, you can get the list of packages you need from <span class="monospace">debian/control</span>. Here&#8217;s the dependencies:</p>
<span class="monospace">apt-get install debhelper po-debconf libssl-dev comerr-dev libxpm-dev libfreetype6-dev libpcre3-dev zlib1g-dev python-dev libjpeg62-dev libpng12-dev libtiff4-dev libungif4-dev libxinerama-dev libpacklib1-dev gfortran libxmlrpc-c3-dev libxmlrpc-c-dev libcurl4-gnutls-dev fftw3-dev libkrb5-dev krb5-user libldap2-dev libgsl0-dev libmysqlclient15-dev libiodbc2-dev libglu1-xorg-dev libglu-dev ftgl-dev libpq-dev python-support libqt4-dev qt4-dev-tools ruby ruby-dev libxml2-dev</span>
<p>Now you have to edit the Debian control files to remove the maxdb dependencies.</p>
<p>Edit debian/rules, and</p>
<ul>
<li>Delete the &#8216;<span class="monospace">&#8211;enable-maxdb</span>&#8216; line. (You can&#8217;t comment it out in place, but you could move it down a few lines and comment it out there)</li>
<li>Comment out lines 35-45, just leaving &#8216;<span class="monospace">SAPDB = &#8211;disable-sapdb</span>&#8216;</li>
</ul>
<p>Edit debian/control to remove the dependency on libsqlod-dev in the first stanza and delete the entire root-plugin-maxdb stanza.</p>
<span class="monospace">mv debian/root-plugin-maxdb.install debian/root-plugin-maxdb.install.bak</span>
<p>If you like, you can edit debian/changelog and give it a new version number. The version extension must contain a digit, e.g.</p>
<code>root-system (5.17.07-1-ultrahigh1) unstable; urgency=low</code>
<p>Avoid this gotcha: I&#8217;d symlinked /usr/bin/gfortran to /usr/bin/gfortran4.3 for another project. ROOT&#8217;s config/Makefile.linux checks that gcc and gfortran are the same version, so I had to undo that symlink.</p>
<p>Build the packages:</p>
<code>dpk-buildbackage -rfakeroot</code>
<p>My build failed with this error but all of the packages seem to be there (including root-plugin-asimage, so I don&#8217;t know what it&#8217;s complaining about):</p>
<p><code>dpkg-genchanges -b &gt;../root-system_5.17.07-1-ultrahigh1_i386.changes<br />
dpkg-genchanges: binary-only upload &#8211; not including any source code<br />
dpkg-genchanges: failure: cannot fstat file ../root-plugin-asimage_5.17.07-1-ultrahigh_i386.deb: No such file or directory<br />
dpkg-buildpackage: failure: dpkg-genchanges gave error exit status 2</code><br />
And if you are too lazy to build the packages and you trust me (why would you!), you can <a href="http://code.ultrahigh.org/root/lenny-20080513">download my packages</a> which should install OK.</p>
]]></content:encoded>
			<wfw:commentRss>http://ultrahigh.org/2008/05/13/building-root-for-debian-lenny-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickfix: libroot-python-dev for Ubuntu Gutsy</title>
		<link>http://ultrahigh.org/2007/12/04/quickfix-libroot-python-dev-for-ubuntu-gutsy/</link>
		<comments>http://ultrahigh.org/2007/12/04/quickfix-libroot-python-dev-for-ubuntu-gutsy/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 15:45:24 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ROOT]]></category>

		<guid isPermaLink="false">http://ultrahigh.org/2007/12/04/quickfix-libroot-python-dev-for-ubuntu-gutsy/</guid>
		<description><![CDATA[Since my last post on building ROOT packages for Ubuntu the resourceful Christian Holm Christensen has got the unofficial Debian/Ubuntu ROOT repository back online. One problem is that due to a dh_python bug in Ubuntu, the libroot-python-dev package (required for PyROOT) is broken for Gutsy (and probably Feisty too), since it depends on python &#60; [...]]]></description>
			<content:encoded><![CDATA[<p>Since my <a href="http://ultrahigh.org/2007/08/17/building-root-packages-on-ubuntu-feisty/">last post on building ROOT packages for Ubuntu</a> the resourceful Christian Holm Christensen has got <a href="http://mirror.phy.bnl.gov/debian-root/ubuntu">the unofficial Debian/Ubuntu ROOT repository</a> back online. One problem is that due to a dh_python bug in Ubuntu, the libroot-python-dev package (required for PyROOT) is broken for Gutsy (and probably Feisty too), since it depends on python &lt; 2.5. I&#8217;ve hacked the &#8216;control&#8217; file to remove that broken dependency and repacked the .deb file to make a package that is installable and doesn&#8217;t break apt.</p>
<p>Download it here:<br />
<a href="http://code.ultrahigh.org/libroot-python-dev_5.17.05-3-quickfix_i386.deb">libroot-python-dev_5.17.05-3-quickfix_i386.deb</a></p>
<p>Steps to create this:</p>
<ul>
<li>Get the libroot-python-dev package from the repository<br />
<code>wget http://mirror.phy.bnl.gov/debian-root/...<br />
ubuntu/pool/main/r/root-system/libroot-python-dev_5.17.05-3_i386.deb</code></li>
<li>Unpack the .deb<br />
<code>ar -x libroot-python-dev_5.17.05-3_i386.deb</code></li>
<li>Unpack the control data:<br />
<code>tar -zxf control.tar.gz</code></li>
<li>Edit the file &#8216;control&#8217; to fix the dependencies and bump the version number</li>
<li>Repack control data:<br />
<code>tar -zcf control.tar.gz control md5sums  postinst prerm</code></li>
<li>Repack the .deb<br />
<code>ar -r libroot-python-dev_5.17.05-3-quickfix_i386.deb debian-binary control.tar.gz data.tar.gz</code></li>
</ul>
<p>I hope to help fix the underlying issue soon but right I&#8217;ve got a ton of thesis-related work to plough through so this band-aid will have to do for now.</p>
<p><strong>Update 2007-12-11:</strong><br />
I spent a morning last week tracking down this ROOT Python bug. Turns out there was a file not being deleted during the &#8216;clean&#8217; stage of the debian package creation which led to a dependency confusion with python versions. New source packages have been uploaded which fix this issue:<br />
<code>deb-src http://mirror.phy.bnl.gov/debian-root unstable main contrib</code></p>
<p>Binary packages should be up shortly.</p>
<p><strong>Update 2009-03-02:</strong></p>
<p><strong></strong>Noticed a typo in the re-tarring command, now fixed.</p>
]]></content:encoded>
			<wfw:commentRss>http://ultrahigh.org/2007/12/04/quickfix-libroot-python-dev-for-ubuntu-gutsy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making Pretty ROOT Color Palettes</title>
		<link>http://ultrahigh.org/2007/08/20/making-pretty-root-color-palettes/</link>
		<comments>http://ultrahigh.org/2007/08/20/making-pretty-root-color-palettes/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 17:05:57 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Physics]]></category>
		<category><![CDATA[ROOT]]></category>

		<guid isPermaLink="false">http://ultrahigh.org/2007/08/20/making-pretty-root-color-palettes/</guid>
		<description><![CDATA[My friend and colleague (I like him even more since he told me about this!) Segev gave me this information, which he had gleaned from some old posts on ROOTtalk and a lot of experimentation. It&#8217;s a technique for setting the color palette of ROOT plots so that, for example, Graph2D with the &#8220;COLZ&#8221; option [...]]]></description>
			<content:encoded><![CDATA[<p>My friend and colleague (I like him even more since he told me about this!) Segev gave me this information, which he had gleaned from some old posts on ROOTtalk and a lot of experimentation. It&#8217;s a technique for setting the color palette of ROOT plots so that, for example, Graph2D with the &#8220;COLZ&#8221; option doesn&#8217;t look like total crap. I have no idea why something like this isn&#8217;t used as the default palette in ROOT.</p>
<p>In short, here&#8217;s before and after screenshots of the plot.</p>
<div class="cap_image"><img src="http://images.ultrahigh.org/default_palette_200.png" alt="Default Palette" />Before</div>
<div class="cap_image"><img src="http://images.ultrahigh.org/new_palette_200.png" alt="New Palette">After</div>
<div class="clear"></div>
<p><span id="more-16"></span></p>
<p>The standard palette in ROOT is so ugly it makes me want to hurl. It&#8217;s probably one of those things that some genius programmer or physicist came up with, so I don&#8217;t mind that the first attempt was ugly. ROOT is powerful and Free, so that&#8217;s all good. I do find it weird that they&#8217;ve no-one has ever replaced it as the default.</p>
<p><img src="http://images.ultrahigh.org/default_palette_400.png" /></p>
<p>Woah! Who threw up on my plot?</p>
<p>Fortunately for all of us, there is a choice of two palettes to choose from in ROOT by default. The interface for setting the palette is not accessible through the GUI, but in code or in CINT one can type<br />
<code>gStyle-&gt;SetPalette(1);</code><br />
to get the rainbow palette. Here&#8217;s what that looks like:<br />
<img src="http://images.ultrahigh.org/palette_1_400.png" /></p>
<p>The rainbow palette is a lot nicer, both aesthetically and, in my opinion, it makes the &#8216;hot&#8217; areas much clearer to the eye. However, by default there are still only twenty or so different colors by default and the whole thing is dominated by a big pile of green. Still not quite perfect.</p>
<p>Entering other numbers into <code>gStyle-&gt;SetPalette</code> seems to give some blocky gray plots and eventually a blue plot. Nothing as nice as the rainbow plot. However, there is a way to define new color palettes and use them. Here&#8217;s the example code as provided by Segev. :</p>
<pre>
void
set_plot_style()
{
    const Int_t NRGBs = 5;
    const Int_t NCont = 255;

    Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
    Double_t red[NRGBs]   = { 0.00, 0.00, 0.87, 1.00, 0.51 };
    Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
    Double_t blue[NRGBs]  = { 0.51, 1.00, 0.12, 0.00, 0.00 };
    TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
    gStyle-&gt;SetNumberContours(NCont);
}
</pre>
<p>Note: This version works in ROOT v5.16, earlier versions may have used <code>gStyle-&gt;CreateColorGradientTable()</code> instead of <code>TColor::CreateColorGradientTable()</code>.</p>
<p><img src="http://images.ultrahigh.org/new_palette_400.png" /></p>
<p>Note too that the wonderful <code>gStyle-&gt;SetNumberContours(NCont)</code> is what gives the plot its smooth appearance, a big improvement in itself from the default 20 or so colors.</p>
<p>Here&#8217;s my Python function for the same effect:</p>
<pre>
def set_palette(name=palette, ncontours=999):
    """Set a color palette from a given RGB list
    stops, red, green and blue should all be lists of the same length
    see set_decent_colors for an example"""

    if name == "gray" or name == "grayscale":
        stops = [0.00, 0.34, 0.61, 0.84, 1.00]
        red   = [1.00, 0.84, 0.61, 0.34, 0.00]
        green = [1.00, 0.84, 0.61, 0.34, 0.00]
        blue  = [1.00, 0.84, 0.61, 0.34, 0.00]
    # elif name == "whatever":
        # (define more palettes)
    else:
        # default palette, looks cool
        stops = [0.00, 0.34, 0.61, 0.84, 1.00]
        red   = [0.00, 0.00, 0.87, 1.00, 0.51]
        green = [0.00, 0.81, 1.00, 0.20, 0.00]
        blue  = [0.51, 1.00, 0.12, 0.00, 0.00]

    s = array('d', stops)
    r = array('d', red)
    g = array('d', green)
    b = array('d', blue)

    npoints = len(s)
    TColor.CreateGradientColorTable(npoints, s, r, g, b, ncontours)
    gStyle.SetNumberContours(ncontours)
</pre>
<p>And that&#8217;s how you do it. Thanks Segev!</p>
]]></content:encoded>
			<wfw:commentRss>http://ultrahigh.org/2007/08/20/making-pretty-root-color-palettes/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Building ROOT Packages on Ubuntu Feisty</title>
		<link>http://ultrahigh.org/2007/08/17/building-root-packages-on-ubuntu-feisty/</link>
		<comments>http://ultrahigh.org/2007/08/17/building-root-packages-on-ubuntu-feisty/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 17:01:57 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[ROOT]]></category>

		<guid isPermaLink="false">http://ultrahigh.org/2007/08/17/building-root-packages-on-ubuntu-feisty/</guid>
		<description><![CDATA[I read with satisfaction the fact that Cern&#8217;s ROOT physics and data analysis framework has finally been integrated into Debian. I assumed that this would lead to easier installation on Ubuntu and in the future, hopefully, ROOT in the Ubuntu repositories. For a brief and happy period there was a third party repository with up-to-date [...]]]></description>
			<content:encoded><![CDATA[<p>I read with satisfaction the fact that <a href="http://root.cern.ch/">Cern&#8217;s ROOT physics and data analysis framework</a> has <a href="http://root.cern.ch/root/roottalk/roottalk07/0592.html">finally been integrated into Debian.</a> I assumed that this would lead to easier installation on Ubuntu and in the future, hopefully, ROOT in the Ubuntu repositories. For a brief and happy period there was a third party repository with up-to-date and semi-official ROOT packages.</p>
<p>My hopes were dashed with the news that the Brookhaven machine hosting the repository <a href="http://mirror.phy.bnl.gov/debian-root/">lost a hard disk</a> and the Ubuntu repository was down. I frequently need access to ROOT packages, so I just recently built .debs from the lastest stable release (5.16.00). Here&#8217;s a guide as to how to make it work:</p>
<p><span id="more-13"></span></p>
<p>Install some Debian packaging tools (this might not be definitive):<br />
<code>apt-get install fakeroot devscripts</code></p>
<p>Install the development prerequisites (some of these might not be needed):<br />
<code>apt-get install libafterimage-dev libxmlrpc-c3-dev libglu1-mesa-dev libpacklib1-dev libkrb5-dev libldap2-dev libmysqlclient15-dev libpq-dev python-dev libqt3-headers libqt3-compat-headers libqt3-mt-dev qt3-dev-tools ruby1.9 ruby1.9-dev ruby1.8-dev libxml2-dev libssl-dev comerr-dev libxpm-dev libfreetype6-dev libpcre3-dev g77 libodbc++-dev libsqlod75-dev libiodbc2-dev libungif4-dev fftw3-dev krb5-user libgsl0-dev debhelper libpqxx-dev libsqldbc75-dev libttf-dev<br />
</code></p>
<p>Download the source package from <a href="http://root.cern.ch">the main ROOT page.</a></p>
<p>Unzip the source and change the directory name from &#8216;root&#8217;:<br />
<code>tar -zxf root_v5.16.00.source.tar.gz<br />
mv root root-system-5.16.00</code></p>
<p>Make the .orig copy for source packages:<br />
<code>cp -r root-system-5.16.00 root-system-5.16.00.orig</p>
<p>Create the 'debian' directory<br />
<code>cd root-5.16.00<br />
./build/package/lib/makedebdir.sh<br />
</code></p>
<p>If necessary, edit the 'CONFOPTIONS' variable in debian/rules (shouldn't be necessary)</p>
<p>Update debian/changelog, insert a new entry with matching version number to the root directory, add your own name and email.<br />
<code>root-system (5.16.00) experimental; urgency=low<br />
  * Version number bump</code><br />
<code><br />
 -- Andrew O'Neill <oneill@phys.columbia.edu>  Thu, 16 Aug 2007 02:04:02 +0200</code><br />
</code></p>
<p>Now, some fixes for broken things:</p>
<ul>
<li>For some reason, some of the builtin packages don&#8217;t get untarred during the build, this will cause an infinite error loop during build. This will fix it:</li>
<p>	<code>cd asimage/src/<br />
tar -zxf libAfterImage.tar.gz<br />
	</code></p>
<li>Repeat that for unuran/src/unuran-1.0.1-root.tar.gz</li>
<li>Repeat for xrootd/src/xrootd-20060928-1600.src.tgz</li>
<li>For 5.16.00, there is a bug in the pgsql code that will block compilation. Edit file pgsql/src/TPgSQLServer.cxx and change the variables <code>stmt->conn</code> to <code>stmt->fConn</code> and <code>stmt->res</code> to <code>stmt->fRes</code>. This error has been fixed in the CVS version.
</ul>
<h3>Build It</h3>
<p>Get ready for the build<br />
<code>fakeroot debian/rules debian/control</code></p>
<p>Configure, compile, link and create packages:<br />
<code>dpkg-buildpackage -rfakeroot -nc</code></p>
<h3>The packages</h3>
<p>If the build succeeds, you should find the packages in the parent directory of root-system-5.16.00</p>
<h3>Notes</h3>
<p>Despite requesting disable-builtin-afterimage, the configure script complains that the Ubuntu version of afterimage is too new, so will use the builtin one anyway.</p>
<p>If the build fails and you need to reconfigure and try again without building everything from scratch, you can probably speed things up by doing:<br />
<code>rm config.status<br />
debian/rules config.status<br />
</code><br />
<code>debian/rules build</code></p>
]]></content:encoded>
			<wfw:commentRss>http://ultrahigh.org/2007/08/17/building-root-packages-on-ubuntu-feisty/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Scaling ROOT PostScript Files</title>
		<link>http://ultrahigh.org/2007/05/25/scaling-root-postscript-files/</link>
		<comments>http://ultrahigh.org/2007/05/25/scaling-root-postscript-files/#comments</comments>
		<pubDate>Fri, 25 May 2007 17:33:50 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ROOT]]></category>

		<guid isPermaLink="false">http://ultrahigh.org/2007/05/25/scaling-root-postscript-files/</guid>
		<description><![CDATA[I encountered some trouble today printing PostScript files from ROOT at smaller sizes. This is most useful to me because my lab notebook, heretically, is smaller than &#8216;letter&#8217; size, which I find more convenient for carrying than the huge squared notebooks which seem to be the norm around here. I was looking for a quick [...]]]></description>
			<content:encoded><![CDATA[<p>I encountered some trouble today printing PostScript files from ROOT at smaller sizes. This is most useful to me because my lab notebook, heretically, is smaller than &#8216;letter&#8217; size, which I find more convenient for carrying than the huge squared notebooks which seem to be the norm around here. I was looking for a quick way of printing PostScript at 80% scale.<br />
<span id="more-10"></span></p>
<p>The command <code>lpr -o scaling=80 input.ps</code> actually produced one page with a HUGE blow-up of one corner of my plot, so that obviously wasn&#8217;t working.</p>
<p>Using the built-in scaling in <em>evince</em> didn&#8217;t work either. I don&#8217;t know if that works on other files or not, I&#8217;ve never had any luck with it though.</p>
<p>Using the command <code>psnup -2 input.ps</code> (from GhostScript) should put two pages into one page (&#8220;2-up&#8221;) however it wasn&#8217;t working with the PostScript that ROOT produced, basically just giving garbage output. Looking around on the web, I found <a href="http://root.cern.ch/phpBB2/viewtopic.php?t=3631&#038;view=previous&#038;sid=5ceaa429d8e55566dadc28a3aabfb589">this post on the Root Talk forum</a> which describes an extra PS command that ROOT inserts to keep CUPS happy, but which seems to break some aspects of GhostScript.</p>
<p>Removing the offending CUPS-appeasement lines does allow GhostScript to work with the files. You can do that with <em>sed</em>.<br />
<code>cat input.ps | sed -e "s/%%BeginSetup//" \<br />
      | sed -e "s/%%EndSetup//"  > output.ps<br />
</code></p>
<p>With that fix in place, I decided that I could do better than <em>psnup</em> in order to resize the plots (80% is a better fit to my notebook). In the end, I came up with the following script:</p>
<pre>
#!/bin/bash

# take ROOT output (or any postscript) and strip the
# extra commands that seem to break GhostScript,
# then resize to 70% of the size and print

scale=0.8
paper="letter"

function usage() {
    echo "Usage: lpr_70 [lpr options] input.ps"
    exit 2
}

# separate postscript file from other lpr arguments
lpr_args=""
input=""
for arg in $*; do
    ext=`echo "$arg" |awk -F '.' '{print $NF}'`
    if [ "$ext" == "ps" ]; then
        input="$arg"
    elif [ "$arg" == "--help" ]; then
        usage;
    else
        lpr_args="$lpr_args $arg"
    fi
done

# parse the filename a little
ext=`echo "$input" |awk -F '.' '{print $NF}'`
base=`basename "$input" .$ext`
temp1="/tmp/$base.strip.ps"
temp2="/tmp/$base.$scale.ps"

# strip the extra ROOT postscript commands that cause trouble
cat $input | sed -e "s/%%BeginSetup//" | sed -e "s/%%EndSetup//"  > $temp1

# Scale using pstops
pstops -p$paper 1:0@$scale $temp1 $temp2

# Send to the printer
lpr $lpr_args $temp2

# remove the temporary files
rm $temp1 $temp2
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ultrahigh.org/2007/05/25/scaling-root-postscript-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
