Sunday, January 30, 2011

Apparent Dip Script Revisited

The apparent dip script mentioned a few posts below has some issues with due north trending cross section lines.  It's calculating bogus apparent dips.  I need to revisit it at the conclusion of Winter quarter to fix bugs.  Until then, I really don't recommend relying on it.  Unless, of course, you want to make it better.  But then I'd recommend just writing the script from scratch, since I used the rapid prototyping model.  It is really ugly work.

Just a warning.

Friday, January 21, 2011

Stereonet Apps

For OS X, there is a stereonet app called Stereonet, by R. W. Allmendinger.  It is a little long in the tooth but it works great for plotting massive amounts of planes and lines.  It can also do a best cylindrical fit, Kamb contours, plot poles, get intersections, rotate your data, and a heck of a lot more.  It also exports to PICT using vectors: nice for use in Illustrator or your preferred vector editing application.  Highly recommended for geologists of all levels.

If I were a masochist (Objective C isn't my cup of tea), I'd code a Stereonet App for iOS.  It'd be beautiful on the iPad!  And I wouldn't charge anything for it.

Maybe this summer...

Thursday, January 20, 2011

Taking Data with a Consumer-Level GPS

Last year I wrote a Python script that could take a GPX file loaded with specially described tracks and waypoints and generate a series of shapefiles with appropriate geometries.

For example, you could name a track "contact" and it would close the track to create a ring and thus a polygon.  Or describe two points such as "f1,rl" (where 1 is a unique ID) to get a fault line attributed as right lateral.  Finally, it could also take waypoints with the description "sd,270,30" to generate strike and dip points.

I haven't messed with that script in a long time and probably won't start because it's often more work using a consumer level GPS rather than plotting directly onto a basemap.

But I think that using a GPS to record strike and dip data is a good idea.  Strikes and dips are often taken at contact boundaries, and with a GPS fix, you could make adjustments to your mapped contacts.  It also can save a lot of time as you don't have to digitize your S/Ds.  In addition, you'll have them in a tabular format (DBF) ready to process in any other software.

There is one caveat of course:  your GPS unit has built-in uncertainty due to government restrictions.  If your GPS provides an uncertainty value, make sure it isn't resolvable at your mapscale!  Or is at least within the uncertainty of your own mapping abilities (e.g., plotting strike and dip based on topo lines and real world topography).

That said...

You can download your waypoint data with all kinds of software.  Garmin Basecamp for Mac, gpsbabel, etc.  QGIS can directly import or download the GPX data as a layer from your GPS.  You then simply export the layer, load the resultant shapefile, and give it a projection (it should already have a datum such as WGS 84).  The shapefile has all the attribute data provided by the GPX file such as x,y coordinates, elevation, comment/description, and time and date.

On my Garmin, I put the following into my waypoint comment/description field: 330,10.

That's it.  I didn't put any other identifiers since I only took strike and dips  using the GPS.  I used the waypoint numbers as my station number in my field book and put them on my map.  I recorded the strike and dips into my field book as well as the UTM coordinates and the unit name that I took the reading on.  I also put the strike and dips on my map.

Within my GPX file, the strike and dip ends up in a field called "comment" and "description".  I used QGIS to convert the GPX waypoints into a point shapefile.  Then I used ArcGIS 10 to take care of the rest.

In ArcGIS 10, you can write a simple python function within field calculator to extract the strike or dip:

Pre-logic code:

def getStrike(val):
 sd = val.split(",")
 if sd[0].isalpha() == True: # in case you accidentally put a alphabetic character in your comment field
  return # return nothing. null.
  return int(sd[0]) # return first element in the list: strike.  Change data type to integer, as we get it as a string and that'll fail in a short int field.

Field calculator code:
getStrike( !comment!)

You could easily modify the above so that you can tell the function if you want a strike or dip and then return the appropriate value.  This splits "330,10" into a Python list of "330" and "10".  It then returns the first element of that list with sd[0].  Easy processing of GPS comments/descriptions into useful attribute data!

I should note that Arc 10 has a strike and dip symbol with the strike trending due north.  You no longer have to create a special expression to change your strike azimuth into a dip direction for symbol rotation.

Thursday, January 13, 2011

Initial thoughts on ArcGIS 10

I am fortunate enough to now have an educational license of ArcGIS 10, as I am taking a formal class on concepts and methods in GIS.

Overall, I like what I see.  But I am a little confused as to why ESRI removed the drop down menus for the Spatial Analyst and 3D analyst.  Is there a new reclassify raster tool?  A different way to generate a hillshade?  Or generate contours over an entire raster extent?  I found the old tools by customizing the toolbar, but their icons are an unsightly hammer that makes you think there's something better to be using... (and considering the revamp of Arc's raster infrastructure, there must be).

Update: See this help document on why Spatial Analyst toolbar changed.  Hint:  Integration.  Use the Toolbox and remember to set your Geoprocessing Environment!

Also, the editor has been completely revamped and it took me a few minutes to understand what was going on.

Output quality for JPEG (used in my class) has been improved considerably.  So too has loading speeds, in general.  Very nice.

One thing I do not like: ArcGlobe is very difficult to navigate around... especially compared to Google Earth.  But it is a great idea to make import of elevation data and draping imagery super easy.

Tuesday, January 4, 2011

Winter Quarter, 2011

I have begun class at UC Davis.  This means I will not be scripting unless there is a great reason to do so.  However, I may script calculations that are often repeated (such as equations of the Mohr Circle from last quarter).

In addition to the second part of structural geology, I'm taking another formal GIS course that focuses on concepts and methods.  It doesn't hurt to improve my formal coursework.

I am also taking Geologic Oceanography / Marine Geology.

For Structural Geology lab, I will try to use GRASS and QGIS whenever possible.  However, since I have access to a very modern GIS lab (all but Arc 10), I may just appease the folks at Redlands, CA this quarter.

But already I have a GRASS location for Rainbow Basin, and I've looked at the data using nvis.  The dataset includes 2009 NAIP imagery (Cal-Atlas), a LiDAR DEM product (OpenTopography!), and a USGS DRG (Cal-Atlas). We'll see how much use that location will get.  I hope to use r.profile this quarter and my ApparentDip script.