Terrain Corrections for Western Montana using HAMXYZ2TM and DEMs:

Get the appropriate digital topographic data:

For Montana a ready source is the state library where you can click an index map and get 30-meter Digital Elevation Data (DEM) for much of the state. These data are "cleaned up" USGS data originally on 7.5 minute quads, with elevation sampled every 30 meters. On the state library site they are stitched together into 0.5-degree sheets and zipped. Get the file or files you need. Depending on the scale of your gravity survey, the required precision, and whether or not it is on the edge of a data-sheet, you may need to download three or four of the state library’s DEMs. Our experience is that for Missoula Valley scale investigations, you should carry terrain corrections out to at least 22 km. These are pretty big files (~4meg zipped, 16 expanded; roughly 60km*40km) and they need some manipulation before you are ready to use them in HAMXYZ2 from Gradient Geophysics; HAMXYZ2 requires ASCII x,y,z files for topography.
For terrain corrections in the local Missoula area Andy Hennes and I put together some topographic data from the appropriate DEMs:

If one of these existing files suits your needs you can skip several of the following steps which explain how to compile these files and go directly to the section on HAMXYZ2.EXE.

Manipulating the State Library's DEMs with SURFER:

View the DEM:

Suppose you need to make local terrain corrections for the center of sheet D46114_a. After you have downloaded and unzipped the sheet, open SURFER then click MAP/IMAGE (or CONTOUR) and import and display the DEM to make sure it is the correct one. HAMXYZ2 needs the topographic data as ASCII x,y,z files, and you don’t need 30 meter sampling for distant topography. Thus you’ll need to merge regional, widely spaced elevation samples with 30-meter samples of nearby topography.

EXTRACT 30-meter data from a DEM for the area near your survey. How far out you need 30-meter samples and how close in you can get away with them is dependent on the needs of your particular survey. Experiment and calculate. You cannot/need-not use 30-meter data for more than a few kilometers as the files grow too fast.

Click GRID/UTILITY EXTRACT/ {select your DEM file} and set the (FIRST ROW, LAST ROW)and (FIRST COLUMN, LAST COLUMN) pairs to cut off data that is more distant then necessary; save the remaining 30-meter data in an appropriately named file, say "Local30m.GRD".

Click GRID/UTILITY/CONVERT/{select the GRD file you just made} then select file type ASCII XYZ (*.DAT) from the Save File As Type box with the same name but use extension .DAT (e.g. Local30m.DAT). With an x,y,z sample every 30 meters these files get big fast.

MAKE WIDELY SPACED SAMPLES from 30-meter DEMs for more distant topography using SURFER:

From the menu bar: GRID/SPLINE SMOOTH/select {your DEM}

Click GRID INFO and divide the x-range by 100 and the y-range by 100 to get the number of rows/columns needed for 100 meter spacings. Use the appropriate denominator for other sample spacings; you may want to use 250 meter spacings for the most distant (say greater than 15 kilometer) elevation samples.

Click RECALC GRID and provide the previously determined quotients as the new values in the FINAL GRID SIZE box, specify an OUTPUT GRID (e.g. 100.grd) with a suitable name, click OK.

BLANK the widely spaced grid values for the area in which you have more closely spaced data:

Click MAP/ IMAGE(or CONTOUR)/{e.g. 100.grd } to make a map or image of the region for which you saved 100-meter data.

Click MAP/ IMAGE(or CONTOUR)/{your 30-meter data grid} to make a map or image of the region for which you saved 30-meter data (e.g., Local30m.GRD).

EDIT/SELECT-ALL followed by MAPS/OVERLAY-MAPS will overlay these two maps; if the smaller is not visible you’ll have to go to MAPS/EDIT OVERLAYS/move to front (appropriate map) to make it visible as it is behind the first image.

Click MAP/DIGITIZE then sequentially click the four corners of the area of the 30-meter data, stay in the digitize-edit window (which popped up) and add an initial line: 4, 1 so you file has "4, 1" as the first row, then four rows of x,y coordinates for the corners. The "4" tells SURFER that you have four data points, the "1" tells it to blank the area inside the four corners. Save the file as LOCAL30M.BLN (or whatever but use the .BLN extension); close the digitize file and turn off (click MAP/DIGITIZE again) the digitize option.

Click GRID/BLANK the select your 100-meter data file, your BLN file, and specify an output file (e.g. 100_Blnk.grd). SURFER writes huge (1.70141E+38) values to the blanked areas.

