GMT: Texas Map

advertisement
Lab 9 Part 2
GMT: Texas Map
1
Open a X-window terminal
• Before you begin Part 2, create a new folder on //geobase called
Lab9_Part2
• PCs: If you need to, launch Cygwin, then in the black window, type:
startxwin.bat. Use the white “X” window that appears to type in the
remaining commands.
• Macs: If you need to, launch X11.
• Next change directories to your Lab9 folder on /geobase:
$
$
cd
cd
/cygdrive/z/yourusername/Lab9_Part2 (PCs)!
/Volumes/GEO4315/yourusername/Lab9_Part2 (Macs)!
2
Create a new GMT command file
• Use the text editor nedit to create a file named make_Texas_map.com.
To do this, type the following command in your white X-window.
! !
$
nedit make_Texas_map.com &!
• A blank, new file should open. Before you do anything else, select
File  Save to save the file to the directory you are working in (Lab9).
Do not choose Save As, and also do not re-name the file. Keep
everything as it is.
• Back in the X-window, type the following to make your file “executable”,
which will allow it to respond to the commands that you enter in it:
! !
$
chmod +x make_Texas_map.com!
• You will only need to type this command once. From this point onward,
your file is now “executable”. At this point, your file won’t do anything
3
because you haven’t included any commands.
Adding commands to your GMT file
• You will now enter all of the commands for making a map in your text file.
To add comments, just put a # sign in front of the text. Anything without a
# sign will be executed by the file.
• In the first line of your file, add a comment that describes the file, as
shown below ( # comments look like this )
• In the next line, enter the following few lines that set up some GMT
parameters:
! !
!
#!/bin/bash!
! !
!
gmtset PLOT_DEGREE_FORMAT –ddd:mm:ssF!
Sets the format of the map annotation
Add a psbasemap command
• Next you will add a command called psbasemap. This command sets up a blank
map, or a basemap, that will frame the contents of your map. With this command you
can set the map projection (-J), the range (-R), and the grid lines and title (-B), just
like you practiced with the pscoast command in previous labs.
• Enter the next text below as shown, including the comment that describes what the
psbasemap command will do.
• Note: The following page provides annotated descriptions of each of the switches
for psbasemap.
Psbasemap switches
Display portrait view
Adds a title to the map
Name of output postscript file
Run program & view map
• Now save your file (File  Save).
• To execute (run) the program, in your white X-window, simply type the name of
your file:
!
!
$
bash make_Texas_map.com
!
!
A new file named My_Texas_map.ps should appear in your directory. To check
this, list your files by typing the following in your X-window:
!
!
$
ls!
(you should see the files in your directory, including your new .ps file)
• To view the current version of your map, type:
!
!
$
gs My_Texas_map.ps &!
7
The Map…
Hopefully your map (well, actually
your basemap) looks something
like this.
8
Add a pscoast command
• Next you will add a command that you have already used, pscoast. Below are a
few new switches that have been introduced.
• Enter the text below as shown, including the comment that describes what the
pscoast command will do.
>> indicates more info is
being appended to the file
created by the previous
command
Note that the -R and -J
switches are needed, but if no
change is made from previous
command, simply enter the
letters with no additional info.
-Na draws all
boundaries
-O means overlay
the plot
Run program & view map
• Save your file, then run it, and view it with the same commands, typed into the Xwindow:
$
bash make_Texas_map.com !
$
gs
My_Texas_map.ps &!
!
Add more to pscoast
-W adds the
shoreline
boundaries
-Df sets the
resolution of the
boundaries data
to “full”
Run program & view map
• Save your file, then run it, and view it with the same commands, typed into the Xwindow:
$
bash make_Texas_map.com !
$
gs
My_Texas_map.ps &!
!
Add more to pscoast
-G adds a gray color
to the land
Run program & view map
• Save your file, then run it, and view it with the same commands, typed into the Xwindow:
$
bash make_Texas_map.com !
$
gs
My_Texas_map.ps &!
!
Add more to pscoast
-S adds a blue color
to the water bodies
Run program & view map
• Save your file, then run it, and view it with the same commands, typed into the Xwindow:
$
bash make_Texas_map.com !
$
gs
My_Texas_map.ps &!
!
Add more to pscoast
-Ia adds all rivers,
colors them blue
Run program & view map
• Save your file, then run it, and view it with the same commands, typed into the Xwindow:
$
bash make_Texas_map.com !
$
gs
My_Texas_map.ps &!
!
Add point/symbol locations
• Next you will add point symbols to your map, representing the longitude/latitude
location pairs of three cities: El Paso, Houston, and Austin.
• Below are the longitude/latitude locations of these cities, however you should
verify that these are approximately correct. Wikipedia (http://wikipedia.org) is a
good resource for getting quick geographical positions.
• To plot these points, you first need to open up a new, blank data file. In your Xwindow, type the following:
$
nedit
city_locations.dat
• Now type the following longitude
(1st column) and latitude (2nd) in your
city_locations.dat file. When you
are done, save the file and minimize
it.
&!
longitude
latitude
19
Add points using psxy command
• Enter the new text below as shown, including the comment that describes what
the psxy command will do.
psxy plots
points on
maps using
a number of
different
methods
city_locations.dat
is the points file
you just created
A star (-Sa) with a
0.3 inch diameter
is drawn
The color fill is
the star is red
(255/0/0)
The line
thickness of the
star is 1 point
(1p) and the line
is black (0)
Run program & view map
• Save your file, then run it, and view it with the same commands, typed into the Xwindow:
$
bash make_Texas_map.com !
$
gs
My_Texas_map.ps &!
!
Add city labels
• Next you will add city name labels to your map.
• Below is how a text label file should look.
• To plot these labels, you first need to open up a new, blank data file. In your Xwindow, type the following:
$
nedit
city_names.dat
&!
• Now type the following info in this file. When you are done, save the file and
minimize it.
Text to plot
This is the longitude
and latitude at which
the text will be plotted
The font size
is 14 pt.
The text will be
plotted horizontally
(0 degrees)
Font number
1 (helvetica)
will be used
The text will be placed to
the left (L) and middle 22
(M)
of the point.
Add text labels using pstext command
• Enter the new text below as shown, including the comment that describes what
the pstext command will do.
pstext plots
text labels
city_names.dat is
the text label file
you just created
The text will be
red (255/0/0)
The text will be
shifted just
slightly (0.2 in)
to the right of the
point.
Run program & view map
• Save your file, then run it, and view it with the same commands, typed into the Xwindow:
$
bash make_Texas_map.com !
$
gs
My_Texas_map.ps &!
!
Name __________________
Final Step: Turn this in
• To complete this lab, make one “feature” change to your map and describe the
command you used to complete this feature on the back of this sheet. For
example, you can change the color of the text, the land color, the water color,
change the boundaries or level of rivers plotted, etc.
• Also add one additional city or region of interest to your map. Label this with both
a symbol and a text label. Describe what you added on the back of this sheet.!
• Prepare to drop a copy of your .ps final map to the DROPBOX on //geobase.
• Feature change description
• Additional city/region of interest
Download