MB-System Unix Manual Page

mbm_arc2grd

Section: MB-System 5.0 (1)
Updated: 11 April 2017
Index
 

NAME

mbm_arc2grd - Macro to convert an ArcGIS ASCII grid to a GMT grid file in the GMT NetCDF grid format.

 

VERSION

Version 5.0

 

SYNOPSIS

mbm_arc2grd -Iarcfile -Ogrdfile [-H -Jprojection -Nnodata -Ttitle -V -Xxname -Yyname -Zzname]

 

DESCRIPTION

mbm_arc2grd is a macro to convert a ArcGIS ASCII grid to an GMT grid file in the GMT NetCDF grid format. This allows users to import the grid into GMT. If the grid is not in geographic coordinates (longitude and latitude), then the projected coordinate system must be specified using the -J option.

This macro was substantially rewritten in 2017 to use the GMT modules grdconvert and grdedit.

 

MB-SYSTEM AUTHORSHIP

David W. Caress

  Monterey Bay Aquarium Research Institute
Dale N. Chayes

  Center for Coastal and Ocean Mapping

  University of New Hampshire
Christian do Santos Ferreira

  MARUM - Center for Marine Environmental Sciences

  University of Bremen

 

OPTIONS

-H
This "help" flag cause the program to print out a description of its operation and then exit immediately.
-I
arcfile
Sets the filename of the input ArcGIS ASCII grid.
-J
projection
This option specifies the projected coordinate system used for the ArcGIS ASCII grid to be translated to a GMT netCDF grid.

ArcGIS ASCII grid files do not internally specify the coordinate system used. GMT grids also do not necessarily include information about the coordinate system. However, MB-System generates GMT grids that do have a coordinate system definition embedded in the GMT grid header remark field, and then uses that information when displaying the gridded data, either interactively with mbgrdviz or in plots or GeoTiffs generated using the plotting macros mbm_grdplot, mbm_grd3dplot, and mbm_grdtiff. By default, mbgrid and mbmosaic generate grids in Geographic coordinates, meaning that position is defined in longitude and latitude using the WGS84 geographic coordinate system. In both programs, the -J option can be used to specify an alternate, projected coordinate system (PCS). When a PCS is used, position will be defined in eastings and northings (meters) relative to the origin of the particular PCS. Universal Transverse Mercator is the most commonly used PCS in the oceanographic community, but MB-System supports a large number of other PCS's as well. The underlying projection functions derive from the PROJ.4 library originated by Gerald Evenden, then of the U.S. Geological Survey.

If the ArcGIS grid that is to be translated for use with MB-System is in geographic components, then no special arguments to mbm_arc2grd are required. However, if the grid is in a projected coordinate system, then that coordinate system must be specified with the -Jprojection option using a PCS identifier from the projection definition list provided at the end of the mbgrid manualbpage.

For instance, to fully specify a particular northern UTM zone, set projection = UTMXXN where XX gives the UTM zone (defined from 01 to 60). As an example, a northern UTM zone 12 projection can be specifiedb using -JUTM12N. Southern UTM zones are specified as UTMXXS. The European Petroleum Survey Group (EPSG) has defined a large number of PCS's used worldwide and assigned number id's to each; one can also specify the northern UTM zone 12 projection using its EPSG designation, or -Jepsg32612.

-N
nodata
ArcGIS ASCII grids use a value defined in the grid header to delineate regions with no data. By default, mbm_arc2grd translates grid values that match the nodata value in the header to NaN (not-a-number) values in the output GMT grid. This option allows the user to set a different nodata value to be used in the translation.
-O
grdfile
Sets the filename of the output GMT grid file. This file will be in the GMT COARDS NetCDF floating point format.
-T
title
This option sets the title string to be embedded in the output GMT netcdf grid file.
-X
xname
This option sets the xname string to be embedded in the output GMT netcdf grid file. This string generally provides both the common name and the relevant units of the x-axis of the grid. For geographic grids this will by default be xname = "Longitude (degrees)". For PCS grids this will typically be xname = "Easting (m)".
-Y
yname
This option sets the yname string to be embedded in the output GMT netcdf grid file. This string generally provides both the common name and the relevant units of the y-axis of the grid. For geographic grids this will by default be yname = "Latitude (degrees)". For PCS grids this will typically be yname = "Northing (m)".
-Z
zname
This option sets the zname string to be embedded in the output GMT netcdf grid file. This string generally provides both the common name and the relevant units of the z-axis of the grid. Commoon values include zname = "Topography (m)" or zname = "Bathymetry (m)".
-V
The -V option causes mbm_arc2grd to print out status messages.

 

