Main Content

satbath

(To be removed) Read 2-minute terrain/bathymetry from Smith and Sandwell

satbath will be removed in a future release. Use readgeoraster instead. For more information, see Compatibility Considerations.

Syntax

[latgrat,longrat,z] = satbath
[latgrat,longrat,z] = satbath(scalefactor)
[latgrat,longrat,z] = satbath(scalefactor,latlim,lonlim)
[latgrat,longrat,z] = satbath(scalefactor,latlim,lonlim,gsize)

Description

[latgrat,longrat,z] = satbath reads the global topography file for the entire world (topo_8.2.img), returning every 50th point. The result is returned as a geolocated data grid. If you use a different version of the global topography file, you need to rename it to “topo_8.2.img”. If the file is not found on the MATLAB® path, a dialog opens to request the file.

[latgrat,longrat,z] = satbath(scalefactor) returns the data for the entire world, subsampled by the integer scalefactor. A scalefactor of 10 returns every 10th point. The matrix at full resolution has 6336 by 10800 points.

[latgrat,longrat,z] = satbath(scalefactor,latlim,lonlim) returns data for the specified region. The returned data extends slightly beyond the requested area. If omitted, the entire area covered by the data file is returned. The limits are two-element vectors in units of degrees, with latlim in the range [-90 90] and lonlim in the range [-180 180].

[latgrat,longrat,z] = satbath(scalefactor,latlim,lonlim,gsize) controls the size of the graticule matrices. gsize is a two-element vector containing the number of rows and columns desired. If omitted, a graticule the size of the data grid is returned.

Background

This is a global bathymetric model derived from ship soundings and satellite altimetry by W.H.F. Smith and D.T. Sandwell. The model was developed by iteratively adjusting gravity anomaly data from Geosat and ERS-1 against historical track line soundings. This technique takes advantage of the fact that gravity mirrors the large variations in the ocean floor as small variations in the height of the ocean's surface. The computational procedure uses the ship track line data to calibrate the scaling between the observed surface undulations and the inferred bathymetry. Land elevations are reduced-resolution versions of GTOPO30 data.

Examples

Read the data for the Falklands Islands (Islas Malvinas) at full resolution.

[latgrat,longrat,mat] = satbath(1,[-55 -50],[-65 -55]);
whos

  Name          Size         Bytes  Class

  latgrat     247x301       594776  double array
  longrat     247x301       594776  double array
  mat         247x301       594776  double array

Tips

Land elevations are given in meters above mean sea level. The data is stored in a Mercator projection grid. As a result, spatial resolution varies with latitude. The grid spacing is 2 minutes (about 4 kilometers) at the equator.

This data is available over the Internet, but subject to copyright. The data file is binary, and should be transferred with no line-ending conversion or byte swapping. This function carries out any byte swapping that might be required. The data requires about 133 MB uncompressed.

The data and documentation are available over the Internet via http and anonymous ftp. Download the latest version of file topo_x.2.img, where x is the version number, and rename it topo_8.w.img for compatibility with the satbath function.

satbath returns a geolocated data grid rather than a regular data grid and a referencing vector or matrix. This is because the data is in a Mercator projection, with columns evenly spaced in longitude, but with decreasing spacing for rows at higher latitudes. Referencing vectors and matrices assume that the number of cells per degrees of latitude and longitude are both constant across a data grid.

Version History

Introduced before R2006a

expand all

R2021b: Warns

Some raster reading functions that return latitude-longitude grids issue a warning that they will be removed in a future release, including satbath. Instead, use readgeoraster, which returns a map raster reference object. Reference objects have several advantages over latitude-longitude grids.

  • Unlike latitude-longitude grids, reference objects have properties that document the size of the associated raster, its limits, and the direction of its rows and columns. For more information about reference object properties, see MapCellsReference and MapPostingsReference.

  • You can manipulate the limits of rasters associated with reference objects using the mapcrop function.

  • You can manipulate the size and resolution of rasters associated with reference objects using the mapresize function.

This table shows some typical usages of satbath and how to update your code to use readgeoraster instead. Unlike satbath, which requires a single file with extension .img, the readgeoraster function requires both a data file with extension .ers and a supporting file with extension .img. When you call readgeoraster, specify the file with extension .ers.

Will Be RemovedRecommended
[latgrat,longrat,z] = satbath;
[Z,R] = readgeoraster(filename);
[latgrat,longrat,z] = satbath(scalefactor);
[Z,R] = readgeoraster(filename);
[Z,R] = georesize(Z,R,1/scalefactor);
[latgrat,longrat,z] = satbath(scalefactor,latlim,lonlim);
[Z,R] = readgeoraster(filename);
[Z,R] = geocrop(Z,R,latlim,lonlim);
[Z,R] = georesize(Z,R,1/scalefactor);

The readgeoraster function returns data using the native data type embedded in the file. Return a different data type by specifying the 'OutputType' name-value pair. For example, use [Z,R] = readgeoraster(filename,'OutputType','double').

The readgeoraster function does not automatically replace missing data with NaN values. If your data set uses large negative numbers to indicate missing data, you can replace them with NaN values using the standardizeMissing function.

[Z,R] = readgeoraster('MtWashington-ft.grd');
info = georasterinfo('MtWashington-ft.grd');
m = info.MissingDataIndicator;
Z = standardizeMissing(Z,m);