I. Obtaining
and Visualizing Topography
Where
can I obtain topography data?
This
new global dataset, provide by SIO's very own JJ
Becker and David
Sandwell, is a
good place to start. Detailed information
about the dataset is provided at the above link. In short,
this dataset combines the land topography from NASA's SRTM with Smith
and Sandwell ocean topography data and uses GTOPO30 data for high
latitudes. Resolution of this data is roughly 1 kilometer
(or 30 arc seconds).
To acces this data, click on the above link,
then click on the link "FTP SRTM30_PLUS". This will mount an ftp
site on your desktop where you can access the data.
-
README.txt file: contains a ton of useful information about the data
and how to prepare it for a useful application.
-
DATA directory: contains gzipped files of binary topography data.
Naming convention (see README.txt in this folder) is as follows:
e020n40 is a
region with the northwest corner at 20E 40N, and is implicitly 40
degress wide and 50 degrees tall. The antarctic data
sets are 60 wide and 30 tall.
-
GRD directory: contains bin2grd script for converting binary data into
grd-netcdf format. Also contains make-all.com, an example script
showing usage of bin2grd command (very
useful!).
Note that other topography data
sets exist, some with much higher resolution, although without complete
global coverage:
NASA's SRTM dataset
README .txt file for xyz2grd conversion
How do I get
topography data into a usable format?
To
begin, drag bin2grd and make-all.com (grd directory) to a working space
on your computer. Next, drag the topography data file (data
directory) of your region of interest to your computer. If
you need more than one of these files, drag all necessary.
As
an example, lets use California as our study region and grab file
w140n40.Bathmetry.srtm.gz from the ftp site.
First
we want to decompress the data:
% gunzip w140n40.Bathmetry.srtm.gz
Next
we need to convert the data from 16 bit binary to a grd-netcdf
file. To do this, we can cheat by inspecting the
commands in the make-all.com file and running the one appropriate for
our data file:
% bin2grd w140n40.Bathmetry.srtm -140 -100 -10 40
Note
that bin2grd contains the GMT command xyz2grd, a command commanly used
to convert an xyz data file to a grd file. For more
information on xyz2grd, type 'man xyz2grd' and 'more bin2grd'.
You
should now have a file called w140n40.Bathmetry.srtm.grd. Now we
can manipulate the grd file in a variety of ways. First
we'll chop off some of the data since we're just interested in
California
topography. To figure out what the current dimensions of
the file are, type:
% grdinfo w140n40.Bathmetry.srtm.grd
This
should give some vital statistics about the file, including the min/max
of the x,y, and z values, in addition to the x,y increments and the
number of x,y grid cells:
w140n40.Bathmetry.srtm.grd: x_min: -140 x_max: -100 x_inc: 0.00833333
units: user_x_unit nx: 4800
w140n40.Bathmetry.srtm.grd: y_min: -10 y_max: 40
y_inc: 0.00833333 units: user_y_unit ny: 6000
w140n40.Bathmetry.srtm.grd: z_min: -6031 z_max: 4228
units: user_z_unit
w140n40.Bathmetry.srtm.grd: scale_factor: 1
add_offset: 0
California
is roughly defined by lat = 32.5 - 40 and long = -125 -
-114. We will use the GMT command 'grdcut' to chop this
grid down to size to make a new grid called California.grd.
(for more info on grdcut, type 'man grdcut'):
% grdcut w140n40.Bathmetry.srtm.grd -GCalifornia.grd
-R-125/-114/32.5/40
Note: if you have more than
one topography data file that you need to merge together, you can use
the 'grdpaste' command to easily do this as long as the two files have
one comman edge (for more info on grdpaste, type 'man grdpaste').
How
do I use topography to create 3D scenes?
Now we
are ready to import this California.grd into Dmagic, part of the
Fledermaus package. Dmagic can be found under Applications/IVS
Fledermaus/. Open up the application and start a new
project:
-->
Project --> New Project (give
location of working space on your computer)
Next
we will import the topography data:
-->
File --> Import Surface
(select the location where you have stored California.grd)
-->
File type: GMT GRD / NETCDF
--> Scan for information
(check
information for consistency with grdinfo command)
-->
Surface interpretation: Output a DTM (.dtm)
--> Convert & Save
(name the
.dtm file)
You
now should have two files appear under Data Components: name.dtm
& name.geo. To view these files, highlight the .dtm file and
click on the '>'
button on the right side of the Data Component panel.
More
than likely, the colorbar values will not correspond to the z-values of
your grd file. To fix this, click on Color Map
Editor:
-->
Hight Dependent CMap
-->
Max (enter max z-value)
--> Min (enter
min z-value)
-->
Resample
--> Okay
To
refresh, click on '>>' .
To
use an alternative colormap, click on CMap
Librarian (located
under the colorbar). For this example, we'll choose gmtglobe_d.cmap.
Next, we shade. Click on
Surface Shader. Play
with the direction and magnitude of shading in the Shadow Direction panel. Click on Start Rendering to preview shade and Save Shade to
finish. Close.
Almost
done. The last step is to click on Assemble Fledermaus
Objects. Defaults should be fine. Note that
the final
object file will be called name.sd. Click on Build Object. Close.
Now
we will run Fledermaus. Click on Run
Fledermaus for a
shortcut to the application. Use the widgets and scroll bars to
manipulate the view of your newly created scene.
To save your scene:
--> File -->
Save Scene
An example:
How do I add points and lines to the scene?
Adding
lines or points to your Fledermaus scene can be done from the command
line. You need a file containing x,y pairs of points. Click here to
obtain an example of a list of points representing the San Andreas
Fault (saf.xy). Make sure that your own file contains a 9999
9999 marker on the last line. The following command can be used
to transform these points into a line file readable by Fledermaus (an
.sd file):
% cmdop mklines -in saf.xy -out saf.sd
Now
we will add this fault file to the topography scene in Fledermaus:
--> File --> Open Data Object
--> saf.sd
Make
sure that cafaults.sd is highlighted in the lower left box and click on Drape Lines
under
Line Height Controls.
You can also adjust the line size and color
in the Line Display Options
box.
Next
we'll convert a file containing GPS station locations (gps.xy)
into an .sd file and add these to the topography scene:
%
cmdop mkpoint3d -in gps.xy -out gps.sd
Now
we will add this gps station location file to the topography scene in
Fledermaus:
--> File --> Open Data Object
--> gps.sd
Click on Drape Points to drap these x,y points over the
topography. Adjust the size of the points with Point Radius, the shape with Marker Type, and the color with By Color.
To save your scene:
--> File -->
Save Scene
Another
example:
How
can I drape a scalar grid over topography?
Suppose
that you have a topography grd (topo.grd) file
containing elevation information for the 'z' component. In
addition, suppose that you have a companion grd file containing
some scalar "data" for the 'z' component that you want to display (ie.,
displacement). To colorcode the topography according to this new
dataset (displacement.grd),
repeat the steps described above for importing topography and the
following additional steps for importing the scalar data:
-->
File --> Import Surface (select
the location where you have stored displacement.grd)
-->
File type: GMT GRD / NETCDF
--> Scan for information
(check
information for consistency with grdinfo command)
-->
Surface interpretation: Output a Scaler (.scaler)
--> Convert & Save
(name the .scaler file)
To
shade, click
on Surface Shader. Under
Selected Components, click on Overlay Scaler. Play with the direction and
magnitude of shading in the Shadow
Direction panel.
Click on Start Rendering to preview shade and Save Shade to
finish. Close..
Repeat Assemble Fledermaus
step and launch Fledermaus.
Often times exaggeration for the new .sd scaler draped file will need
to be adjusted. In the Exag.
box, change to 0.01
and hit return.
An example of horizontal
displacement due to the 1906 San Francisco earthquake, drapped over
topography:
How do I create a movie scene file?
To create a movie, you need to use
both Fledermaus and the Fledermaus MovieClient application, which is
part of the Fledermaus suite, but a separate executable.
For more info, also check out the Viz Center online
tutorial.
First you'll need to save your Fledermaus creation (collection of .sd
files) into a .scene file.
--> File -->
Save Scene
Next you'll need to create a flight path in Fledermaus using your scene
and the widget control:
--> Controls -->
Movie
Controls.... --> Record
After clicking on the Record
button, use the widget and scroll bars to visualize your scene.
Click Stop when
complete. Then save the flightpath:
--> File --> Save
Flightpath
Next launch Fledermaus MovieClient (/Applications/IVS
Fledermaus/Movieclient) and choose the scene and the flight path that
you want to display. Click OK
(you don't have to smooth, it gives you funny results, even makes the
flight jerkier), then select the Movie
Format, and change Frame
Size
if necessary, otherwise the default values work just fine. You can choose either mpeg or
image sequence for your movie. Choosing image frames will
generate a series of frames that you can assemble in Adobe's
ImageReady and edit as needed.
II. Assembling
Quicktime Movies
Stand-alone
Quicktime movies can easily be made from a series of image files
(ie. jpg, tiff, ps) and the Adobe Photoshop application
ImageReady.