MB-System Unix Manual Page


Section: MB-System 5.0 (1)
Updated: 28 November 2018


mbgrdtiff - GMT plug-in module for generating a geographically located GeoTIFF image from a GMT grid file.



Version 5.0



gmt mbgrdtiff -Ccptfile -Igrdfile -Otiff_file [-H -Kintensfile -Nnudge_x/nudge_y -V -W]



mbgrdtiff is a plug-in module to generate a Geographically located GeoTiff image from a GMT grid file using GMT (Generic Mapping Tools). Like mbcontour and mbswath, mbgrdtiff is fully compatible with the GMT package version 5. A GeoTIFF image file includes location, projection and scaling information. The image generation used by mbgrdtiff is identical to that of the Postscript-producing GMT program grdimage. In particular, the color map is applied from a GMT CPT file, and shading overlay grids may be applied. The image is 8 bits per pixel if the color map is a grayscale, and 24 bits per pixel otherwise. In order to automatically generate a reasonable image of a grid, use the macro mbm_grdtiff. The program mbgrdtiff recognizes the coordinate system used by mbgrid or mbmosaic to generate a grid file, and then embeds the projection and grid bounds information into the TIFF image in accordance with the GeoTIFF standard. A number of GIS software packages recognize the georeferencing information in GeoTIFF images. In particular, images generated by mbgrdtiff from grids created using mbgrid or mbmosaic can be loaded into the GRASS, ArcInfo, ArcView, and ArcGIS GIS packages as geographically located coverages. The mbgrid and mbmosaic manual pages each contain an appendix with a complete list of the projected coordinate systems that may used in grid generation. Some software packages (e.g. Winfrog) do not recognize the embedded coordinate system information, and install require a parallel "world" file to specify the bounds and resolution. The -W option causes a world file to be generated with a ".tfw" suffix.

In order for GMT to successfully execute mbgrdtiff, the location of the shared library libmbgmt containing this module must be known to GMT. This can be accomplished by either setting the GMT_CUSTOM_LIBS parameter in the file gmt.conf that is part of the GMT installation, by setting this parameter in the file gmt.conf in the user's home directory, or by using the GMT module gmtset to modify this parameter in the current working directory. If, for instance, the libmbgmt shared library has been installed in the file /usr/lib/libmbgmt.dylib, then the GMT_CUSTOM_LIBS parameter in a gmt.conf file can be set to:
        GMT_CUSTOM_LIBS = /usr/lib/libmbgmt.dylib



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



Sets the color palette (CPT) file which controls the color of the plot. See documentation of the GMT package for a complete description of cpt files. If the R, G, and B values in the CPT file are all equal for each data level (i.e. R=G=B), the the output TIFF image will be 8 bits per pixel. Otherwise, the output TIFF image will be 24 bits per pixel.
This "help" flag cause the program to print out a description of its operation and then exit immediately.
The first invocation of the -Igrdfile option sets the name of the gridded data file to be plotted. The data must be in a form acceptable to GMT version 3 programs (see the GMT Cookbook & Technical Reference).
The second invocation of the -Igrdfile option sets the name of a gridded data file containing intensity values to be used for shading the map. Alternatively, grdfile may be a list of grid files (one filename on each line) to be used together. If a list of files is supplied, the intensity files must conform in order to the list of data grid files they will shade.
nudge_x/nudge_y Specifies positional offset in meters of the output geotiff image relative to the input grid or mosaic.
Sets the root used to construct the filename of the output shellscript (root.cmd) and names of files created when the shellscript is run. Normally the name of the input grid file or grid file list is used as the root.
Selects verbose mode [Default runs "silently"].
The -W option causes a "world" file to be generated parallel to the GeoTiff image with a ".tfw" suffix. Some software packages (e.g. Winfrog) do not recognize the coordinate information embedded in the GeoTiff file, and look for a world file.


Suppose we have obtained two GRD files called PunaA_bath.grd and PunaA_ss.grd, both with dimensions 1162 x 1068. The file PunaA_bath.grd contains seafloor topography (depth values are negative, ranging from -5035 m to -1619 m), and the file PunaA_ss.grd contains a sidescan mosaic (reflectivity values ranging from 0 to 128 dB). In order to generate a 24 bit color TIFF image of the seafloor topography, we use:

        gmt mbgrdtiff -I PunaA_bath.grd                 -O PunaA_bath.tif               -C bath.cpt -V

where the color is controlled by a GMT cpt file bath.cpt containing:

        -5250  37  57 175 -4875  40 127 251

        -4875  40 127 251 -4500  50 190 255

        -4500  50 190 255 -4125 106 235 255

        -4125 106 235 255 -3750 138 236 174

        -3750 138 236 174 -3375 205 255 162

        -3375 205 255 162 -3000 240 236 121

        -3000 240 236 121 -2625 255 189  87

        -2625 255 189  87 -2250 255 161  68

        -2250 255 161  68 -1875 255 186 133

        -1875 255 186 133 -1500 255 255 255

In order to generate an 8 bit grayscale TIFF image of the sidescan mosaic, we use:

        gmt mbgrdtiff -I PunaA_ss.grd           -O PunaA_ss.tif                 -C ss.cpt -V

where the grayscale is controlled by a GMT cpt file ss.cpt containing:

         0.00   0   0   0   16.50  26  26  26

        16.50  26  26  26   22.87  51  51  51

        22.87  51  51  51   27.00  77  77  77

        27.00  77  77  77   30.00 102 102 102

        30.00 102 102 102   32.25 128 128 128

        32.25 128 128 128   34.25 153 153 153

        34.25 153 153 153   36.25 179 179 179

        36.25 179 179 179   38.50 204 204 204

        38.50 204 204 204   41.23 230 230 230

        41.23 230 230 230  128.00 255 255 255

Here greater reflectivity amplitudes are represented by light grayscales.



mbsystem(1), mbm_grdplot(1), mbgrid(1), mbmosaic(1), mbm_grid(1), mbm_grdtiff(1), gmt(1), grdimage(1)



Let us know.




Last Updated: 28 November 2018