MB-System Unix Manual Page

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.0

 

SYNOPSIS

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 Observatory

 

OPTIONS

-H
This "help" flag cause the program to print out a description of its operation and then exit immediately.
-I
grdname
Sets the filename of the input GMT grid file. This file must be in the GMT NetCDF GRD format.
-N
nodata
Sets the "no data" value used in the output ASCII file. Default: nodata = -99999.
-O
arcfile
Sets the filename of the output ArcView ASCII grid.
-V
The -V option causes mbm_grd2arc to print out status messages.

 

EXAMPLES

Suppose that we have used mbgrid to obtain a topography grid file called KohalaA_bath.grd in the GMT NetCDF GRD format:
        mbgrid -Idatalist \

                -OKohalaA_bath \

                -R-155.72855/-155.31928/20.09488/20.47645 \

                -E30.0/0m! -A2 -N -G3 -C1 -V

In this case, the -E option was used to force mbgrid to use equal longitude and latitude grid cell sizes. See the mbgrid or mbmosaic manual pages for details on the usage of the -E option in those programs.

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

 

SEE ALSO

mbsystem(1), mbgrid(1), mbmosaic(1), mbm_arc2grd(1), mbm_grid(1)

 

BUGS

Maybe. Maybe not.


 

Index

NAME
VERSION
SYNOPSIS
DESCRIPTION
AUTHORSHIP
OPTIONS
EXAMPLES
SEE ALSO
BUGS


Last Updated: 3 June 2013


Return to list of MB-System manual pages...

Back to MB-System Home Page...