Wednesday, December 31, 2008

Puppy vacu-sucked out of well!

As I sit here in front of the computer waiting for the ball to drop on MSNBC's live webcast (my poor, sick boyfriend snoozing on the couch), I have come across this video:

I am not sure which is better: that they actually had to vacu-suck the puppy out of the well or that the firefighter actually said "mouth-to-snout resuscitation."

Happy New Year!

MB-System 5.1.1 update in Fink

As Kurt points out in his lastest blog post, Fink now supports the latest beta version of MB-System (ver. 5.1.1). The OpenGL features now work, so not only can you view and manipulate 3D grids, but you can edit 3D swath data as well. Check out Kurt's blog for some sample grids to download and play with. The controls take some getting used, but once you get the hang of it, it is quite easy. If you want to use the 3D editor, you will need a grid as well as the associated swath files. I cannot wait to create some grids of my own and test out the editor after the New Year's. In the meantime, here is what the 3D grid viewer (mbgrdviz) looks like with one of Kurt's grids loaded and a profile taken:


Tuesday, December 30, 2008

Upgrading to X11 2.3.1 w/ some slight issues

Recently I updated my X11 environment to the open source version (2.3.1) provided by the xQuartz project. The x11 that shipped with my Mac with OS 10.5.6 did not seem to be happy and did not play well with Fink (lots of missing libraries, making certain Fink installs fail).

Upon install I noticed a couple of things:

1) Matlab would no longer start

For some reason after the X11 update, some of the links for required lib files during Matlab startup no longer worked. I searched online and found that if you start Matlab using the alias icon (the one with the up arrow on it in your Matlab directory, for me called Matlab Student 7.4 (also can be found at Matlab/bin/maci/StartMatlab)), the problem is somehow avoided. So I simply removed the original app icon from my dock and dropped the alias there instead. I still may submit a help ticket to Matlab though. I did try a reinstall and it did not solve the issue.

2) Fonts appear out of whack

When Matlab did finally start, the font was huge; I had to go into preferences and adjust it. After I reinstalled Matlab and got the registration window, the font was so big that letters were overlapping. I am not sure what is causing this, but adjusting the font under preferences seemed to do the trick.

3) Window resizing does not always seem to work right

In MB-System, sometimes the windows seem to cut off part of the text, making it hard to read. This happens in both mbedit and in the mbgrdviz control window. Resizing the window makes the grey bounding box bigger, but does not nothing to make the inner boxes around the text bigger. This could be an issue in MB-System itself and not X11, but that still remains to be determined. I know Kurt Schwehr, who packages MB-System for Fink (see his maintained Fink packages here), as well as the MB-System guys themselves, are hard at work with updates so if it is an issue on that end I am sure it will be worked out soon.

Monday, December 29, 2008

Asteroid Hitting Earth - set to Pink Floyd

Happy New Year! Here is a YouTube animation of an asteroid hitting the Earth. If you have the bandwidth and screen resolution for it, click the video to go to the YouTube site to view the high def version; it is really extraordinary.



Sunday, December 28, 2008

MB-System: free, open-source sonar data editing software!

Recently I decided that I wanted to learn MB-System so that I would have a familiarity with a free, open-source swath sonar data editing software. I like CARIS -I use it A LOT- but since I cannot afford a personal license, it is not something I can have installed on my personal computer. Furthermore, I am starting to hate being dependent on software that requires separate license keys. I was on a ship when a license file for the processing software became corrupt (or expired, not sure exactly what happened) and it was a rather frustrating situation; with no way to get a new license at sea, the IT guys had to resort to using a Norton Ghost image to reinstall everything on the machine. Anyway, now that I have my new macbook, I figured I would go ahead and give MB-System a try.

First I installed MB-System using Fink. If you have not heard of Fink, check it out here. It packages up open-source unix programs and compiles them to run on a mac. The only incompatibility as of now is that the MB-System grid viewer is not supported by Fink due to an issue with OpenGL and some differences in the naming conventions between the OS X 10.4 and 10.5 environments, but it is currently being worked on. Once I had fink installed and updated, I simply ran:

$ fink install mbsystem (for me, the dollar sign is my command prompt)

I decided to test out MB-System with a single data file from my summer hyd
rographic field course. First I ran mbinfo to get an idea of the scope of the data I was dealing with:

$ mbinfo -I 0162_20080616_161142_RVCS.all

This provides a neatly organized output that includes navigation info, start and end info (times, lat, long, depth, etc.), total number of pings, etc.

remember, you can click an image to see it full-size

Another good thing to check early on in your processing is the navigation, which can be done using mbnavlist:

$ mbnavlist -I 0162_22080616_161142_RVCS.all

This command can be modified to display different data, but by default it displays date and time, unix time (in decimal seconds), longitude, latitude, heading, and speed.

The next tool I ran was mbm_plot, so I could look at the line an see what it looked like:

$ mbm_plot -I 0162_20080616_161142_RVCS.all

this command generates a .cmd file that contains all the necessary com
mands to generate a postscript file and display it using ghostview. To run the command:

$ ./0162_20080616_161142_RVCS.all.cmd

Since I do not have ghostview, I get a small error message which I ignore and just run the open command to view it in Preview. The last command simply plotted the navigation trackline, but now say I want to see what the actual bathymetry looks like. I can run mbm_plot again and indicate that I want to use a color-fill of the bathymetry by using the graphics mode (-G). I can also specify to overlay the trackline by
adding -N:

$ mbm_plot -I 0162_20080616_161142_RVCS.all -G1 -N

Again, a .cmd file is generated that I can run to plot the data and view it. The mbm_plot function utilizes GMT to create the plot and handle the axes. You can customize mbm_plot quite a bit, but aside from specifying color-fill and navigation, I left mine at the default settings. Here is the result:

In order to edit the actual pings, you use a command called mbedit. Right now you can only edit using a 2D viewer, but there is a 3D MB-System editor in the works (it is currently in a beta version now). To open up mbedit for the line, I simply ran:

$ mbedit -I 0162_20080616_161142_RVCS.all

I could also have just opened mbedit by itself and then opened the line file from within the program. In mbedit you can apply filters to blank out the outer beams, flag bad data poin
ts, edit individual beams and pings, etc. There are many different view options in mbedit that makes examining the data fairly easy. In the example below I am using the waterfall display with the option to color by bottom detection algorithm turned on. The data was collected with a Simrad EM3002 dual-head system, and the waterfall displays enables you to see the individual pings of each transducer. Red beams are phase-detected and black are amplitude-detected.


These tools represent only a few of the things that MB-System can do. To really get a sense of it all, you need to check it out for yourself. I highly recommend Val Schmidt's MB-System Cookbook as a must-have manual.

So far, the only quirk I have noticed with editing my data in MB-System is
that when I plot it, it appears that the actual ping data and the navigation data start and stop at different times. It is hard to see in the plot figure above, but you can clearly see it in the plot of a turn line below. This could be due to how MB-System handles the extrapolation of the navigation data for Simrad systems, or it could just be something weird on the Simrad side. Simrad does not store navigation for each individual ping, so it is possible to have pings without nav and vice-versa. Kurt looked at some Hydrosweep data in MB-System (Hydrosweep does store nav data for each ping) and his data did not have this problem. I am definitely going to have to play around with it and see if I can figure out exactly what is going on. Regardless, I think MB-System is a great tool and fills a very real-world need. Not everyone can afford the multi-thousand dollar price tag that comes with many of the more mainstream sonar processing software suites, and it is nice to know that there are other options available.

Saturday, December 27, 2008

Stars Wars on Apple Terminal

Happy Holidays!
I am currently sitting in the San Jose airport waiting to board my plane and as taking advantage of the free wifi to putz around on my mac. Here a couple fun terminal commands that I just ran across:

1) say hello
just type say and then whatever else you want and your mac will speak to you.

2) telnet towel.blinkenlights.nl
allows you to play Star Wars IV (all in ascii) on your mac. Someone had way too much time on their hands.

for these and more, check out: http://www.mactricksandtips.com/2008/02/top-50-terminal-commands.html

Monday, December 22, 2008

Sync iCal and Google! (and other cool Mac tools)

So now that I have my new macbook (oh yeah, btw, I have a new macbook and I love it!) I am spending part of my time trying to find some cool little tips and tricks to make my mac as cool and as efficient as possible. Some of the things I have come across are just plan fun, like when my brother showed me command+option+control+8, which inverts your display colors to have a negative-like effect. Hit the key combo again to turn it off. However, some of the tools are quite handy indeed.

Here's a little list of tools I have found really beneficial to have:

1) CalDav: a little tool that will sync your iCal and Google calendars. The refresh rate is very fast. Once I add an event in iCal, by the time I load my Google calendar page, it is there.

2) MenuMeter: this little tool Kurt pointed me to. You can display graphs and meters for your CPUs and network traffic (as well as memory and disk usage) in your menu bar.

3) KeyCue: displays a floating window of keyboard shortscuts whenever you press and hold the command key. It will tailor the shortcuts to whatever application you are working in. The professional version costs money, but the unregistered version works very well and just displays the registration screen every once in a wh
ile when you hit command instead of the shortcut menu (it will go away after a second). As a mac newbie, this tools has been great for me!


