Program: MKEARTH
mkearth...............make very impressive 3D plot of globe
call: mkearth;
mkearth('defaults');
mkearth('demo1');
mkearth('demo2');
mkearth('help');
h=mkearth(lon,lat,hgt);
h=mkearth(PropertyName,PropertyValue,...);
without arguments: demo1 plot
one argument version: return default settings of all globe
properties or print help file or run
one of the demos.
three arguments version: lon: center longitude [deg]
lat: center latitude [deg]
hgt: camera height above LON/LAT [km]
The three argument mode is a simlple way
to define Camera and Target positions (see
below): camera is at height HGT above Target
many arguments version: Allows to define many plot properties,
see below for explanation
results: none
Globe Properties:
If you wish to customize your plot, enter pairs of PropertyNames and Property-
Values like for MatLab handle graphic objects. The following table lists
all Properties and what they are good for. Some properties are defined by
scalars, some are vectors, some are strings. To find out the default values,
call MKEARTH without argument 'defaults'.
String Properties are NOT case sensitive.
Property names are NOT case sensitive.
To make you able to edit created objects afterwards, any created surface will
contain a specific string in the UserData field of its objects description.
Use FINDOBJ to find objects created by MKEARTH. The specific strings identifying
different types of surfaces are given below.
Mode 'string' used to distinguish several modes. Available are:
'help': print help file
'default': return default values of all Properties
'demo1': run demo 1
'demo2': run demo 2
'regular': use given (or default) parameters to
plot the globe
For obvious reasons, the routine will return
'default' as default mode, although 'regular' is
the default mode!
call mkearth('mode','regular'); to see the result
of default settings.
If you enter a 'resolution', it will be transported
into the demo mode, allowing to run it with high
resolution data sets.
Target [lon lat] Camera target on globe: defines the geographical
location of the point in view
will be transformed into xyz-coordinates and
passed to the axes-object's CameraTarget
LON and LAT are in degrees
By default, this will be set to be directly
on the earth's surface at longitue and latitude of
the camera.
Camera [lon lat hgt] Camera position above globe
will be transformed into xyz-coordinates and
passed to the axes object's CameraPosition
LON and LAT in DEGREES, HGT in km
LightPos [dlon dlat] relative light position
a light object will be created at position
[lon+dlon lat+dlat hgt]
DLON and DLAT are in degrees
Flame 'string' switch light on or don't
'on': a light object will be generated
'off': do no generate light object
it is recommended to set this to 'off' from the
second of several subsequent calls to MKEARTH on
to avoid generating many light sources.
Stuff 'string' choose material properties for earth surface
available are 'dull', 'shiny', 'metal' (see
MatLab's MATERIAL for description)
Resolution 'string' Elevation model resolution
'preview': use the topo-variable shipped with
MatLab (what you get by 'load topo')
'none': do not plot any topography
pathname: path to a .mat-file containing a vari-
able named 'topo' which contains the
elevation model in the same format as
the topo dataset shipped with MatLab
may also contain arrays TOPOLON and
TOPOLAT describing the longitudes and
latitudes of all points in a way that
surf(topolon,topolat,topo) plots a map.
If TOPOLON and TOPOLAT are not given in
the file, they will be generated.
(MKEARTH loads the file using LOAD(),
so you may omit the .mat-suffix or
give a path to an ASCII file.)
Exaggeration xagg vertical exaggeration of topography
is set to 1 if 'resolution' is 'none'
PlotArea [swlon swlat nelon nelat]
Area to plot, defined as rectangle from upper
left corner (northwest, nw) to lower right (south-
east, se) corner
It is currently not possible to cut out areas that
are crossed by the greenwich meridian.
AreaMode string area plot mode
'positive': plot topography inside PlotArea
'negative': plot topography outside PlotArea
'nocut': do not cut out any parts of the surface
MinAltitude minalt areas with altitude below MINALT will not be
plotted
MaxAltitude maxalt areas with altitude above MAXALT will not be
plotted
RadialLift rlift Add RLIFT km to topography in PlotArea to show
earth's interior, in km
XYZShift [dx dy dz] shift anything by DX,DY,DZ km
ColorResolution colres change topography color any COLRES meters
WireFrame depth plot wire frame from PlotArea topography (plus
RadialLift and XYZShift)
if empty: do not plot wire frame
else: downto DEPTH km, measured from the current
EarthRadius
-1: plot wire frame of thickness equal to
RadialLift
Walls depth plot massive walls from PlotArea topography (plus
RadialLift and XYZShift)
if empty: do not plot walls
else: downto DEPTH km, measured from the current
EarthRdaius
-1: plot walls to depth equal to RadialLift
WallSize [rad lonlat] size of matrices used to draw walls
a matrix of size lonlat-by-rad elements will
be used to draw vertical walls (independent of
their angular or vertical real-world-size)
EarthRadius re Earth's Radius, in km
changing this is not really the same as changing
the exaggeration: the latter does not affect the
size of the coordinate range.
depths defined elsewhere (e.g. for walls) will
be relative to this radius.
Coordinates [minlon maxlon minlat maxlat]
coordinate range covered by topography data
allows to use topo-files that conatain neither
the whole earth nor separate lon and lat arrays.
allows to stretch and quench topographies.
CoordMode 'string' defines which coordinates to use
'manual': use coordinate range given in
COORDINATES
'auto': use COORDINATES only if data file
did not contain lon and lat arrays
will automatically be set to 'manual' if COORDI-
NATES ared defined in the input.
Discontinuities [d1 d2 ... dn] depths of discontinuities insides earth
(given as radius in km) to be considered
when plotting walls in cross sections
Walls will be defined at some depths given
by a linspace call and at these discontinuities.
UserData strings used to designate created graphic objects:
'MKEARTH/topo' - topography surface
'MKEARTH/colorfix' - surface used to fix colors to a certain range
'MKEARTH/sphere' - spheres drawn with resolution 'none'
'MKEARTH/wall/W' - western wall of drawn plot area's walls
'MKEARTH/wall/E' - eastern wall of drawn plot area's walls
'MKEARTH/wall/S' - southern wall of drawn plot area's walls
'MKEARTH/wall/N' - northern wall of drawn plot area's walls
This is a standalone-program: all you need to run it is the mkearth.m file and
MatLab in Version 5 or higher (the program makes use of laguage constructions
that were not available in earlier versions). The program does not make any
assumptions on your platform (except the existence of color graphics) and
should run on any platform for which MatLab is available.
The routine plots into the current figure using HOLD ON, so be sure to apply
clf if you don't want to mix it up with other plots!
Martin Knapmeyer, 07.01.2000, 18.02.2000, 03.03.2000, 16./17.03.2000, 26.03.2000
27.03.2000, 29.03.2000, 19.04.2000, 19.06.2002
Read M-File Source Code
eof.