<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8246059922806188810</id><updated>2012-11-29T12:53:02.245-05:00</updated><category term='linux'/><category term='output'/><category term='visualization'/><category term='cluster computing'/><category term='photography'/><category term='remote sensing'/><category term='file size'/><category term='graphics'/><category term='MODIS'/><category term='art'/><category term='science communication'/><category term='pdf'/><category term='grass gis'/><category term='R'/><category term='science'/><title type='text'>PlanetFlux</title><subtitle type='html'>Musings on the science of global change, remote sensing, statistical computing, scientific visualization and more...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-2629026563511367207</id><published>2012-10-15T11:32:00.001-04:00</published><updated>2012-10-15T11:32:17.754-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MODIS'/><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='remote sensing'/><category scheme='http://www.blogger.com/atom/ns#' term='science'/><title type='text'>Processing MODIS Swath data with the HEG tool</title><content type='html'>I recently found a bug/weakness in the NASA's HEG tool which can be used to convert MODIS swath data (such as the MOD06_L2 cloud product) into a regular gridded file. &amp;nbsp;The library requires several environment parameters to be set correctly before running successfully. &amp;nbsp;For example:&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;MRTDATADIR=.../heg/data&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Courier New, Courier, monospace;"&gt;PGSHOME=.../heg/TOOLKIT_MTD&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When those parameters are set incorrectly, the program does not give any indication of an error and produces an output file full of gibberish. &amp;nbsp;For example, here is an image of a sample MOD06 scene (MOD06_L2.A2008062.1545.051.2010324234929.hdf) of "cloud particle effective radius" from the swath HDF file&amp;nbsp;acquired&amp;nbsp;from NASA (visualized using HDFview):&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-fbbTQ7vMy7o/UHwmkYYOt2I/AAAAAAAAY_8/Kqg4593ozp4/s1600/Cloud_Effective_Radius.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-fbbTQ7vMy7o/UHwmkYYOt2I/AAAAAAAAY_8/Kqg4593ozp4/s320/Cloud_Effective_Radius.png" width="213" /&gt;&lt;/a&gt;&lt;/div&gt;The black areas are not cloudy and the colorful areas represent cloudy areas with different properties. &amp;nbsp;It intuitively looks like a reasonable image of cloudiness. &amp;nbsp;After conversion to a gridded HDF file using the HEG program &lt;span style="font-family: Courier New, Courier, monospace;"&gt;swtif&lt;/span&gt;&lt;span style="font-family: inherit;"&gt;&amp;nbsp;and incorrectly set environment variables, this is what the image looks like:&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Ew5jUg0JOes/UHwouT0UHUI/AAAAAAAAZAE/ZsZ6Dr1N5qc/s1600/Cloud_Effective_Radius_swtif.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-Ew5jUg0JOes/UHwouT0UHUI/AAAAAAAAZAE/ZsZ6Dr1N5qc/s320/Cloud_Effective_Radius_swtif.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Obviously there are some conversion issues (this image looks completely different), but after running the program there was no indication that an error had occurred (either in STOUT or in the swtif.log file). Only after a few hours of trial and error (trying different projections, etc.) did I realize what was causing the problem. &amp;nbsp;While I realize accurately following the instructions is the responsibility of the user, it is still a bit dangerous for a program to output erroneous results when important libraries cannot be found. &amp;nbsp;It would be trivial to add a quick check that the libraries are readable before writing the output file.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I've also sent this report to the HEG folks, but I'm posting this here in case others find themselves in a similar situation.&amp;nbsp;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/2629026563511367207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2012/10/processing-modis-swath-data-with-heg.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/2629026563511367207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/2629026563511367207'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2012/10/processing-modis-swath-data-with-heg.html' title='Processing MODIS Swath data with the HEG tool'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-fbbTQ7vMy7o/UHwmkYYOt2I/AAAAAAAAY_8/Kqg4593ozp4/s72-c/Cloud_Effective_Radius.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-3372809277447150217</id><published>2012-10-05T07:39:00.001-04:00</published><updated>2012-11-01T11:18:39.534-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='grass gis'/><category scheme='http://www.blogger.com/atom/ns#' term='cluster computing'/><category scheme='http://www.blogger.com/atom/ns#' term='science'/><title type='text'>Compiling GRASS on a cluster running SGI ProPack for Linux</title><content type='html'>&lt;br /&gt;&lt;div&gt;Some notes on installing GRASS (and a few dependencies) and NCO from source in a personal directory (no &lt;span style="font-family: Courier New, Courier, monospace;"&gt;su&lt;/span&gt;&amp;nbsp;privileges) on a clu&lt;span style="font-family: inherit;"&gt;ster running&amp;nbsp;&lt;span style="background-color: ghostwhite; color: #111111; line-height: 18px;"&gt;SGI ProPack for Linux&lt;/span&gt;&lt;span style="background-color: ghostwhite; color: #111111; line-height: 18px;"&gt;&amp;nbsp;&lt;/span&gt;. &amp;nbsp;I mostly followed the instructions &lt;a href="http://grass.osgeo.org/wiki/Compile_and_Install"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Set install path and add it to PATH&lt;br /&gt;&lt;pre class="wiki" style="background-color: #f7f7f7; border: 1px solid rgb(215, 215, 215); margin: 1em 1.75em; overflow: auto; padding: 0.25em;"&gt;&lt;span style="font-family: Courier New, Courier, monospace; font-size: x-small;"&gt;set IPATH=(INSTALL LOCATION)&lt;br /&gt;setenv PATH $IPATH\bin:$PATH&lt;br /&gt;echo 'PATH=$IPATH/bin:$PATH' &amp;gt;&amp;gt; ~/.profile&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Load necessary modules&lt;/li&gt;&lt;li&gt;&lt;pre class="wiki" style="background-color: #f7f7f7; border: 1px solid rgb(215, 215, 215); margin: 1em 1.75em; overflow: auto; padding: 0.25em;"&gt;&lt;span style="font-family: Courier New, Courier, monospace; font-size: x-small;"&gt;module load gcc hdf5 netcdf/4.1.3/gcc/mpt mpi tcl-tk/8.5.11 udunits/2.1.19 szip/2.1/gcc&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Compile proj4&lt;br /&gt;&lt;pre class="wiki" style="background-color: #f7f7f7; border: 1px solid rgb(215, 215, 215); margin: 1em 1.75em; overflow: auto; padding: 0.25em;"&gt;&lt;span style="font-family: Courier New, Courier, monospace; font-size: x-small;"&gt;svn checkout http://svn.osgeo.org/metacrs/proj/trunk/proj&lt;span style="background-color: transparent;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="background-color: transparent;"&gt;cd proj&lt;br /&gt;&lt;/span&gt;./configure --prefix=$IPATH&lt;br /&gt;make&lt;br /&gt;make install&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Compile GEOS&lt;br /&gt;&lt;pre class="wiki" style="background-color: #f7f7f7; border: 1px solid rgb(215, 215, 215); margin: 1em 1.75em; overflow: auto; padding: 0.25em;"&gt;&lt;span style="font-family: Courier New, Courier, monospace; font-size: x-small;"&gt;wget http://download.osgeo.org/geos/geos-3.3.5.tar.bz2&lt;br /&gt;tar xvf geos-3.3.5&lt;br /&gt;cd geos-3.3.5&lt;br /&gt;./configure --prefix=$IPATH&lt;br /&gt;make -j8&lt;br /&gt;make install&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Compile HDF4 (for some reason the built in version wasn't working)&lt;br /&gt;&lt;pre class="wiki" style="background-color: #f7f7f7; border: 1px solid rgb(215, 215, 215); margin: 1em 1.75em; overflow: auto; padding: 0.25em;"&gt;&lt;span style="font-family: Courier New, Courier, monospace; font-size: x-small;"&gt;wget http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-4.2.8.tar.gz&lt;br /&gt;tar -xvf hdf-4.2.8.tar.gz&lt;br /&gt;cd hdf-4.2.8&lt;br /&gt;./configure --prefix=$IPATH --with-szlib=/nasa/szip/2.1 --disable-netcdf --disable-fortran --enable-shared &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Compile GDAL&lt;br /&gt;&lt;pre class="wiki" style="background-color: #f7f7f7; border: 1px solid rgb(215, 215, 215); margin: 1em 1.75em; overflow: auto; padding: 0.25em;"&gt;&lt;span style="font-family: Courier New, Courier, monospace; font-size: x-small;"&gt;wget http://download.osgeo.org/gdal/gdal-1.9.1.tar.gz&lt;br /&gt;tar xvf gdal-1.9.1&lt;br /&gt;cd gdal-1.9.1&lt;br /&gt;&lt;span style="background-color: #fafafa;"&gt;&lt;span style="white-space: normal;"&gt;./configure FC=mpif90 CC=mpicc CXX=mpicxx --prefix=$IPATH --with-netcdf=/nasa/sles11/netcdf/4.1.3/gcc/mpt/bin --with-geos=$IPATH/bin/geos-config --with-static-proj4=$IPATH/ --with-hdf5=/nasa/hdf5/1.8.3/gcc/mpt/lib  --with-hdf4=/nobackupp1/awilso10/software/lib&amp;nbsp;&lt;/span&gt;&lt;/span&gt;make -j8&lt;br /&gt;make install&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Checkout the current version of GRASS via SVN:&lt;/li&gt;&lt;li&gt;&lt;pre class="wiki" style="background-color: #f7f7f7; border: 1px solid rgb(215, 215, 215); margin: 1em 1.75em; overflow: auto; padding: 0.25em;"&gt;&lt;span style="font-family: Courier New, Courier, monospace; font-size: x-small;"&gt;svn checkout https://svn.osgeo.org/grass/grass/branches/releasebranch_6_4 grass64_release&lt;br /&gt;./configure --with-cxx --with-proj-share=$IPATH/share/proj --with-proj-libs=$IPATH/lib --with-proj-includes=$IPATH/include --without-fftw --with-geos=$IPATH/lib --with-blas-includes=/nasa/intel/mkl/10.0.011/include/ --with-blas-libs=/nasa/intel/mkl/10.0.011/lib --prefix=$IPATH&lt;br /&gt;make&lt;br /&gt;make install&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Also install&lt;a href="https://code.zmaw.de/projects/cdo"&gt; CDO tools &lt;/a&gt;to process netcdf files&lt;br /&gt;&lt;pre class="wiki" style="background-color: #f7f7f7; border: 1px solid rgb(215, 215, 215); margin: 1em 1.75em; overflow: auto; padding: 0.25em;"&gt;&lt;span style="font-family: Courier New, Courier, monospace; font-size: x-small;"&gt;wget https://code.zmaw.de/attachments/download/3873/cdo-current.tar.gz&lt;br /&gt;tar -xvf cdo-current.tar.gz&amp;nbsp;&lt;br /&gt;./configure --prefix=$IPATH --with-netcdf=/nasa/sles11/netcdf/4.1.3/gcc/mpt --with-hdf5=/nasa/hdf5/1.8.3/gcc/mpt&lt;br /&gt;make&lt;br /&gt;make install&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Compile Rmpi&lt;br /&gt;This took a lot of time to figure out because most versions of MPI available on this system do not seem to work with Rmpi...&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;pre class="wiki" style="background-color: #f7f7f7; border: 1px solid rgb(215, 215, 215); margin: 1em 1.75em; overflow: auto; padding: 0.25em;"&gt;&lt;span style="font-family: Courier New, Courier, monospace; font-size: x-small;"&gt;wget http://cran.r-project.org/src/contrib/Rmpi_0.6-1.tar.gz&lt;br /&gt;module load mpi-intel&lt;br /&gt;export MPIHOME=/nasa/intel/impi/4.0.0.028/&lt;br /&gt;CC=mpicc R CMD INSTALL --configure-args="--with-Rmpi-type=OPENMPI  --with-Rmpi-libpath=$MPIHOME/lib64 --with-Rmpi-include=$MPIHOME/include64" ~/Rmpi_0.6-1.tar.gz &lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/3372809277447150217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2012/10/compiling-grass-on-nasas-pleiades.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/3372809277447150217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/3372809277447150217'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2012/10/compiling-grass-on-nasas-pleiades.html' title='Compiling GRASS on a cluster running SGI ProPack for Linux'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-643285271526216870</id><published>2012-09-07T09:42:00.000-04:00</published><updated>2012-10-05T07:40:33.989-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='photography'/><title type='text'>Photographing the Miniature Forests of Cape Horn</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;In January 2011 I spent five weeks in the Chilean Patagonia working to photograph the incredible bryophyte diversity in the "Miniature&amp;nbsp;Forests of Cape Horn." &lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-xpQ0C2b0kjA/UD-MF0DbvkI/AAAAAAAAY7k/8PzKzs8QoOM/s1600/WilsonAdam_20110106_1294.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="170" src="http://2.bp.blogspot.com/-xpQ0C2b0kjA/UD-MF0DbvkI/AAAAAAAAY7k/8PzKzs8QoOM/s400/WilsonAdam_20110106_1294.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Bernard Goffinet on the slopes of Mt. Robelo&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;The first of two books from this project is now available from the &lt;a href="http://untpress.unt.edu/catalog/3493/"&gt;University of North Texas Press&lt;/a&gt;&amp;nbsp;(and &lt;a href="http://www.amazon.com/Miniature-Forests-Cape-Horn-Ecotourism/dp/1574414488"&gt;Amazon&lt;/a&gt;). &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ou7b6MmmYnk/UD-IRHqyl4I/AAAAAAAAY7Y/j7UmDJ7OLv4/s1600/goffinet_forests.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"&gt;&lt;img alt="" border="0" height="320" src="http://1.bp.blogspot.com/-ou7b6MmmYnk/UD-IRHqyl4I/AAAAAAAAY7Y/j7UmDJ7OLv4/s320/goffinet_forests.jpg" title="Miniature Forests of Cape Horn: Ecotourism with a Hand Lens" width="244" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;h1 class="parseasinTitle " style="background-color: white; font-weight: normal; margin-bottom: 0px; margin-top: 0px; text-align: start;"&gt;&lt;span id="btAsinTitle"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"&gt;Miniature Forests of Cape Horn: Ecotourism with a Hand Lens&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;span style="background-color: white; text-align: start;"&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"&gt;Bernard Goffinet,&amp;nbsp;Ricardo Rozzi,&amp;nbsp;Lily Lewis,&amp;nbsp;William Buck,&amp;nbsp;Francisca Massardo&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div&gt;&lt;div style="text-align: center;"&gt;A video documenting the ongoing socio-ecological research there is also available:&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="477" mozallowfullscreen="mozallowfullscreen" src="http://player.vimeo.com/video/31905600?byline=0&amp;amp;portrait=0" webkitallowfullscreen="webkitallowfullscreen" width="500"&gt;&lt;/iframe&gt; &lt;/div&gt;&lt;a href="http://vimeo.com/31905600"&gt;Regreso a la Madriguera&lt;/a&gt; from &lt;a href="http://vimeo.com/user7432843"&gt;Cerebro Producciones&lt;/a&gt; on &lt;a href="http://vimeo.com/"&gt;Vimeo&lt;/a&gt;. Here's the description in English&lt;br /&gt;&lt;i&gt;"All the beauty of the National Park in Tierra del Fuego, Omora serves as the setting for this story documentary which exposes a new way to teach ecology, from an ethical and humane perspective. Philosophers and biologists at the University of Texas and the Magellan lead us to the wealth of one of the world's southernmost forests."&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/643285271526216870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2012/09/photographing-miniature-forests-of-cape.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/643285271526216870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/643285271526216870'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2012/09/photographing-miniature-forests-of-cape.html' title='Photographing the Miniature Forests of Cape Horn'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-xpQ0C2b0kjA/UD-MF0DbvkI/AAAAAAAAY7k/8PzKzs8QoOM/s72-c/WilsonAdam_20110106_1294.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-9054879394518682388</id><published>2012-06-10T10:57:00.000-04:00</published><updated>2012-07-25T09:40:13.149-04:00</updated><title type='text'>What your projection says about you</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;Great cartoon from XKCD.com&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://imgs.xkcd.com/comics/map_projections.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://imgs.xkcd.com/comics/map_projections.png" width="209" /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/9054879394518682388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2012/06/what-your-projection-says-about-you.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/9054879394518682388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/9054879394518682388'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2012/06/what-your-projection-says-about-you.html' title='What your projection says about you'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-691396040685448791</id><published>2012-05-02T10:24:00.001-04:00</published><updated>2012-10-05T07:40:25.583-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='cluster computing'/><category scheme='http://www.blogger.com/atom/ns#' term='science'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Speeding up R with Intel's Math Kernel Library (MKL)</title><content type='html'>&lt;br /&gt;I did some comparisons of the generic BLAS with Intel's MKL (both sequential and parallel) on a Dell PowerEdge 610 server with dual hyperthreading 6-core 3.06GHz Xeon X5675 processors. &amp;nbsp;Here are the results from an &lt;a href="http://r.research.att.com/benchmarks/R-benchmark-25.R"&gt;R benchmarking script&lt;/a&gt; (&lt;span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;Normal R indicates the generic BLAS, &amp;nbsp;&lt;/span&gt;&lt;span style="background-color: rgba(255, 255, 255, 0.917969); color: #009900; font-family: arial, sans-serif; font-size: 13px;"&gt;sMKL is the sequential (single core Intel MKL,&lt;/span&gt;&lt;span style="background-color: rgba(255, 255, 255, 0.917969); color: #222222; font-family: arial, sans-serif; font-size: 13px;"&gt;&amp;nbsp;and&lt;/span&gt;&lt;span style="background-color: rgba(255, 255, 255, 0.917969); color: red; font-family: arial, sans-serif; font-size: 13px;"&gt;&amp;nbsp;pMKL is the parallel Intel MKL using all 24 threads available on this system&lt;/span&gt;). &amp;nbsp;Times are in seconds, lower is better.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;R Benchmark 2.5&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;===============&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Number of times each test is run__________________________: &amp;nbsp;3&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;I. Matrix calculation&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;--------------------- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: arial, sans-serif; font-size: 13px;"&gt;Normal R &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #009900; font-family: arial, sans-serif; font-size: 13px;"&gt;sMKL&lt;/span&gt;&lt;span style="font-family: arial, sans-serif; font-size: 13px;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: red; font-family: arial, sans-serif; font-size: 13px;"&gt;pMKL&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;Creation, transp., deformation of a 2500x2500 matrix (sec): &amp;nbsp; 0.592 &amp;nbsp; &amp;nbsp;&lt;span style="color: #33cc00;"&gt;0.583 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;0.585&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;2400x2400 normal distributed random matrix ^1000____ (sec): &amp;nbsp; 0.425 &amp;nbsp; &amp;nbsp;&lt;span style="color: #33cc00;"&gt;0.411 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;0.427&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;Sorting of 7,000,000 random values__________________ (sec): &amp;nbsp; 0.787 &amp;nbsp; &amp;nbsp;&lt;span style="color: #33cc00;"&gt;0.778 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.777&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;2800x2800 cross-product matrix (b = a' * a)_________ (sec): &amp;nbsp;&lt;b&gt;11.543 &amp;nbsp; &amp;nbsp;&lt;span style="color: #33cc00;"&gt;1.875 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: red;"&gt;0.283&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;Linear regr. over a 3000x3000 matrix (c = a \ b')___ (sec): &amp;nbsp;&amp;nbsp;&lt;b&gt;5.367 &amp;nbsp; &amp;nbsp;&lt;span style="color: #33cc00;"&gt;0.910 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: red;"&gt;0.214&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Trimmed geom. mean (2 extremes eliminated): &amp;nbsp; 1.358 &amp;nbsp; &amp;nbsp;&lt;span style="color: #33cc00;"&gt;0.743 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;0.414&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;II. Matrix functions&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;--------------------&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;FFT over 2,400,000 random values____________________ (sec): &amp;nbsp; 0.422 &amp;nbsp; &amp;nbsp;&lt;span style="color: #33cc00;"&gt;0.451 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: red;"&gt;0.435&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;Eigenvalues of a 640x640 random matrix______________ (sec): &amp;nbsp; 0.949 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.443 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.414&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;Determinant of a 2500x2500 random matrix____________ (sec):&amp;nbsp;&lt;b&gt;&amp;nbsp; 4.864 &amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: #33cc00;"&gt;0.967 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: red;"&gt;0.352&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;Cholesky decomposition of a 3000x3000 matrix________ (sec): &amp;nbsp;&amp;nbsp;&lt;b&gt;4.131 &amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: #33cc00;"&gt;0.865 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: red;"&gt;0.179&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;Inverse of a 1600x1600 random matrix________________ (sec): &amp;nbsp;&amp;nbsp;&lt;b&gt;4.011 &amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: #33cc00;"&gt;0.751 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: red;"&gt;0.277&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Trimmed geom. mean (2 extremes eliminated): &amp;nbsp; 2.505 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.667&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.343&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;III. Programmation&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;------------------&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;3,500,000 Fibonacci numbers calculation (vector calc)(sec): &amp;nbsp; 0.787 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.824 &amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.841&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;Creation of a 3000x3000 Hilbert matrix (matrix calc) (sec): &amp;nbsp; 0.456 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.465 &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.431&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;Grand common divisors of 400,000 pairs (recursion)__ (sec): &amp;nbsp; 2.196 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;2.386 &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;1.927&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;Creation of a 500x500 Toeplitz matrix (loops)_______ (sec): &amp;nbsp; 0.616 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.612 &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.596&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp;Escoufier's method on a 45x45 matrix (mixed)________ (sec): &amp;nbsp; 0.470 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.425 &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.447&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Trimmed geom. mean (2 extremes eliminated): &amp;nbsp; 0.611 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.617 &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: red; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;0.607&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;------------------------------&lt;wbr&gt;&lt;/wbr&gt;--------------&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Total time for all 15 tests_________________________ &amp;nbsp; &amp;nbsp;(sec): &amp;nbsp;&lt;b&gt;37.62 &amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: #33cc00;"&gt;12.76 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: red;"&gt;8.18&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;div style="color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Overall mean (sum of I, II and III trimmed means/3)_ &amp;nbsp; &amp;nbsp;(sec): &amp;nbsp;&lt;b&gt;&amp;nbsp;1.28 &amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: #33cc00;"&gt;0.67 &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: #33cc00; font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;b style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;&lt;span style="color: red;"&gt;0.44&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969); color: #222222;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&lt;b&gt;&lt;span style="color: red;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;So you can see there are some significant gains, especially for the slowest tasks (see bolded items above). &amp;nbsp;For example, the parallel MKL resulted in a 40x speedup of the cross-product calculation. &amp;nbsp;Across all jobs &lt;i&gt;the parallel MKL version was ~4.5x faster than the generic BLAS on this system&lt;/i&gt;. &amp;nbsp;When running models that take days to fit, that is significant!&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;Here's how I installed it on Ubuntu 12.04:&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family: inherit; text-align: left;"&gt;Download and install the&lt;/span&gt;&lt;a href="https://registrationcenter.intel.com/RegCenter/NComForm.aspx?ProductID=1461" style="font-family: inherit; text-align: left;"&gt;&amp;nbsp;Intel MKL from here&lt;/a&gt;&lt;span style="font-family: inherit; text-align: left;"&gt;.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="tag" style="background-color: transparent; font-family: 'Courier New', Courier, monospace; text-align: left;"&gt;&lt;pre&lt; span=""&gt;&lt;span class="pln" style="font-size: x-small;"&gt;&lt;span style="font-family: 'Times New Roman'; font-size: small; text-align: -webkit-auto;"&gt;First install some libraries needed by R:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: xx-small;"&gt;sudo apt-get install&amp;nbsp;libreadline6&amp;nbsp;libreadline6-dev&amp;nbsp;xserver-xorg&amp;nbsp;xserver-xorg-dev&amp;nbsp;gfortran-devel&amp;nbsp;&lt;/span&gt;&lt;/pre&lt;&gt;&lt;/span&gt;&lt;span style="background-color: white; font-family: 'Courier New', Courier, monospace; font-size: xx-small; text-align: left;"&gt;libxt-dev&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Download the latest R, I used v2.15, available &lt;a href="http://cran.r-project.org/sources.html"&gt;here&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Compile R from source using something like this (&lt;a href="http://cran.r-project.org/doc/manuals/R-admin.html#MKL"&gt;detailed instructions here&lt;/a&gt;):&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;export MKL_LIB_PATH=/opt/intel/composer_xe_2011_sp1.7.256/mkl/lib/intel64&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;export optim_flags="-O3 -funroll-loops -march=native"&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;# from http://cran.r-project.org/doc/manuals/R-admin.html#&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;MKL=" &amp;nbsp; -L${MKL_LIB_PATH}&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;-Wl,--start-group &lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;${MKL_LIB_PATH}/libmkl_gf_lp64.a \ &amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;${MKL_LIB_PATH}/libmkl_gnu_thread.a&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ${MKL_LIB_PATH}/libmkl_core.a &amp;nbsp; &amp;nbsp; &amp;nbsp; \&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;-Wl,--end-group &lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;-lgomp -lpthread"&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;sudo ./configure&amp;nbsp;--enable-R-shlib&amp;nbsp;--with-blas="$MKL" CC="gcc" CFLAGS="$optim_flags" CXX="g++" CXXFLAGS="$optim_flags" F77="gfortran" FFLAGS="$optim_flags" FC="gfortran" FCFLAGS="$optim_flags"&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div style="background-color: rgba(255, 255, 255, 0.917969);"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/691396040685448791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2012/05/compiling-r-with-intels-math-kernel.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/691396040685448791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/691396040685448791'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2012/05/compiling-r-with-intels-math-kernel.html' title='Speeding up R with Intel&apos;s Math Kernel Library (MKL)'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-8044699162439298314</id><published>2012-04-16T14:21:00.002-04:00</published><updated>2012-05-02T10:39:55.080-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Installing R's maps package on Ubuntu</title><content type='html'>I recently ran into trouble trying to install the R maps package on Ubuntu 10.04. &amp;nbsp;Here's the error I was getting:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&amp;nbsp;** arch -&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;gcc -std=gnu99 -O3 -pipe &amp;nbsp;-g &amp;nbsp; &amp;nbsp;Gmake.c &amp;nbsp; -o Gmake&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Gmake.c: In function ‘get_lh’:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Gmake.c:111: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Gmake.c:113: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Gmake.c: In function ‘main’:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Gmake.c:211: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Gmake.c:214: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Gmake.c:217: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Gmake.c:219: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Gmake.c:221: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Gmake.c:224: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Gmake.c:227: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;gcc -std=gnu99 -O3 -pipe &amp;nbsp;-g &amp;nbsp; &amp;nbsp;Lmake.c &amp;nbsp; -o Lmake&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Lmake.c: In function ‘main’:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Lmake.c:223: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Lmake.c:228: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Lmake.c:230: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Lmake.c:232: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Lmake.c:235: warning: cast from pointer to integer of different size&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Converting world to world2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;f convert.awk &amp;lt; world.line &amp;gt; world2.line&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;/bin/bash: f: command not found&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;make: [world2.line] Error 127 (ignored)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;make county.L state.L usa.L nz.L world.L world2.L italy.L france.L state.vbm.L state.carto.L&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;make[1]: Entering directory `/tmp/Rtmp4lXbpt/R.INSTALL375371de/maps/src'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;./Lmake 0 s b county.line county.linestats ../inst/mapdata/county.L&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;./Lmake 0 s b state.line state.linestats ../inst/mapdata/state.L&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;./Lmake 0 s b usa.line usa.linestats ../inst/mapdata/usa.L&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;./Lmake 0 s b nz.line nz.linestats ../inst/mapdata/nz.L&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;./Lmake 0 s b world.line world.linestats ../inst/mapdata/world.L&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;./Lmake 0 s b world2.line world2.linestats ../inst/mapdata/world2.L&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;Cannot read left and right at line 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;make[1]: *** [world2.L] Error 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;make[1]: Leaving directory `/tmp/Rtmp4lXbpt/R.INSTALL375371de/maps/src'&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;make: *** [ldata] Error 2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;ERROR: compilation failed for package ‘maps’&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;* removing ‘/usr/local/lib/R/site-library/maps’&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;ERROR: dependency ‘maps’ is not available for package ‘ramps’&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;* removing ‘/usr/local/lib/R/site-library/ramps’&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;The downloaded packages are in&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;‘/tmp/RtmpsAvFte/downloaded_packages’&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;After banging my head on it for awhile, I eventually found that if you&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family: inherit;"&gt;download the tar.gz from CRAN&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: inherit;"&gt;change line 55 of the Makefile to:&lt;/span&gt;awk -f convert.awk &amp;lt; world.line &amp;gt; world2.line&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;it will install fine. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/8044699162439298314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2012/04/installing-rs-maps-package-on-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/8044699162439298314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/8044699162439298314'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2012/04/installing-rs-maps-package-on-ubuntu.html' title='Installing R&apos;s maps package on Ubuntu'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-2499825462173624285</id><published>2012-03-30T11:00:00.004-04:00</published><updated>2012-05-02T10:40:12.294-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Slow R graphics via SSH</title><content type='html'>I do most of my R work on a server via SSH. &amp;nbsp;Viewing graphics (i.e. plot()) can be excruciatingly slow through the SSH pipe, but it's easy to make it fast. &amp;nbsp;Simply run:&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X11.options(type="Xlib")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;once in the R session.&amp;nbsp;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/2499825462173624285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2012/03/r-graphics-via-ssh.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/2499825462173624285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/2499825462173624285'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2012/03/r-graphics-via-ssh.html' title='Slow R graphics via SSH'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-7174238936508982348</id><published>2012-02-14T12:23:00.001-05:00</published><updated>2012-11-09T11:17:45.182-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grass gis'/><title type='text'>Installing grass extensions on Ubuntu</title><content type='html'>I recently struggled to install extensions using the version of GRASS installed from the UbuntuGIS repositories.&amp;nbsp; For example, I was trying to install i.landsat.toar to convert landsat's DNs to top of atmosphere radiance values using the following command:&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; g.extension -s --verbose extension=i.landsat.toar svnurl=https://svn.osgeo.org/grass/grass-addons/grass6  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;That gave the following error during compilation:&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; Using WGET for downloading data.  &lt;br /&gt; Fetching &amp;lt;i.landsat.toar&amp;gt; from GRASS-Addons SVN (be patient)...  &lt;br /&gt; A  i.landsat.toar/landsat_set.c  &lt;br /&gt; A  i.landsat.toar/local_proto.h  &lt;br /&gt; A  i.landsat.toar/main.c  &lt;br /&gt; A  i.landsat.toar/description.html  &lt;br /&gt; A  i.landsat.toar/landsat.c  &lt;br /&gt; A  i.landsat.toar/earth_sun.c  &lt;br /&gt; A  i.landsat.toar/landsat.h  &lt;br /&gt; A  i.landsat.toar/landsat_met.c  &lt;br /&gt; A  i.landsat.toar/Makefile  &lt;br /&gt; A  i.landsat.toar/earth_sun.h  &lt;br /&gt;  U  i.landsat.toar  &lt;br /&gt; Checked out revision 50813.  &lt;br /&gt; Compiling &amp;lt;i.landsat.toar&amp;gt;...  &lt;br /&gt; test -d OBJ.x86_64-pc-linux-gnu || mkdir -p OBJ.x86_64-pc-linux-gnu  &lt;br /&gt; gcc -I/build/buildd/grass-6.4.1/dist.x86_64-pc-linux-gnu/include -Wall -g -O    -DPACKAGE=\""grassmods"\" -I/build/buildd/grass-6.4.1/dist.x86_64-pc-linux-gnu/include -o OBJ.x86_64-pc-linux-gnu/earth_sun.o -c earth_sun.c  &lt;br /&gt; gcc -I/build/buildd/grass-6.4.1/dist.x86_64-pc-linux-gnu/include -Wall -g -O    -DPACKAGE=\""grassmods"\" -I/build/buildd/grass-6.4.1/dist.x86_64-pc-linux-gnu/include -o OBJ.x86_64-pc-linux-gnu/landsat.o -c landsat.c  &lt;br /&gt; landsat.c:4:23: fatal error: grass/gis.h: No such file or directory  &lt;br /&gt; compilation terminated.  &lt;br /&gt; make: *** [OBJ.x86_64-pc-linux-gnu/landsat.o] Error 1  &lt;br /&gt; ERROR: Compilation failed, sorry. Please check above error messages.  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;After exploring the information &lt;a href="http://comments.gmane.org/gmane.comp.gis.grass.user/42557"&gt;here&lt;/a&gt;, &lt;a href="http://grass.osgeo.org/wiki/Compile_and_Install#Addons"&gt;here&lt;/a&gt;, and especially &lt;a href="http://markmail.org/message/slasfywkqj5hu4io#query:+page:1+mid:d6eax24fnzwd74sk+state:results"&gt;here&lt;/a&gt;, I finally discovered a simple solution that seems to work. I don't think this has been reported elsewhere.&lt;br /&gt;&lt;br /&gt;First download the source code using svn as listed on the add-ons page.&amp;nbsp; For example:&lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; svn co https://svn.osgeo.org/grass/grass-addons/grass6/imagery/i.landsat.toar  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;then run: &lt;br /&gt;&lt;pre style="background-image: URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; sudo make MODULE_TOPDIR=/usr/lib/grass64 GRASS_HOME=/usr/lib/grass64 ARCH_DISTDIR=/usr/lib/grass64  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;It does return a few errors, but the addons are installed and work correctly (as far as I can tell).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;UPDATE (2012-11-9): &amp;nbsp;Following the release of GRASS 6.4.2, i.landsat.acca and i.landsat.toar are supposed to be &lt;a href="http://grass.osgeo.org/wiki/GRASS_AddOns#i.landsat.toar"&gt;included in core GRASS&lt;/a&gt;. &amp;nbsp;However, I just upgraded to 6.4.2 via the UbuntuGIS ppa and neither program seem to be included. &amp;nbsp;Strangely, i.landsat.toar is still available via g.extension, but i.landsat.acca is no longer in the &lt;a href="https://svn.osgeo.org/grass/grass-addons/grass6/imagery/"&gt;addons SVN&lt;/a&gt;. &amp;nbsp;By running:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #f0f0f0; border: 1px dashed rgb(204, 204, 204); font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; width: 646.4666748046875px;"&gt;&lt;code style="word-wrap: normal;"&gt;&amp;nbsp;&lt;/code&gt;&lt;span style="background-color: transparent; font-family: 'Courier New', Courier, monospace; font-size: x-small;"&gt;svn list -R https://svn.osgeo.org/grass/ | grep "i.landsat.acca"&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;I was able to find it here:&amp;nbsp;&lt;span style="font-family: Courier New, Courier, monospace; font-size: x-small;"&gt;grass/branches/develbranch_6/imagery/i.landsat.acca/.&lt;/span&gt;&lt;span style="font-family: inherit; font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: inherit;"&gt;So just replace the download command above with this:&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #f0f0f0; border: 1px dashed rgb(204, 204, 204); height: auto; line-height: 20px; overflow: auto; padding: 0px; width: 646.4666748046875px;"&gt;&lt;code style="word-wrap: normal;"&gt;&lt;span style="font-family: Courier New, Courier, monospace; font-size: x-small;"&gt; svn co https://svn.osgeo.org/grass/&lt;span style="background-color: transparent;"&gt;grass/branches/develbranch_6/imagery/i.landsat.acca/&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: arial; font-size: 12px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;followed by the make command above and you should be back in business. &amp;nbsp;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/7174238936508982348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2012/02/installing-grass-extensions-on-ubuntu.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/7174238936508982348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/7174238936508982348'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2012/02/installing-grass-extensions-on-ubuntu.html' title='Installing grass extensions on Ubuntu'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-1260236748823338280</id><published>2012-01-31T09:37:00.000-05:00</published><updated>2012-01-31T09:37:24.792-05:00</updated><title type='text'>Biodiversity of Earth's Richest Plant Kingdom Under Fire</title><content type='html'>The National Science Foundation just &lt;a href="http://www.nsf.gov/discoveries/disc_summ.jsp?cntn_id=122938&amp;amp;org=NSF"&gt;published a story&lt;/a&gt; on a research project I'm involved in to understand the &lt;i&gt;dimensions&lt;/i&gt; of biodiversity.&amp;nbsp;&amp;nbsp; A number of my photographs were used in the story, including this time lapse movie of &lt;span class="caption" id="photocaption"&gt;several scientists (including me) conducting a vegetation survey in South Africa to track &lt;/span&gt;&lt;span class="caption" id="photocaption"&gt;changes in &lt;/span&gt;&lt;span class="caption" id="photocaption"&gt;biodiversity.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;embed allowfullscreen="true" allowscriptaccess="always" bgcolor="000000" flashvars="smoothing=true&amp;amp;controlbar=over&amp;amp;file=traits.flv&amp;amp;streamer=rtmp://nsfgov.flash.internapcdn.net/nsfgov_vitalstream_com/_definst_/video/&amp;amp;image=http://www.nsf.gov/news/mmg/images/videostill.jpg" height="264" src="http://www.nsf.gov/js/video/player.swf" width="470"&gt;&lt;/embed&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/1260236748823338280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2012/01/biodiversity-of-earths-richest-plant.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/1260236748823338280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/1260236748823338280'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2012/01/biodiversity-of-earths-richest-plant.html' title='Biodiversity of Earth&apos;s Richest Plant Kingdom Under Fire'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-382304864036722673</id><published>2011-10-27T15:48:00.000-04:00</published><updated>2012-05-02T10:47:36.333-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Copy all the files in a directory to a new directory using R</title><content type='html'>Someone asked me how to move a directory full of files from one place to another using R. &amp;nbsp;The easiest way I've found is as follows (where "oldpath" is the existing directory and "newpath" is the new directory):&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;file.copy(list.files(oldpath),newpath)&lt;/span&gt;&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/382304864036722673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2011/10/copy-all-files-in-directory-to-new.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/382304864036722673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/382304864036722673'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2011/10/copy-all-files-in-directory-to-new.html' title='Copy all the files in a directory to a new directory using R'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-5093242392355389784</id><published>2011-07-01T09:19:00.000-04:00</published><updated>2011-07-01T09:19:38.595-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='photography'/><category scheme='http://www.blogger.com/atom/ns#' term='graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='science communication'/><title type='text'>Lightworks is going open source!</title><content type='html'>I just became aware of&lt;a href="http://www.lightworksbeta.com/" target="_blank"&gt; Lightworks &lt;span class="il"&gt;video&lt;/span&gt; editing software&lt;/a&gt;,  which has been used to create several major motion pictures (including &lt;i&gt;The King’s Speech&lt;/i&gt;).&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.lightworksbeta.com/"&gt;&lt;img border="0" height="176" src="http://www.editshare.com/pressimages/logo_lightworks.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;They are  taking the big (and admirable) step of making their software free and &lt;span class="il"&gt;open&lt;/span&gt; &lt;span class="il"&gt;source&lt;/span&gt;  in order to encourage use and development (they must be planning to  switch to selling services, classes, etc.).&amp;nbsp; It's functionality is very  similar to final cut pro (a steep learning curve, but very powerful) and  it's price (free) is quite attractive.&amp;nbsp; They only have a windows  version available now, but there should be versions for mac and linux  this year (as soon as they release the &lt;span class="il"&gt;source&lt;/span&gt; code, people will be jumping all over this)...</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/5093242392355389784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2011/05/lightworks-is-going-open-source.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/5093242392355389784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/5093242392355389784'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2011/05/lightworks-is-going-open-source.html' title='Lightworks is going open source!'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-7874699700604161744</id><published>2011-05-06T10:02:00.002-04:00</published><updated>2011-05-06T10:19:17.042-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='remote sensing'/><category scheme='http://www.blogger.com/atom/ns#' term='science'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Extracting reflectance data from SpectraSuite JCAMP files in R</title><content type='html'>I've been using an OceanOptics USB4000 spectrometer in research on biomass accumulation and climate in South Africa.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-n3tbVPHNgy0/TcP_vvFwPwI/AAAAAAAAVyE/AGSqxH49I6g/s1600/usb4000pad1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="182" src="http://1.bp.blogspot.com/-n3tbVPHNgy0/TcP_vvFwPwI/AAAAAAAAVyE/AGSqxH49I6g/s200/usb4000pad1.jpg" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This post presents a R function that will read in JCAMP files from the SpectraSuite software and output a vector of reflectance values.&amp;nbsp; SpectraSuite can convert binary output files to JCAMP files if they weren't saved as JCAMP.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/958976.js"&gt;  &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;You can use this to process a folder of spectra and return a data frame with a column for each file as follows:&lt;br /&gt;&lt;br /&gt;&lt;script src="https://gist.github.com/958993.js"&gt;  &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;And here's another function that will calculate NDVI similar to several satellite products:&lt;br /&gt;&lt;script src="https://gist.github.com/958992.js"&gt;  &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;You can apply this to the output of spectracompile() like this:&lt;br /&gt;&lt;script src="https://gist.github.com/958996.js"&gt;  &lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here's a few random spectra from various fynbos species:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-qYLH6JmDadI/TcQAgFdEgaI/AAAAAAAAVyM/3iVFchQMpJs/s1600/Screenshot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="309" src="http://4.bp.blogspot.com/-qYLH6JmDadI/TcQAgFdEgaI/AAAAAAAAVyM/3iVFchQMpJs/s400/Screenshot.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/7874699700604161744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2011/05/extracting-reflectance-data-from.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/7874699700604161744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/7874699700604161744'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2011/05/extracting-reflectance-data-from.html' title='Extracting reflectance data from SpectraSuite JCAMP files in R'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-n3tbVPHNgy0/TcP_vvFwPwI/AAAAAAAAVyE/AGSqxH49I6g/s72-c/usb4000pad1.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-5259709073869732490</id><published>2011-04-15T13:24:00.004-04:00</published><updated>2011-04-19T17:33:29.699-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='photography'/><category scheme='http://www.blogger.com/atom/ns#' term='science communication'/><title type='text'>Reconnecting the Lower Rio Grande</title><content type='html'>The 2011 North American Nature Photographers Association College Scholarship winners recently finished their project documenting efforts to 'reconnect the Lower Rio Grande valley in Southeastern Texas.&amp;nbsp; In a mere 5 days (and a few sleepless nights), they developed, planned, shot, and edited the project.&amp;nbsp; A great accomplishment.&amp;nbsp; Let me know what you think...&lt;br /&gt;&lt;br /&gt;You can read their introduction on their &lt;a href="http://vimeo.com/21488710"&gt;Vimeo site&lt;/a&gt;, or just watch it here:&lt;br /&gt;&lt;iframe frameborder="0" height="225" src="http://player.vimeo.com/video/21488710" width="400"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;a href="http://vimeo.com/21488710"&gt;Reconnecting the Rio Grande Valley&lt;/a&gt; from &lt;a href="http://vimeo.com/user6319206"&gt;NANPA College Students&lt;/a&gt; on &lt;a href="http://vimeo.com/"&gt;Vimeo&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class="short_text" id="result_box" lang="es"&gt;&lt;span class="hps" title="Click for alternate translations"&gt;o para&lt;/span&gt; &lt;span class="hps" title="Click for alternate translations"&gt;que usted&lt;/span&gt; &lt;span class="hps" title="Click for alternate translations"&gt;español&lt;/span&gt; &lt;span class="hps" title="Click for alternate translations"&gt;hablantes&lt;/span&gt;&lt;span class="" title="Click for alternate translations"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;iframe frameborder="0" height="225" src="http://player.vimeo.com/video/22138875" width="400"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;a href="http://vimeo.com/22138875"&gt;NANPA PROJECT spanish version2&lt;/a&gt; from &lt;a href="http://vimeo.com/user6319206"&gt;NANPA College Students&lt;/a&gt; on &lt;a href="http://vimeo.com/"&gt;Vimeo&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;One of the participants also put together an excellent documentary on the development of the project.&amp;nbsp;&amp;nbsp; You can see that here:&lt;br /&gt;&lt;br /&gt;&lt;iframe frameborder="0" height="225" src="http://player.vimeo.com/video/22471963?byline=0&amp;amp;portrait=0&amp;amp;color=0e910c" width="400"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;a href="http://vimeo.com/22471963"&gt;From Passion to Profession&lt;/a&gt; from &lt;a href="http://vimeo.com/aaronschmidt"&gt;Aaron Schmidt&lt;/a&gt; on &lt;a href="http://vimeo.com/"&gt;Vimeo&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/5259709073869732490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2011/04/reconnecting-lower-rio-grande.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/5259709073869732490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/5259709073869732490'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2011/04/reconnecting-lower-rio-grande.html' title='Reconnecting the Lower Rio Grande'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-2130884942670445271</id><published>2011-02-02T15:38:00.005-05:00</published><updated>2011-02-02T15:54:50.002-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='art'/><category scheme='http://www.blogger.com/atom/ns#' term='science'/><title type='text'>Big Bang, Big Boom</title><content type='html'>&lt;br&gt; I just ran across this incredible stop-motion video covering the last 14 billion years.&amp;nbsp; Those animated murals are fantastic! &lt;br&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe title="YouTube video player" class="youtube-player" type="text/html" width="425" height="349" src="http://www.youtube.com/embed/sMoKcsN8wM8?rel=0" frameborder="0" allowFullScreen&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;BIG BANG BIG BOOM: &lt;br /&gt;an unscientific point of view on the beginning and evolution of life ... and how it could probably end.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #999999;"&gt; direction and animation by BLU&lt;/span&gt;&lt;a href="http://www.blublu.org/" rel="nofollow" style="color: #999999;" target="_blank"&gt; blublu.org&lt;/a&gt;&lt;br /&gt;&lt;span style="color: #999999;"&gt; production and distribution by ARTSH.it&lt;/span&gt;&lt;a href="http://www.artsh.it/" rel="nofollow" style="color: #999999;" target="_blank"&gt; artsh.it&lt;/a&gt;&lt;br /&gt;&lt;span style="color: #999999;"&gt; soundtrack by ANDREA MARTIGNONI&lt;/span&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/2130884942670445271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2011/02/big-bang-big-boom.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/2130884942670445271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/2130884942670445271'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2011/02/big-bang-big-boom.html' title='Big Bang, Big Boom'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/sMoKcsN8wM8/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-2595592562192374159</id><published>2010-11-12T10:37:00.011-05:00</published><updated>2010-11-12T14:09:37.714-05:00</updated><title type='text'>Carbon counter</title><content type='html'>&lt;a href="http://www.dbcca.com/dbcca/EN/_img/new_sign.JPG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="200" src="http://www.dbcca.com/dbcca/EN/_img/new_sign.JPG" width="133" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This morning I met briefly with Bruce M. Kahn, Ph.D. who works for &lt;a href="http://www.dbcca.com/"&gt;Deutsche Bank Climate Change Advisors&lt;/a&gt;.&amp;nbsp; He showed me their "Carbon Counter" that presents a real-time &lt;i&gt;Semi-Empirical Representation of the Temporal Variation of Total Greenhouse Gas Levels Expressed as Equivalent Levels of Carbon Dioxide&lt;/i&gt; (you can read the methodology &lt;a href="http://www.dbcca.com/dbcca/EN/_media/MITJPSPGC_Rpt174.pdf"&gt;here&lt;/a&gt;).&amp;nbsp; It's on display in New York City as a &lt;a href="http://www.dbcca.com/dbcca/EN/carbon-counter.jsp"&gt;huge billboard&lt;/a&gt;.&amp;nbsp; Here's the current total:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="dbcca-seo-small" style="left: -999em; overflow: hidden; position: absolute; z-index: 5000;"&gt;&lt;h1&gt;www.know-the-number.com&lt;/h1&gt;&lt;a href="http://www.know-the-number.com/"&gt;Our Climate is Changing!&lt;/a&gt;&lt;/div&gt;&lt;script src="http://www.dbcca.com/dbcca/EN/_js/home/swfobject.js" type="text/javascript"&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); &lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;try{var pageTracker = _gat._getTracker("UA-1825898-14"); pageTracker._setDomainName("none"); pageTracker._setAllowLinker(true); pageTracker._trackPageview();} catch(err) {} &lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;swfobject.embedSWF("http://www.dbcca.com/dbcca/EN/_swf/embed-widget.swf", "dbcca-small", "350", "100", "9.0.0", "", {},{wmode:'transparent',base:'http://www.dbcca.com'},{}); &lt;/script&gt;&lt;br /&gt;&lt;div id="dbcca-small"&gt;Please download &lt;a href="https://www.adobe.com/go/getflashplayer/"&gt;Flash Player&lt;/a&gt;.&lt;/div&gt;&lt;br /&gt;Deutsche Bank has published &lt;a href="http://www.dbcca.com/dbcca/EN/investment_research.jsp"&gt;several reports&lt;/a&gt; on climate change and risk in financial markets.&amp;nbsp; Here's a few lines from &lt;a href="http://www.dbcca.com/dbcca/EN/about-us.jsp"&gt;their website&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;i&gt;&lt;span id="printContent"&gt;Three years ago, Deutsche Asset Management  identified climate change as one of the mega-trends that would drive the  global asset management business for the next generation and beyond. We  saw that the rapidly growing level of carbon in the atmosphere meant  that the world had to take action now, and that this would require  massive capital investment over several decades. That in turn would  produce exciting new investment opportunities from which our clients  could benefit.&lt;/span&gt;&lt;/i&gt;&lt;/blockquote&gt;It makes sense that companies that make their business dealing with risk (such as banks and&lt;a href="http://www.naic.org/Releases/2009_docs/climate_change_risk_disclosure_adopted.htm"&gt; insurance providers&lt;/a&gt;) have been among the quickest to move from denying that climate change is real to accepting&amp;nbsp; and planning for it.&lt;br /&gt;&lt;br /&gt;Regarding their counter, when I saw it I wondered if the number would go down in the northern  hemisphere spring (when all plants in the north start drawing down CO&lt;span style="font-size: xx-small;"&gt;2&lt;/span&gt;),  but they've removed those natural signals.&amp;nbsp; Here's what the actual CO&lt;span style="font-size: xx-small;"&gt;2&lt;/span&gt; concentration over the last few decades looks like:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Mauna_Loa_Carbon_Dioxide-en.svg/500px-Mauna_Loa_Carbon_Dioxide-en.svg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="257" src="http://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Mauna_Loa_Carbon_Dioxide-en.svg/500px-Mauna_Loa_Carbon_Dioxide-en.svg.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;So the overall trend is definitely increasing, but there is an annual cycle that increases and decreases as the northern forests "breath" in and out every year.&amp;nbsp; The counter is displaying something close to the red line on this plot, which is reasonable approach to convey that the overall trend is upward.&amp;nbsp; Otherwise the people of New York might think we solved the greenhouse gas emission problem next May...&lt;br /&gt;&lt;br /&gt;In fact, according to the &lt;a href="http://www.ntsg.umt.edu/"&gt;Numerical Terradynamic Simulation Group&lt;/a&gt; who have analysed satellite data to estimate net primary productivity over the last decade, there seems to have been a decrease in plant productivity. Check out this short summary video:&lt;br /&gt;&lt;object height="193" width="300"&gt;&lt;param name="movie" value="http://www.youtube.com/v/xjsvL23Sw9Q?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/xjsvL23Sw9Q?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="193"&gt;&lt;/embed&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/2595592562192374159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2010/11/carbon-counter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/2595592562192374159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/2595592562192374159'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2010/11/carbon-counter.html' title='Carbon counter'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-3624320198150408585</id><published>2010-10-08T09:58:00.003-04:00</published><updated>2010-10-14T11:14:49.180-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visualization'/><category scheme='http://www.blogger.com/atom/ns#' term='graphics'/><title type='text'>Potential Solar Radiation on the Cape Of Good Hope, South Africa</title><content type='html'>Incoming solar radiation drives the earth's climate system and is the ultimate source of energy on which most life on earth depends.&amp;nbsp; Here's an animation of potential solar radiation on the &lt;a href="http://goo.gl/maps/kpMd"&gt;Cape of Good Hope, South Africa&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_FeKWIYroNxo/TK8hk3D8UMI/AAAAAAAAVB8/0TyJtPvjrLo/s1600/Radiation.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_FeKWIYroNxo/TK8hk3D8UMI/AAAAAAAAVB8/0TyJtPvjrLo/s1600/Radiation.gif" /&gt;&lt;/a&gt;&lt;/div&gt;The units are watts per square meter per day.&amp;nbsp; A small bulb like those used on a Christmas tree are about one watt.&amp;nbsp; So the minimum value of 375 would be nearly equivalent to having 375 of those little bulbs burning on a square meter of land for 24 hours.&amp;nbsp; Now imagine the maximum value of 10,000.&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;These data were generated using the &lt;a href="http://grass.fbk.eu/"&gt;GRASS GIS&lt;/a&gt; &lt;a href="http://grass.fbk.eu/grass64/manuals/html64_user/r.sun.html"&gt;r.sun&lt;/a&gt; routine using a &lt;a href="http://asterweb.jpl.nasa.gov/gdem.asp"&gt;30m elevation model&lt;/a&gt; from the ASTER project.</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/3624320198150408585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2010/10/potential-solar-radiation-on-cape-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/3624320198150408585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/3624320198150408585'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2010/10/potential-solar-radiation-on-cape-of.html' title='Potential Solar Radiation on the Cape Of Good Hope, South Africa'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_FeKWIYroNxo/TK8hk3D8UMI/AAAAAAAAVB8/0TyJtPvjrLo/s72-c/Radiation.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-6612172153709123319</id><published>2010-10-07T15:43:00.002-04:00</published><updated>2010-10-15T10:56:43.377-04:00</updated><title type='text'>Absolute Certainty</title><content type='html'>The trouble with waiting until &lt;i&gt;Absolute Certainty&lt;/i&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;(which science will never provide)&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;img border="0" height="496" src="http://www.ucsusa.org/assets/images/si/science-idol-2010/Raul_Nuez_2010_web.jpg" style="margin-left: auto; margin-right: auto;" width="640" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;This year’s Union of Concerned Scientists' Science Idol is Raul de la Nuez of Miami, Florida. His  calendar will be on the cover of the 2011 Scientific Integrity Calendar.&amp;nbsp; Learn more about the calendar &lt;a href="http://www.ucsusa.org/scientific_integrity/science_idol/2010-science-idol-contestants.html"&gt;here&lt;/a&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.ucsusa.org/assets/images/si/science-idol-2010/Raul_Nuez_2010_web.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/6612172153709123319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2010/10/absolute-certainty.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/6612172153709123319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/6612172153709123319'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2010/10/absolute-certainty.html' title='Absolute Certainty'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-895979817626942103</id><published>2010-09-21T15:09:00.000-04:00</published><updated>2010-09-21T15:09:39.809-04:00</updated><title type='text'>ResearcherID</title><content type='html'>&lt;br&gt;&lt;br /&gt;I just found the &lt;a href="http://www.researcherid.com/"&gt;ResearcherID&lt;/a&gt; service by Thomson Reuters that allows researchers to create a unique ID and keep track of publications (as well as automatically calculate their H-index).  The Labs feature also offers some summary data of who your co-authors are (if you can't remember) and who's citing you.  Check out the map of people that have cited my papers &lt;a href="http://labs.researcherid.com/mashlets/rid/mashletsServer.jsp?rid=C-6731-2009&amp;mid=CitationDistribution&amp;cat=Map"&gt;here&lt;/a&gt;. You have control over which publications are in your list so you don't have to rely on an automatic search.  They offer a "badge" that you can embed in any html page to give readers access to an up-to-date list of your publications and citations. Here's mine: &lt;br&gt; &lt;span id="badgeCont876322" style="width: 126px;"&gt;&lt;script src="http://labs.researcherid.com/mashlets?el=badgeCont876322&amp;amp;mashlet=badge&amp;amp;showTitle=false&amp;amp;className=a&amp;amp;rid=C-6731-2009"&gt;&lt;/script&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/895979817626942103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2010/09/researcherid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/895979817626942103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/895979817626942103'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2010/09/researcherid.html' title='ResearcherID'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-7406912507315390624</id><published>2010-06-18T16:06:00.004-04:00</published><updated>2010-09-23T11:27:13.913-04:00</updated><title type='text'>Nature Photography Scholarship</title><content type='html'>&lt;br&gt;&lt;br /&gt;Remember the last time you talked to your family and non-scientist friends about your research and after 45 seconds their eyes glossed over.  Then you pulled out some scatter plots you find really compelling, and slapped some more wet newspaper on their interest.&lt;br /&gt;&lt;br /&gt;Now imagine instead that you pull up  a photographic slide show that shows them, rather than telling them, what you've been up to.  A series of well-composed photos sets the stage,  leads them through your process, and draws them in.  After you've piqued their interest, you might even be able to sneak in a few graphs that hammer the points home.&lt;br /&gt;&lt;br /&gt;The North American Nature Photographer's Association is offering student scholarships to attend next year's nature photography meeting in McAllen, Texas March 7 - 13, 2011 (you don't have to be a US citizen).  I got one of these last year and it was awesome.  They don't pay for travel, but they cover everything else (accommodation, food, registration, etc., which are worth about $1,500).   The application deadline is Novermber 8, 2010.  Get more information at the &lt;a href="https://www.nanpa.org/students/app_process_co.php"&gt;NANPA website&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/_FeKWIYroNxo/TJtRvJySzyI/AAAAAAAAVAg/zlGVKjaf1wc/s320/NANPA-Summit-College-Photography-Scholarship-2.jpg" style="margin-left: auto; margin-right: auto;" width="247" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Download the flyer &lt;a href="http://www.nanpa.org/students/NANPA-Summit-College-Photography-Scholarship.pdf%20"&gt;here&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/7406912507315390624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2010/06/nature-photography-scholarship.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/7406912507315390624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/7406912507315390624'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2010/06/nature-photography-scholarship.html' title='Nature Photography Scholarship'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_FeKWIYroNxo/TJtRvJySzyI/AAAAAAAAVAg/zlGVKjaf1wc/s72-c/NANPA-Summit-College-Photography-Scholarship-2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-3670146767176062694</id><published>2010-06-17T11:28:00.000-04:00</published><updated>2012-05-02T10:48:22.985-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='output'/><category scheme='http://www.blogger.com/atom/ns#' term='pdf'/><category scheme='http://www.blogger.com/atom/ns#' term='graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='file size'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>Shrinking R's PDF output</title><content type='html'>R is great for graphics, but I've found that the PDF's R produces when drawing large plots can be extremely large. This is especially common when using spplot() to plot a large raster. I've made a 15 page PDF full of rasters that was hundreds of MB in size.&amp;nbsp; Obviously I don't need all the detail (every pixel of the raster) represented in the pdf and would rather have it reduced in size somehow.&amp;nbsp; So I wrote an R function to automate the following:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;take an existing pdf and run &lt;a href="http://pages.cs.wisc.edu/%7Eghost/doc/AFPL/6.50/Ps2pdf.htm"&gt;ps2pdf&lt;/a&gt; on it as an intial compression step. Often this step is all that's needed.&lt;/li&gt;&lt;li&gt;split it into separate files using &lt;a href="http://www.accesspdf.com/pdftk/"&gt;pdftk&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Check to see if each separate page is larger than some threshold you specify (I set 5MB as the default)&lt;/li&gt;&lt;li&gt;If any one page is larger, rasterize the whole thing to a PNG file using &lt;a href="http://pages.cs.wisc.edu/%7Eghost/"&gt;ghostscript.&lt;/a&gt; I used the multicore package to parallelize this step, but this isn't necessary and that call could be replaced by lapply() to run them sequentially.&lt;/li&gt;&lt;li&gt;Put the separate pages (perhaps a mix of the original and the compressed rasters) back together.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Here's the function:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="-moz-background-clip: border; -moz-background-inline-policy: continuous; -moz-background-origin: padding; background: rgb(240, 240, 240) url(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif) repeat scroll 0% 0%; border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; shrinkpdf&amp;lt;-function(pdf,maxsize=5,suffix="_small",verbose=T){  &lt;br /&gt;  require(multicore)  &lt;br /&gt;   wd=getwd()  &lt;br /&gt;   td=paste(tempdir(),"/pdf",sep="")  &lt;br /&gt;   if(!file.exists(td)) dir.create(td)  &lt;br /&gt;   if(verbose) print("Performing initial compression")  &lt;br /&gt;   system(paste("ps2pdf ",pdf," ",td,"/test.pdf",sep=""))  &lt;br /&gt;   setwd(td)  &lt;br /&gt;   system(paste("pdftk ",td,"/test.pdf burst",sep=""))  &lt;br /&gt;   files=list.files(pattern="pg_")  &lt;br /&gt;   sizes=sapply(files,function(x) file.info(x)$size)*0.000001 #get sizes of individual pages  &lt;br /&gt;   toobig=sizes&amp;gt;=maxsize  &lt;br /&gt;   if(verbose)  print(paste("Resizing ",sum(toobig)," pages:  (",paste(files[toobig],collapse=","),")",sep=""))  &lt;br /&gt;   mclapply(files[toobig],function(i){  &lt;br /&gt;    system(paste("gs -dBATCH -dTextAlphaBits=4 -dNOPAUSE -r300 -q -sDEVICE=png16m -sOutputFile=",i,".png ",i,sep=""))  &lt;br /&gt;    system(paste("convert -quality 100 -density 300 ",i,".png ",strsplit(i,".",fixed=T)[[1]][1],".pdf ",sep=""))  &lt;br /&gt;    if(verbose) print(paste("Finished page ",i))  &lt;br /&gt;    return()  &lt;br /&gt;   })  &lt;br /&gt;   if(verbose) print("Compiling the final pdf")  &lt;br /&gt;   file.remove("test.pdf")  &lt;br /&gt;   file.remove(list.files(pattern="png"))  &lt;br /&gt;   setwd(wd)  &lt;br /&gt;   system(paste("gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=",strsplit(pdf,".",fixed=T)[[1]][1],suffix,".pdf ",td,"/*.pdf",sep=""))  &lt;br /&gt;   file.remove(list.files(td,full=T))  &lt;br /&gt;  if(verbose) print("Finished!!")  &lt;br /&gt; }  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/3670146767176062694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2010/06/shrinking-rs-pdf-output.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/3670146767176062694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/3670146767176062694'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2010/06/shrinking-rs-pdf-output.html' title='Shrinking R&apos;s PDF output'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-4608889812309769661</id><published>2010-06-03T12:35:00.004-04:00</published><updated>2012-05-02T10:48:22.992-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='R'/><title type='text'>MODIS processing with R, GDAL, and the NCO tools</title><content type='html'>I use &lt;a href="http://modis.gsfc.nasa.gov/"&gt;MODIS data&lt;/a&gt; for analysis of vegetation dynamics around the world.&amp;nbsp; The native &lt;a href="http://www.hdfgroup.org/"&gt;HDF&lt;/a&gt; file format provided by NASA is great for archiving the data (it's amazing how much information they include in each file), but unfortunately there aren't many tools for directly (and easily) extracting data stored across files like there are for the &lt;a href="http://www.unidata.ucar.edu/software/netcdf/"&gt;NetCDF&lt;/a&gt; format.&amp;nbsp; I wanted to be able to use the &lt;a href="http://nco.sourceforge.net/"&gt;NCO tools&lt;/a&gt; to extract timeseries of a sub-setted region stored in many files.&amp;nbsp; This is quite easy with the &lt;a href="http://nco.sourceforge.net/nco.html#SEC17"&gt;ncrcat&lt;/a&gt; and similar NCO utilities.&amp;nbsp; The trouble is that the NCO tools require the data to be in netcdf3 or netcdf-4 classic to do this. I &lt;a href="http://planetflux.blogspot.com/2010/06/installation-of-hdf4-hdf5-netcdf4-hdf.html"&gt;tried&lt;/a&gt; to use various HDF-&amp;gt;netCDF conversion tools but eventually decided it was easiest to convert HDF-&amp;gt;geotiff-&amp;gt;netcdf.&amp;nbsp; The hierarchical nature of the HDF files makes them difficult to parse and so far the netcdf tools are not able to work with them unless they are 'flattened' to a single group.&lt;br /&gt;&lt;br /&gt;So to use the NCO tools with MODIS data, I had to develop a processing routine that will convert them to netcdf-4 classic format.&amp;nbsp; This post will show you how.&lt;br /&gt;&lt;br /&gt;I generally use R for my data processing and workflow scripting, though much of this could be done with shell scripting or other languages.&amp;nbsp; &lt;b&gt;The code below is specific to my situation and will almost certainly require some editing if you want to use it.&amp;nbsp; I'm posting it to serve as general guidelines on how one might do this, not as a ready to use and generally applicable set of functions. &lt;/b&gt;I appreciate any suggestions on improvements.&lt;br /&gt;&lt;br /&gt;First you need to identify which tiles you need by looking at the &lt;a href="http://modis-land.gsfc.nasa.gov/MODLAND_grid.htm"&gt;map&lt;/a&gt;:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://modis-land.gsfc.nasa.gov/images/MODIS_sinusoidal_grid.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="177" src="http://modis-land.gsfc.nasa.gov/images/MODIS_sinusoidal_grid.gif" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Then run something like this to download the entire MOD13Q1 (vegetation indices) data from MODIS.&amp;nbsp; Get ready for lots of data (the following list of tiles results in 269GB!):&lt;br /&gt;&lt;br /&gt;&lt;pre style="-moz-background-clip: border; -moz-background-inline-policy: continuous; -moz-background-origin: padding; background: rgb(240, 240, 240) url(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif) repeat scroll 0% 0%; border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; ### Some specifications  &lt;br /&gt; ftpsite="ftp://e4ftl01u.ecs.nasa.gov/MOLT/MOD13Q1.005/" #for veg index  &lt;br /&gt; hdffolder="1_HDF" #folder to hold HDF files  &lt;br /&gt; ofolder="2_netcdf" #this is where the output NetCDF files will go  &lt;br /&gt; bandsubset=paste(1) #keep only these bands from HDF file  &lt;br /&gt; regionbounds="49 113 30 146" # Set region boundaries for clipping  &lt;br /&gt; ## Get tiles to download - get these from the map  &lt;br /&gt; tiles=c("h25v04","h26v04","h26v05","h27v04","h28v04","h27v05","h28v05","h29v05") #list of tiles to download, they will be mosaiced and clipped later - format is important, see wget command below  &lt;br /&gt; ### download HDFs  &lt;br /&gt; ### Use wget to recursively download all files for selected tiles - will not overwrite unless source is newer  &lt;br /&gt; searchstring=paste("\"*",tiles,"*\"",sep="",collapse=",")  &lt;br /&gt;  system(paste("wget -S --recursive --no-parent --no-directories -N -P",hdffolder," --accept",searchstring," --reject \"*xml\"",ftpsite))  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This will put all the files in the hdffolder (which I set to "1_HDF").&amp;nbsp; You now have each tile for time period as a separate file.&amp;nbsp; I find it convenient to mosaic the tiles and perhaps warp them to another projection and subset it to a smaller region than all of the tiles together.&amp;nbsp; To do this I use the following functions (note that some details are specific to extracting NDVI, if you want something else it will need to be edited).&amp;nbsp; The first converts a MODIS date code to the R date format:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;"&gt;modday2date&amp;lt;-function(i) as.Date(paste(c(substr(i,2,5),substr(i,6,9)),collapse="-"),"%Y-%j")&lt;/span&gt;&lt;br /&gt;The second converts a geotiff to a netcdf with a single-date record dimension:&lt;br /&gt;&lt;pre style="-moz-background-clip: border; -moz-background-inline-policy: continuous; -moz-background-origin: padding; background: rgb(240, 240, 240) url(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif) repeat scroll 0% 0%; border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"&gt;&lt;code style="color: black; word-wrap: normal;"&gt; geotiff2netcdf=function(geotiff,output,date=NULL,startday=as.Date("2000-01-01"),varname="NDVI",scale=0.0001,missing=-3000,range=c(-1,1)){ &lt;br /&gt;  ## Create netcdf file from modistool geotiff output &lt;br /&gt;  ##create file and open for editing &lt;br /&gt;  ## convert Date &lt;br /&gt;  utdates=as.numeric(date-startday) &lt;br /&gt;  ## Read in geotiff to set netCDF attributes &lt;br /&gt;  print(paste("Importing ",geotiff)) &lt;br /&gt;  x=readGDAL(geotiff) &lt;br /&gt;  ## Set dimentions &lt;br /&gt;  print("Defining NetCDF") &lt;br /&gt;  create.nc(output,clobber=T) &lt;br /&gt;  nc=open.nc(output,write=T) # Opens connection with netcdf file and write permission &lt;br /&gt;  dim.def.nc(nc, "latitude", dimlength=x@grid@cells.dim[2], unlim=FALSE) &lt;br /&gt;  dim.def.nc(nc, "longitude", dimlength=x@grid@cells.dim[1], unlim=FALSE) &lt;br /&gt;  dim.def.nc(nc, "time", dimlength=length(utdates), unlim=TRUE) &lt;br /&gt;  var.def.nc(nc,"time","NC_SHORT","time") &lt;br /&gt;  var.put.nc(nc,"time",utdates, start=NA, count=NA, na.mode=0) &lt;br /&gt;  att.put.nc(nc,"time", "units","NC_CHAR",paste("days since ",startday," 0",sep="")) &lt;br /&gt;  att.put.nc(nc,"time", "standard_name","NC_CHAR","time") &lt;br /&gt;  var.def.nc(nc,"longitude","NC_DOUBLE","longitude") &lt;br /&gt;  att.put.nc(nc,"longitude", "units","NC_CHAR","degrees_east") &lt;br /&gt;  att.put.nc(nc,"longitude", "standard_name","NC_CHAR","longitude") &lt;br /&gt;  var.put.nc(nc,"longitude",seq(x@coords[1],x@coords[2],x@grid@cellsize[1]), start=NA, count=NA, na.mode=0) &lt;br /&gt;  var.def.nc(nc,"latitude","NC_DOUBLE","latitude") &lt;br /&gt;  att.put.nc(nc,"latitude", "units","NC_CHAR","degrees_north") &lt;br /&gt;  att.put.nc(nc,"latitude", "standard_name","NC_CHAR","latitude") &lt;br /&gt;  var.put.nc(nc,"latitude",seq(x@coords[3],x@coords[4],x@grid@cellsize[2]), start=NA, count=NA, na.mode=0) &lt;br /&gt;  var.def.nc(nc,varname,"NC_SHORT",c("longitude","latitude","time")) &lt;br /&gt;  att.put.nc(nc,varname, "missing_value","NC_DOUBLE",missing) &lt;br /&gt;  att.put.nc(nc,varname, "units","NC_CHAR",varname) &lt;br /&gt;  att.put.nc(nc,varname, "standard_name","NC_CHAR",varname) &lt;br /&gt;  ## Process the data &lt;br /&gt;  print("Processing data and writing to disk") &lt;br /&gt;  notnull=x@data!=missing &lt;br /&gt;  x@data[notnull][x@data[notnull]range[2]/scale]=missing #get rid of occasional weird value &lt;br /&gt;  ## write the data to netCDF file &lt;br /&gt;  var.put.nc(nc,varname,as.matrix(x)[,ncol(as.matrix(x)):1], start=c(1,1,1),count=c(x@grid@cells.dim[1],x@grid@cells.dim[2],1)) &lt;br /&gt;  close.nc(nc) &lt;br /&gt;  print("Finished!") &lt;br /&gt; } &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;And the third puts it all together by first using the &lt;a href="https://lpdaac.usgs.gov/lpdaac/tools/modis_reprojection_tool"&gt;mrtmosaic tool&lt;/a&gt; to mosaic the tiles and subset to the band of interest, then using resample tool (available at the link above) to convert the HDF to a geotiff and then calling the function above to convert that to a netCDF:&lt;br /&gt;&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; ### Function to procss the files using the commands above.  &lt;br /&gt; modis2netcdf&amp;lt;-function(i,hdffolder,outputfolder,files,bandsubset=1){  &lt;br /&gt;  tdir="/media/fynbos/public/tmp"  &lt;br /&gt;  dir.create(tdir)  &lt;br /&gt;  tparams=paste(tdir,"/",i,"_params.txt",sep="")  &lt;br /&gt;  tmos=paste(tdir,"/",i,"_mosaic.hdf",sep="")  &lt;br /&gt;  tclip=paste(tdir,"/",i,".tif",sep="")  &lt;br /&gt;  ofile=paste(outputfolder,"/",i,".nc",sep="")  &lt;br /&gt;  f=file.exists(ofile) # file exists?  &lt;br /&gt;  if(f) print(paste(ofile," already exists, moving to next file...."))  # if exists, stop  &lt;br /&gt;  if(!f) {  &lt;br /&gt;  ## Mosaic and subset  &lt;br /&gt;   fs=paste(hdffolder,"/",grep(i,files,value=T),sep="")  &lt;br /&gt;  write.table(fs,file=tparams,row.names=F,col.names=F,quote=F)  &lt;br /&gt;  system(paste("mrtmosaic -i ",tparams," -s ",bandsubset," -o ",tmos,sep=""))  &lt;br /&gt;  ## Clip and reproject  &lt;br /&gt;  if(!file.exists("ModisToolParams.prm")) {print("Parameter file missing, stopping process") ; stop}  &lt;br /&gt;  system(paste("resample -p ModisToolParams.prm -i ",tmos," -o ",tclip," -t GEO -l \'",regionbounds,"\' -a INPUT_LAT_LONG -r CC",sep=""))  &lt;br /&gt;  geotiff=paste(tdir,"/",i,".250m_16_days_NDVI.tif",sep="")  &lt;br /&gt;  geotiff2netcdf(geotiff,output=ofile,date=modday2date(i))  &lt;br /&gt;  file.remove(tmos,tclip,tparams); gc()  &lt;br /&gt;  print(paste(which(dates%in%i), "out of ", length(dates)))  &lt;br /&gt; }}  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;You can then run these functions to process a folder of HDF files with the following commands.&amp;nbsp; If you are on a *nix system with multiple cores, I recommend using the multicore package to parallelize the processing.&amp;nbsp; Otherwise you'll need to change the mclapply() below to lapply():&lt;br /&gt;&lt;br /&gt;&lt;pre  style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; allfiles=as.character(list.files(path = paste(getwd(),hdffolder,sep="/"))) # build file list  &lt;br /&gt; dates=unique(do.call("rbind",strsplit(allfiles,".",fixed=T))[,2]) #get unique dates  &lt;br /&gt; type=do.call("rbind",strsplit(allfiles,".",fixed=T))[1,1] #get prefix of file type  &lt;br /&gt; band=1  &lt;br /&gt; ### Run the files - will not overwrite existing mosaics  &lt;br /&gt; mclapply(dates,modis2netcdf,hdffolder,outputfolder=ofolder,files=allfiles,bandsubset=band,mc.cores=8,mc.preschedule=F)  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now you can use the NCO commands to extract a timeseries from these files, perhaps for only a subset of the data using ncrcat.</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/4608889812309769661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2010/06/modis-processing-with-r-gdal-and-nco.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/4608889812309769661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/4608889812309769661'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2010/06/modis-processing-with-r-gdal-and-nco.html' title='MODIS processing with R, GDAL, and the NCO tools'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8246059922806188810.post-5270823098959387079</id><published>2010-06-03T11:52:00.001-04:00</published><updated>2010-09-23T11:27:59.056-04:00</updated><title type='text'>Installation of HDF4, HDF5, netCDF4, hdf-eos, and hdf-eos5 on Fedora 11</title><content type='html'>&lt;br&gt; &lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;I originally wanted to install these libraries to allow processing of MODIS HDF4-EOS files using the &lt;a href="http://nco.sourceforge.net/"&gt;NCO operators&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;.&amp;nbsp; I was able to get everything compiled, but the differences between HDF4 and HDF5 and the difficulties of converting the hdf-eos format to the relatively simple (no groups or hierarchical structure) needed for the netcdf-classic format led me to a different processing workflow. More on that later.&amp;nbsp; I'm posting my experience here in the hope that it will save someone the hours I spent figuring this out.&amp;nbsp; The version of netCDF in the Fedora repositories does not seem to have been compiled with NetCDF4/HDF5 support (or szlib encoding) so I decided to compile it all from source. It took a surprising amount of time given that the nco operators depend on netcdf-4, which depends on hdf5 and to convert from hdf4-eos to a version of hdf5-eos that is netcdf compliant requires hdf-eos andhdf-eos5.&amp;nbsp; Here are the steps to get this compiled:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;compile szip &lt;/span&gt;&lt;a href="http://www.hdfgroup.org/ftp/lib-external/szip/2.1/src/"&gt;&lt;span style="font-size: small;"&gt;from source:&lt;/span&gt;&lt;br /&gt;&lt;/a&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: courier new;"&gt;./configure --prefix=/usr/local/szip-2.1 --enable-encoding&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;compile hdf4 &lt;a href="http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/"&gt;from source&lt;/a&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;"&gt;export LD_LIBRARY_PATH=/usr/local/szip-2.1/lib&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;"&gt;./configure --disable-netcdf --prefix=/usr/local/hdf-4.2.5 --with-szlib=/usr/local/szip-2.1&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;according to &lt;a href="http://www.hdfgroup.org/ftp/HDF5/h4toh5/src/unpacked/release_docs/INSTALL_Unix.txt"&gt;this README&lt;/a&gt;, hdf-4 should be compiled without netcdf because it interferes with hdf5 netcdf access. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;compile hdf5 &lt;a href="http://www.hdfgroup.org/HDF5/release/obtain5.html"&gt;from source&lt;/a&gt;:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: courier new;"&gt;./configure --prefix=/usr/local/hdf5-1.8.4 --with-szlib=/usr/local/szip-2.1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;compile netcdf-4 from source with hdf5 support&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; font-size: xx-small;"&gt;&lt;span style="font-size: x-small;"&gt;./configure --prefix=/usr/local/netcdf-4.1.1 --enable-netcdf4 --with-hdf5=/usr/local/hdf5-1.8.4 --with-szlib=/usr/local/szip-2.1 --enable-hdf4=/usr/local/hdf-4.2.5 --with-udunits --enable-hdf4-file-tests --enable-cxx-4 --enable-extra-example-tests CFLAGS=-fPIC&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;hdf-eos2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;"&gt;./configure CC='/usr/local/hdf-4.2.5/bin/h4cc -Df2cFortran' CFLAGS=-DH5_USE_16_API --prefix=/usr/local/hdfeos2 --with-hdf4=/usr/local/hdf-4.2.5 --enable-install-include --with-szlib=/usr/local/szip-2.1&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;hdf-eos5&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: xx-small;"&gt;&lt;span style="font-size: x-small;"&gt;export LD_LIBRARY_PATH=/usr/local/szip-2.1/lib&lt;br /&gt;./configure CC='/usr/local/hdf5-1.8.4/bin/h5cc -Df2cFortran' CFLAGS=-DH5_USE_16_API --prefix=/usr/local/hdfeos5 --with-hdf5=/usr/local/hdf5-1.8.4 --enable-install-include --with-szlib=/usr/local/szip-2.1&lt;/span&gt;&lt;/span&gt; &lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;compile nco with netcdf4 support (apparently not the default provided in the repository). First check it out of the CVS as explained &lt;a href="http://nco.sourceforge.net/#Source"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;cvs -d:pserver:anonymous@nco.cvs.sf.net:/cvsroot/nco login&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;cvs -z3 -d:pserver:anonymous@nco.cvs.sf.net:/cvsroot/nco co -r nco-4_0_1 -d nco-4.0.1&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: inherit;"&gt;Then compile it. The last flag comes from advice found &lt;a href="http://sourceforge.net/projects/nco/forums/forum/9830/topic/3713643"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;./configure --prefix=/usr/local/nco --enable-netcdf-4 HDF5_LIB_DIR=/usr/local/hdf5-1.8.4/lib NETCDF_ROOT=/usr/local/netcdf-4.1.1 NETCDF4_ROOT=/usr/local/netcdf-4.1.1 --disable-dap-netcdf CPPFLAGS='-DHAVE_NETCDF4_H'&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;Following the instructions at: http://hdfeos.net/software/ncl.php#ref_sec:convert-classic, I wrote a short R program that edits the text file to remove the group information and flatten the file.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;compile aug_eos to augment a hdf5 file so it can be accessed with netcdf-4.&amp;nbsp; However this did not allow the NCO tools (which require netcdf-3 or netcdf-4 classic formating).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;./configure CPPFLAGS=-DH5_USE_16_API --prefix=/usr/local/aug_eos --with-hdfeos5=/usr/local/hdfeos5 --with-hdf5=/usr/local/hdf5-1.8.4 --with-szlib=/usr/local/szip-2.1 &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://planetflux.adamwilson.us/feeds/5270823098959387079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://planetflux.adamwilson.us/2010/06/installation-of-hdf4-hdf5-netcdf4-hdf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/5270823098959387079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8246059922806188810/posts/default/5270823098959387079'/><link rel='alternate' type='text/html' href='http://planetflux.adamwilson.us/2010/06/installation-of-hdf4-hdf5-netcdf4-hdf.html' title='Installation of HDF4, HDF5, netCDF4, hdf-eos, and hdf-eos5 on Fedora 11'/><author><name>Adam M. Wilson</name><uri>https://plus.google.com/115368134577496399720</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-oArelJMDJkQ/AAAAAAAAAAI/AAAAAAAAlF4/Vp9O2_WPzbw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>