4) Caffeine: this tool prevents your mac from dimming the display or going into sleep mode. This is essential if you watch Netflix on your mac. It simply puts a little icon in your menu bar, and you click it once to turn it on and once more to turn it off.

5) Zoom: zoom can be found under Universal Access in your System Preferences. Turning this on allows you to zoom into and out of your screen using command+option and the + or - keys. This is great for zooming in programs and on web pages that do not normally support the zoom feature.

6) Flip4Mac: this plug-in feature allows Quicktime to playback Windows Media files (wma, wmv).

7) DivX: this tool includes a trial version of their media player (it expires after 180 days), but more importantly adds DivX functionality to Quicktime (which does not expire).

8) VLC: this is a separate media player from Quicktime, but can play a lot of videos that Quicktime cannot (such as ogg files).


Here is one more that is not necessarily beneficial per se (at least not to the average user), but sure is cool as heck:

9) Seismac: this tool will turn your Sudden Motion Sensor (SMS) equipped mac (any newer mac model, and some of the older powerbooks and ibooks) into a real-time three-axis accelerometer!


Wednesday, December 10, 2008

Interactive 3D models in PDFs!

I just saw this on Kurt's blog and had to post about it. Imagine turning in a cruise report with an interactive 3D model of your bathymetric data! Better yet, imagine a Ph.D. or Master's thesis with interactive models!

First you open your 3D mesh with MeshLab and convert it to Universal 3D (U3D) format. Meshlab then generates a snippet of code using the Latex document markup language. You include this code in your Latex document, compile, and voila: a PDF is created with the interactive 3D model built right in!

Check out the example PDF here: Laurana.pdf.

I wonder if it would be possible to export directly to U3D format from say Fledermaus or CARIS. This would necessitate some patches or hotfixes, but boy! what a powerful addition it would be.

Friday, December 5, 2008

File version control with Subversion

CCOM uses Subversion (svn) on their server to enable folks to have version control on their important documents. What this means is that I can commit a file to my subversion account on the server, and each time I modify the file, a new version will be saved. If I realize I made a mistake or need to go back to a previous copy of the file, I simply "checkout" an earlier version. This is great for constantly changing documents such as source code, html, my thesis proposal, etc. One neat thing is that everytime you "commit" a new version of the document to svn, it only saves the actual changes. Therefore, your memory usage increases only the minimal required amount each time.

To access svn on my Windows machine, I use a program called
Tortoise. Tortoise allows me to upload, checkout, update, and commit files easily to svn. For example, initially I uploaded some source code of mine to the repository. It is now safely stored on the server. When I checkout the file from svn, the most recent version (unless I specify otherwise) is dropped onto my local machine. Once I am happy with any edits I make to this local copy, I simply commit the file back to svn. This new copy autmatically gets a new version number (called revision in SVN) and will be stored as the most recent version. The update command is used to update any checked out copies on your local machine to most recent version in the svn repository. This is handy when multiple people are working on the same file.

The only potentially confusing thing thus far is that revision numbering in svn is global. This means that everytime I commit a file, the global revision number for the whole repository increments by one. For example, say I upload a file and svn assigns it a revision number of 25. Then I checkout a file with a revision number 2. Once I edit the file and commit it back to svn, its revision number will update to 26, instead of 3.

A typical svn reposity is set up with three main directories (note this is only a recommended structure):

  • trunk - this is the main directory for your files and where you commit regular changes
  • tags - a collection of snapshots of the trunk (or a branch) at a user-defined point in time. This basically contains pointer files to specific versions. This is good for a version you want to be able to access quickly. For example, if I used a specific version of my source code to process some data for a publication, I will want to quickly be able to access this exact version.
  • branches - active variations of the project compared to the trunk (or even another branch). Branches are good for when you are editing a file already in the trunk, but you do not have a working version yet. Perhaps you are trying out some new addition to your code, and you are still in the testing phase. This is also a good place to store any revisions you have to make to older versions of files in your trunk directory. For example, say I use version X of my code to process data for a paper. Now, a year later, I am on version Z of that code. Someone using version X from my paper finds a bug in it I need to fix but I do not wish to give them version Z yet. I can fix the bug in version X, and commit the new version of that code to the branch directory. That version Z of the code is still my most recent version in the trunk directory.
I found a good guide on svn here. This guide is for a specific svn client called Subclipse, but I find it a better tutorial than the one for Tortoise. Now I can stop pestering my poor boyfriend with svn questions over IM.

Oh, I should also note that Windows users who use Cygwin can also use svn via command line .