Tuesday, July 7, 2015

Profiling MOLA / LOLA Shots (part 2)

Based on the previous post 1, I was pointed to a couple abstracts where the profile was plotted on the feature. See a figure from either abstract below.

abstract 1: http://mars.jpl.nasa.gov/mgs/sci/fifthconf99/6163.pdf or my ancient abstract.

I had created an old ArcView 3.x avenue script to convert a point to side profile line on the map but I didn't want to necessarily rewrite that script in ArcMap, QGIS or OGR. So here is a simple trick which should also work (perhaps with a little parameter tweaking).

1.) Get your MOLA / LOLA shapefile (see part 1).

2.) Like part 1, select a single orbit and now export to a new shapefile (right click on layer, data export...).

3.) Open the table for new shapefile and calculate statistics for "PtTopo", write that number down. For my orbit, it is -1380.45



4.) Start editing the exported track (so you can undo it if it doesn't work).

5.) In the table, right click on "Shape" field and select "Field Calculator...", Change the language to Python at the top and select "show code block".

6.) In the code block copy this code:
def shiftXCoordinateWithZ(shape, ptTopo, xScale, meanTopo):
    point = shape.getPart(0)
    centeredZ = ptTopo - meanTopo
    point.X += centeredZ * xScale
    return point

In the next area, which should be below "shape =" paste this and edit the values for Xscale and meanTopo. XScale worked for LOLA but depending on your topographic range you may beed to adjust this value.
shiftXCoordinateWithZ(!SHAPE!, !PtTopo!, 0.0002, -1380.5 )



7.) If the updated points makes for a good profile, save edits. If not, then stop editing and don't save edits. Start editing again and try to adjust the "xScale" (the second number in the function call). This value applies an exaggeration across the X (or longitude). A higher number will exaggerate more. The "meanTopo" values tries to center the points along the original line.

8.) If you like the profile size but want to show these points as a line, use the tool Points to Line to convert the points to a profile like. You can also smooth the line for a cleaner looking profile.



-Trent

Profiling MOLA / LOLA Shots (part 1)

When MOLA was first released as PDERs (shot data), creating profiles in a GIS over surficial features was a little bit of a challenge. You had to download 20GB of the original shot "PEDR" data and then run the pedr2tab tool to generate an exported table. Edit the table to make it a recognized table format, load into ArcView 3.x, assign a Mars radius, and finally convert to a GIS shapefile. Many scripts were written to convert these tables to shapefiles for programs like ArcView 3.x, ENVI, and eventually GDAL's ogr2ogr. It is now as easy as visiting a PDS website to get the shot data. The GeoScience Node has a service to skip all these steps and go directly to a shapefile (or a shapefileZ - where each point has a geometry with X, Y, and Z).


With more than 600 million shots for Mars you will need to only request a region. I think they have a soft limit of about 6 million shots but it is better to obviously keep it smaller than that. For LOLA, the Team will probably reach a 8 billion shots by the end of the mission!

Huh? Why not just profile over the available MOLA and LOLA digital elevation models (DEMS)? Of course that is a very suitable and recommended method and can be done in many applications like ArcMap, JMars, ENVI, QGIS, Saga GIS, Mirone, GRASS, Matlab. Soon we are releasing a new geodesic DEM profiling tool for ArcMap which can also help with geologic cross-section generation. But this means you are profiling over filled or interpolated data where shots were not originally available. Sometimes profiling over the shots still makes sense.

Anyway, once you get the shot data from the PDS as GIS shapefiles or simply a table, profiling the data can be as easy as selecting one orbit in a GIS or even Excel and plotting the "PtLat" Latitude field versus the "PtTopo" elevation height field (for LOLA). Note that mixing latitude (in degrees) against elevation in meters sounds odd but it is a good proxy since the orbit of the instruments is/was polar. Ideally both axes being in meters would be best.



In ArcMap or other GIS, simply load your shapefile shots (via "add Data"). Query for a single orbit you want to profile. Now use the select by attribute to select that orbit and in the case of LOLA you should choose a single Shot Number (left). You really only want to profile over one orbit per graph. Now create a graph using the type "vertical line" or scatter. Set the Y axis as "PtTopo" and X axis as "PtLat" (right). In the graph wizard, hit "Next" and select the option "Show only selected features on the graph." (below). 


You can now finish the plot or continue to customize the chart's title or options. Note my example plot is garishly colorized since I symbolized the original shots in ArcMap. This is handy but adding the legend isn't very helpful on the chart so I turned it off. You can steal the legend from the table of contents for figures if you need to. To export this chart, you can right click on it and export to various graphic formats or PDF. 


Tip: Select a different orbit and the graph should update too. Select features in the graph and they should highlight on the map.

Tips: one of the benefits of a shapefileZ is the ability to also profile the whole lot in ArcScene or other capable 3D viewer. You can plot the non-Z shapefiles too by just selecting the "PtTopo" field as the height source.


Continue to part 2.

-Trent