mbm_grd2arc
Section: MB-System 5.0 (1)
Updated: 3 June 2013
Index
NAME
mbm_grd2arc - Macro to convert a GMT grid file in the GMT NetCDF grid format to an ArcView ASCII grid.VERSION
Version 5.0SYNOPSIS
mbm_grd2arc -Igrdfile -Oarcfile [-H -Nnodata -V]DESCRIPTION
mbm_grd2arc is a macro to convert a GMT grid file in the GMT NetCDF grid format to an ArcView ASCII grid. This allows users to import the grid into Arc/Info and ArcView. The grids must have the same grid interval in both longitude and latitude. If the grid was created using mbgrid or mbmosaic, the -E option must have been used in that program to set the grid cell sizes equal (see the mbgrid and mbmosaic manual pages).
The macro first obtains the bounds, dimensions, and grid cell size of the grid using the GMT program grdinfo. The grid dimensions, the lower left position, and the grid cell size are written to the header of the output ArcView ASCII grid file. The macro then uses the GMT program grd2xyz to dump each of the grid values to a temporary ASCII file. This temporary file is read and parsed one value at a time. Any NaN values are replaced by the nodata value specified with the -N option. Each final value is printed to the output file.AUTHORSHIP
David W. Caress (caress@mbari.org)
Monterey Bay Aquarium Research Institute
Dale N. Chayes (dale@ldeo.columbia.edu)
Lamont-Doherty Earth ObservatoryOPTIONS
In order to convert KohalaA_bath.grd to an ArcView ASCII grid
so that the data can be imported into the Arc/Info or ArcView
GIS packages, we use the mbm_grd2arc macro:
mbm_grd2arc -IKohalaA_bath.grd \
-OKohalaA_bath.asc -V
Running the example above produced the following output:
Program mbm_grd2arc status:
Input GRD file: KohalaA_bath.grd
Output ArcView ASCII file: KohalaA_bath.asc
Grid dimensions: 1426 1329
Grid cell sizes: 0.0002871995719 0.0002871995719
Grid bounds: -155.72855 -155.3192906 20.09488 20.47628103
Generating temporary file...
Parsing temporary file...
10% complete
20% complete
30% complete
40% complete
50% complete
60% complete
70% complete
80% complete
90% complete
100% complete
Last Updated: 3 June 2013