EXAMPLES

Suppose that we have been provided two versions of a topography grid in ArcGIS ASCII format, one in geographic coordinates (PatchTopoGeoSq.asc) and another in UTM zone 10N coordinates (PatchTopoUTM.asc). We would like to be able to display both grids in mbgrdviz.

To convert the geographic grid, no special arguments are required:

    mbm_arc2grd -I PatchTopoGeoSq.asc -O PatchTopoGeoSqTr.grd -V
with the following output to the shell:

    mbm_arc2grd:
    Version: : mbm_grd2arc 2296 2017-04-01 01:48:27Z caress mbm_arc2grd
    Input Arc ASCII grid file:                 PatchTopoGeoSq.asc
    Output GMT grd (netcdf COARDS) grid file:  PatchTopoGeoSqTr.grd
    No data value:      
    Projection:         Geographic
    X name:             
    Y name:             
    Z name:             
    Title:              
    Verbose:            1
    
    Running gmt grdconvert...
    gmt grdconvert PatchTopoGeoSq.asc=ef PatchTopoGeoSqTr.grd -V
    grdconvert: Translating file PatchTopoGeoSq.asc (format ef = ESRI Arc/Info ASCII Grid Interchange format (ASCII float)) to file PatchTopoGeoSqTr.grd (format nf = GMT netCDF format (32-bit float), COARDS, CF-1.5)
    
    Running gmt grdedit on PatchTopoGeoSqTr.grd...
    gmt grdedit PatchTopoGeoSqTr.grd -V -D"Longitude [degrees]/Latitude [degrees]//1/0///__Projection: Geographic"
    grdedit: Editing parameters for grid PatchTopoGeoSqTr.grd:
    grdedit: Decode and change attributes in file PatchTopoGeoSqTr.grd
    grdedit: File PatchTopoGeoSqTr.grd updated.

To convert the UTM grid, the projection must be defined:

    mbm_arc2grd -I PatchTopoUTM.asc -O PatchTopoUTMTr.grd -JUTM10N -V
with the following output to the shell:

    mbm_arc2grd:
    Version: : mbm_grd2arc 2296 2017-04-01 01:48:27Z caress mbm_arc2grd
    Input Arc ASCII grid file:                 PatchTopoUTM.asc
    Output GMT grd (netcdf COARDS) grid file:  PatchTopoUTMTr.grd
    No data value:      
    Projection:         UTM10N
    X name:             
    Y name:             
    Z name:             
    Title:              
    Verbose:            1
    
    Running gmt grdconvert...
    gmt grdconvert PatchTopoUTM.asc=ef PatchTopoUTMTr.grd -V
    grdconvert: Translating file PatchTopoUTM.asc (format ef = ESRI Arc/Info ASCII Grid Interchange format (ASCII float)) to file PatchTopoUTMTr.grd (format nf = GMT netCDF format (32-bit float), COARDS, CF-1.5)
    
    Running gmt grdedit on PatchTopoUTMTr.grd...
    gmt grdedit PatchTopoUTMTr.grd -V -D"Longitude [degrees]/Latitude [degrees]//1/0///__Projection: UTM10N"
    grdedit: Editing parameters for grid PatchTopoUTMTr.grd:
    grdedit: Decode and change attributes in file PatchTopoUTMTr.grd
    grdedit: File PatchTopoUTMTr.grd updated.

In both cases, additional options could have been used to specify the name strings or the nodata value.

 

SEE ALSO

mbsystem(1), mbm_grd2arc(1), mbgrid(1)

 

BUGS

Before we rewrote it, maybe. Now that it has been completely rewritten, perhaps.


 

Index

NAME
VERSION
SYNOPSIS
DESCRIPTION
MB-SYSTEM AUTHORSHIP
OPTIONS
EXAMPLES
SEE ALSO
BUGS


Last Updated: 11 April 2017