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

No comments:

Post a Comment