Friday, April 20, 2007

MarsEdit markdown test.

This is a test of MarsEdit's Markdown capabilities. Why use Markdown?

- It's easier to write
- It's easier to read the source

This is some code:

def rot2d(x, y, ang):
'rotate vectors by geometric angle'
xr = x*cos(ang) - y*sin(ang)
yr = x*sin(ang) + y*cos(ang)
return xr, yr

So, check out [this link](http://www.red-sweater.com/blog/324/marsedit-markdown), or see how [Markdown syntax works](http://daringfireball.net/projects/markdown/syntax).

Wednesday, April 11, 2007

PyQwt5 -- another plotting package for numerical python

Although matplotlib is the standard 2D plotting tool for numerical python, PyQt5 looks like an interesting alternative. Although the graphics appear to be more geared toward on-screen display, it is also (supposedly) very fast, so it might be a good platform for real-time data analysis.

Tuesday, April 10, 2007

Setting up Parallels to read a serial port

I need to set up parallels to run windows so that I can use software (windows only) that came with my RBR-620 CTD. The solution is much easier than some of the hints found on the web. Simply install the USB to RS232 drivers in windows, and then allow parallels to see the device by checking the appropriate device in the 'Devices -> USB' menu. That's it.

Just make sure to turn it off again when you want to use the port on the Mac side, as they don't share devices well..

Tuesday, March 20, 2007

serial ports and Mac os X

It is pretty straightforward to add a serial port to your Mac using a serial to RS232 converter. I bought a USBG-232 converter from usbgear, that has a foot cable, and lights so you can check the connection at the hardware level.

Don't bother with the drivers on their website, which are outdated. Go to FTDI, the company that makes the chip inside. They have up-to-date drivers even for intel Macs.

To talk to your serial device, you could get goSerial, but I wanted to do some on-the-fly analysis using python (of course). For this, I use pyserial. You just have to make sure that you link to the serial device correctly, as the FTDI drivers call it something nonstandard.

Wednesday, March 7, 2007

non-linear colormaps in matplotlib

Here is a way to do non-linear colormaps in matplotlib. You can select a base colormap, and a series of levels, and this class will remap the (linear) colormap such that your new selected levels define the linear positions along the map. This can be used for plotting bathymetry, specifically, where you may want to have more contours in the shallows than deep. Grab the code here: nlcmap.py.

Wednesday, February 28, 2007

Hypoxia and river discharge.

Here is a plot of hypoxia and river discharge. The discharge is measured at Tarbert Landing, and is plotted in 1000 m3/s. The measured bottom hypoxic area is plotted as read lines in terms of area (1000 km2). The length of the lines represent the period over which the data were taken.

Figure after the jump

Tuesday, February 27, 2007

New submission of the hypoxia paper

I finally got around to doing my revisions, and sent the hypoxia paper in. You can get it here:

hypoxia.pdf [8 Mb]

Enjoy.