UTEP GEOL 5215 - Lab 7 - Introduction to GMT (Generic Mapping Tools)

Unformatted text preview:

1Introduction to GMT(Generic Mapping Tools)Notes provided by B. Konter and A. Goodliffe, UALab 712What is GMT?• A mapping tool commonly used by geophysicists formanipulating and visualizing data• Free!• Has a steep learning curve, but worth the climb …• Available from http://gmt.soest.hawaii.edu in a number of flavors• There are other programs that will do the same sort of thing,but none have the same flexibilityBuilding on your UNIX lesson, we will use GMT to create asimple topography map of California23Where does the topography datacome from?• Space Shuttle Radar Topography Mission (SRTM) data +ocean floor bathymetry• 1 Arc-second (~30 m) grids, 1-km digitized• Downloaded from http://topex.ucsd.edu/WWW_html/srtm30_plus.html and converted to a GMT format (NetCDF) grid34SRTMFrom http://spaceplace.jpl.nasa.gov/en/kids/srtm_make2.shtml•A transmit antenna illuminates theterrain with a radar beam which isscattered by the surface. Both arraysreceive the reflected signal•The signal coming to one antennamay have traveled slightly furtherthan that arriving at the other•This translates into a phasedifference•By measuring the phase differencewe can determine the angle fromwhich the signal came•When combined with travel time, wecan determine the distance to thatpoint45Getting grid (.grd) topography data• Mount the geobase/geo5215 server and navigate to the Data folder(same folder as your user directories) and copy to your desktop thefile for the western U.S. topography named:w140n40.Bathymetry.srtm.grd This file contains data from longitudes = -140W to -100W and latitudes = 40N to -10S.• ** Note: when you are done for today, make a new lab folder on/geobase in your personal Labs folder (new lab, Lab 7) and copy allof your GMT work there **.56Open a UNIX terminalPC users:• Launch Cygwin, then type: startxwin.bat• Use the white “bash” window that appears to type in the remainingcommands.• Change directories to your Desktop (cd Desktop), where your .grdfile should be. Type “ls” to make sure it is there. ____________________________________________________Mac users:• Launch X11. When the window opens, type the following: cp /Users/Shared/.tcshrc . (you need to copy the file .tcshrc) to your home directory ls -la .tcshrc (check that it is there) tcsh (launch the c-shell)source .tcshrc (this tells your computer where to find all of the GMT software)• Now Quit X11 and restart it again. Now you are ready to go.• Change directories to your Desktop (cd Desktop), where your .grdfile should be.• Also, type tcsh in your terminal window to launch the “c-shell” again67Getting info about your grid (.grd)-- grdinfo --• To figure out what the current dimensions of your .grd file are, use the‘grdinfo’ command.• In you terminal window, type:grdinfo w140n40.Bathymetry.srtm.grd• This should generate some vital statistics about the file, including themin/max of the x (longitude) y (latitude), and z (elevation) values, inaddition to the x & y increments (in degrees) and the number of x & ygrid cells: w140n40.Bathmetry.srtm.grd: x_min: -140 x_max: -100 x_inc: 0.00833333 units: user_x_unit nx: 4800w140n40.Bathmetry.srtm.grd: y_min: -10 y_max: 40 y_inc: 0.00833333 units: user_y_unit ny: 6000w140n40.Bathmetry.srtm.grd: z_min: -6031 z_max: 4228 units: user_z_unitw140n40.Bathmetry.srtm.grd: scale_factor: 1 add_offset: 078Cut you .grd file down to size-- grdcut --• Now we can manipulate the .grd file in a variety of ways. First we'll chop offsome of the data since we're just interested in plotting California topography fornow.• California is roughly defined by lat = 32.5 to 40 and long = -125 to -114. We willuse the GMT command 'grdcut' to chop this grid down to size to make a newgrid called California.grd.• Type the following: grdcut w140n40.Bathymetry.srtm.grd -GCalifornia.grd -R-125/-114/32.5/40 -V• the -R Wlong/Elong/Slat/Nlat flag specifies the boundaries that you want to keep• the -G flag specifies the name of the new grid• the -V flag means “verbose”, or “tell me what you are doing”• Check what you did by typing: grdinfo California.grdNote: If you have more than one topography data file that you need to stitch together with another (if your area of interest fallsalong an edge of the file), you can use the 'grdpaste' command to easily do this as long as the two files have one commonedge (for more info on grdpaste, type 'man grdpaste').Note: For more info on grdcut, type 'man grdcut’ or just ‘grdcut’ in your terminal window89Make a shaded illumination file-- grdgradient --To make a nice topography map, you’ll need to add some information to themap about the slope of the topography. GMT allows you to compute agradient file of the topography that you will use to "illuminate" youtopography -- essentially make it look more 3-D.• Type the following: grdgradient California.grd -A0 -GCalifornia_gradient.grd• the -A sets the azimuth angle from which to illuminate the topography (0-360 CW from North)• the -G flag specifies the name of the new grid• Just keep this file around - we’ll need it later.Note: For more info on grdgradient, type 'man grdgradient’ or just ‘grdgradient’ in your terminal window910Making a color pallet (.cpt) file-- grd2cpt --• Lastly, you need to make a color pallet (.cpt) file for you map, which willdefine the color scales to plot your topography data. You can definethese values by hand, but GMT offers a way to directly evaluate yourtopography file and use these values to make a .cpt file• Type the following: grd2cpt California.grd -Csealand -Z > California.cpt• the -C sets color table (“sealand”, in this case) that is stored in GMT’s library. Type ‘grd2cpt’ to see a list of these.• the -Z flag specifies a continuous, smooth color pallet• Note that a new .cpt file was generated --> California.cpt• Try other color tables! GMT has many available for you to use. Type‘grd2cpt’ to see a quick list. You can also open up the California.cpt fileyou made (use nedit), and edit the numbers by hand if you wish. Youcan also make fancier .cpt files with GMT’s ‘makecpt’ command.Note: For more info on grd2cpt, type 'man grd2cpt’ or just ‘grd2cpt’ in your terminal window.1011Summary So Far….grdcut w140n40.Bathymetry.srtm.grd -GCalifornia.grd -R-125/-114/32.5/40 -Vgrdinfo California.grdgrdgradient California.grd


View Full Document

UTEP GEOL 5215 - Lab 7 - Introduction to GMT (Generic Mapping Tools)

Download Lab 7 - Introduction to GMT (Generic Mapping Tools)
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lab 7 - Introduction to GMT (Generic Mapping Tools) and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab 7 - Introduction to GMT (Generic Mapping Tools) 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?