Click GRID/UTILITY/CONVERT/{select the file you just made} and select file type ASCII XYZ (*.DAT) from the Save File As Type box. For the output file use the same name and extension .DAT (e.g. 100_Blnk.dat).

MERGE the 100-meter and 30-meter data using SURFER's worksheet:

WORKSHEET/OPEN{your file; 100_Blnk.dat}, and WORKSHEET reads and displays your file.

SORT on column C - descending; and you’ll see the values SURFER writes for blanked areas: 1.70141E+38

HIGHLIGHT the rows with blanked values (1.70141E+38s) the select EDIT/DELETE to get rid of them.

SORT the whole, merged data set to put it back in COLUMN-ROW order SORT (primary=B-ascending; secondary=A-ascending)

FILE/SAVE the merged data (e.g. Topo_XYZ.dat); it must be SPACE DELIMITED for HAMXYZ2.

HAMXYZ2.EXE does the terrain corrections on a file of points you supply. You need to go through a few steps and setup a couple different files to get it to work. If you have 30 meter data you'll have to estimate/measure elevations for the inner zones if you require very high precision; you can figure it out using HAMXYZ2's output.

HAMMER.CON is a required ASCII control file, it looks like this: (OMIT the comments on the right!!)

c:\dir\grav\hammer\ Topo_XYZ.dat

M M M
2.67
M
12
4 2 17
6 53
6 170
8 390
8 895
12 1529
12 2614
12 4469
16 6652
16 9902
16 14741
16 21943

path - filename (e.g.,) for the topo data

units for x, y, z; M is meters, F, feet
density of the terrain
unit of the zones and sectors
number of zones
sectors/zone, inner radius of zone, outer radius of zone
sectors/zone, outer radius of zone
sectors/zone, outer radius of zone
sectors/zone, outer radius of zone

etc.


all these are original HAMMER parameters in meters

YOURGRAV.DAT is the file (any name) containing the points for which you want terrain corrections based on your elevations (Topo_XYZ.dat) and your control parameters (HAMMER.CON). It must be ASCII and Space-Delimited; call it something like (My_pts.dat) and make it look like:

n
x1 y1 z1 Snum1
x2 y2 z2 Snum2
... ...
xn yn zn

integer number of x,y,z points to correct
x-coord, y-coord, elevation, STATION NUMBER!
STATION NUMBERs Required; HAMXYZ2 loses X, Y! ...
etc.
Snum(n) until you’ve listed all the stations.

RUN HAMXYZ2 from a DOS command line like this:

C:>HAMXYZ2 My_pts.dat My_pts.OUT > My_Pts.DMP

My_pts.dat is the file with the points you want corrected.

My_pts.OUT is a file that HAMXYZ2 will write; it lists the wrong location for the points (it writes the same X, Y for each point) followed by the terrain correction and the Station Number. You’ll have to combine My_pts.OUT with your original file (use ExCell or any other spreadsheet) to get the terrain correction associated with the correct X and Y position.

My_pts.DMP is a file that will show each station location, the terrain correction, the average elevation for each sector (good to make sure you’re actually giving it data), and the contribution to the total terrain correction for each sector.

RECOMMENDATIONS:

Run HAMXYZ2on a file of two points using a small file of terrain values before handing it a file of 93 points with megabytes of terrain data. This way you can be sure you have everything set up correctly without having to wait for tens of minutes. You give HAMXYZ2 bad files and it can hum away forever doing nothing - there's not much error catching going on in HAMXYZ2.

Experiment with HAMMER.CON on a few selected gravity stations to see how far out you need to include terrain for the required precision of your survey. Consider the two most separated points in your survey. When you are doing the terrain corrections, you want to go far enough away from the stations so that the difference in effects at the station from even more distant topgraphy is zero. For example, if you were to include topograhy out to 20 km and found the difference in terrain correction for the two points was 0.25 mgal and then you included terrain to 22 km and found the difference in terrain corrections was 0.2499 mgal you would probably decide that a terrain-correction driven gradient of (0.25 - 0.2499) over the width of your survey was insignificant. International/geodetic standards for distance are 166.67 kilometers but this is not necessary for local surveys unless you intend to contribute data to the Defense Mapping Agency database.

If you need high-precision terrain corrections, 30-meter DEMs may not be good enough. You may want to estimate or measure average terrain values for the inner zones while you are in the field collecting your data. This is particularly true if you are looking for relatively small anomalies near immediate relief. Experiment and model to figure out your needs.

Use SURFER to compare a map/image of your terrain corrections with a topographic map/image for your area - think about it.