Tuesday, April 20, 2010

Lithology logs: using Psicat XML to create SVG outputs

PSICAT is a very nice tool to create lithology logs for sediment cores. One of the most interesting features of PSICAT is it's own XML export format. The format is very simple, it basically consists of two element: 'model' and 'property'. 'Model' is just a simple container for data and can represent an Interval, Bed or Lithology etc.. A 'model' can contain several 'property' elements, which represent simple key value pairs. Here is an example:

<model id="158cc6_1250de53dc5_15" parentId="1899213_1244fb3b1d8_1" type="psicat.core.interval.Interval">
<property name="depth.top">0.00</property>
<property name="depth.base">0.60</property>
<property name="grainsize.base">-1.56</property>
<property name="grainsize.top">-1.56</property>
<property name="contact.type">sharp</property>
Last week I was playing with this format and was surprised how easy to handle it was. In an attempt to do something useful with it, I tried to create an SVG (scalable vector graphics) output based on PSICAT data. And it worked! The first version is able to plot Intervals and Beds quite nice. You can try it here: http://www.stratigraphy.net/psi2svg

UPDATE: The code and tool has been moved, please visit http://www.lithologs.net !

No comments: