NCL Home > Documentation > Tools

ncl_filedump

ncl_filedump generates an ASCII representation of a specified file (netCDF, GRIB1, GRIB2, HDF4, HDF-EOS2, HDF-EOS5, and/or shapefile format) on the standard output.

Synopsis

   ncl_filedump [-c] [-v var1[,...]] [-sed sed1[,...] [-itime] [-ftime] [-tps] [-h] input-file

Description

ncl_filedump generates an ASCII representation of a specified file on the standard output. The input file may be any file type supported by NCL via the addfile() function. The default output is to the standard output. However, it may be redirected to a file or piped to UNIX utilites such as less or more via the UNIX operators > and |, respectively. The form of the output is similar to that produced by ncdump -h.

Support was added for HDF-EOS5 in version 5.2.0.

Beta test support was added for shapefiles in version 5.1.1. The NCL binaries for AIX, Cygwin, and Sun systems may not have shapefile support available.

Support was added for GRIB2 files in version 4.3.0.

Support for "-itime" and "-ftime" was added in version 4.3.1.

Support for the "-sed" option was added in version 5.1.0.

Options

ncl_filedump accepts the following options:

-c
Output coordinate variable (variables that are also dimensions) as well as the declarations of all dimensions, variables, and attribute values. Data values of non-coordinate variables are not output.

-v var1[,...]
Output data values for the specified variable(s), in addition to the declarations of all dimensions, variables, and attributes. One or more variables must be specified by name, in a comma-delimited list (without blanks or other whitespace characters). Named variables must be valid within the input file.

-sed sed1[,...]
(GRIB files only) Causes the specified dimensions to be included for all variables in the file even they contain only a single element; choices are Initial_time, Forecast_time, Level, Ensemble, Probability, All, and None. The default is None.

-itime
(GRIB files only) Set time record dimension to initial_time. This allows a variable with only a single initial time to be treated as a single element dimension. Equivalent to -sed Initial_time.

-ftime
(GRIB files only) Set time record dimension to forecast_time. This allows a variable with only a single forecast time to be treated as a single element dimension. Equivalent to -sed Forecast_time
-tps
(GRIB files only) Removes the suffix representing a time period (e.g. 2h) from statistically processed variables, leaving only the type of processing as a suffix (e.g. "_acc", "_avg", etc.). The default is True, which leaves the suffix in place.

-h
Display a short message explaining the command usage, and exit.

Examples

Example 1

The following prints the coordinate variable information, as well as declarations of all dimensions, variables and attributes, of the input data file:

          % ncl_filedump ced1.lf00.t00z.ega.grb
          [...]
          filename:       ced1.lf00.t00z.eta
          path:   ced1.lf00.t00z.eta.grb
             file global attributes:
             dimensions:
                gridx_6 = 45
                gridy_6 = 53
                gridx_101 = 91
                gridy_101 = 113
                [...]
             variables:
                float PRES_6_SFC ( gridx_6, gridy_6 )
                [...]
Example 2

The following prints coordinate variable information, as well as declarations of all dimensions, variables and attributes, and the data values for the specified variable. It also creates the variable "forecast_time0" as a single element dimension variable.

          % ncl_filedump -v PRES_6_SFC -ftime ced1.lf00.t00z.ega.grb
          [...]
          filename:       ced1.lf00.t00z.eta
          path:   ced1.lf00.t00z.eta.grb
             file global attributes:
             dimensions:
                forecast_time0 = 1
                gridx_6 = 45
                gridy_6 = 53
                gridx_101 = 91
                gridy_101 = 113
                [...]
             variables:
                float PRES_6_SFC ( forecast_time0, gridx_6, gridy_6 )

                integer forecast_time0 ( forecast_time0 )
                   long_name :    Forecast offset from initial time
                   units :        hours

                [...]

          Variables:
 
               PRES_6_SFC:
  
           0.1009E+06  0.1009E+06  0.1009E+06  0.1009E+06  0.1009E+06  0.1008E+06
           0.1008E+06  0.1008E+06  0.1009E+06  0.1010E+06  0.1010E+06  0.1010E+06
           [...]
Example 3

The following prints the usage message:

         % ncl_filedump -h
         ncl_filedump [-c] [-v var1[,...]] [-sed sed1[,...]] [-itime] [-ftime] [-tps] [-h] file
           [-c]                coordinate variable and header information
           [-v var1[,...]]     data for variable(s) ,...
           [-sed sed1[,...]]   GRIB files only; set single element dimensions [default: none]
                                   choices are initial_time, forecast_time, level, ensemble,
                                   probability, all, none
           [-itime]            GRIB files only; set initial time as a single element dimension
                                   (same as -sed initial_time)
           [-ftime]            GRIB files only; set forecast time as a single element dimension
                                   (same as -sed forecast_time)
           [-tps]              GRIB files only; remove suffix representing a time period (e.g. 2h)
                                 from statistically processed variables, leaving only type of
                                 processing as a suffix (e.g. _acc, _avg)
           [-h]                this usage message

See also

ncl_convert2nc (version 4.2.0.a034 or later)

Caveats

Input files that do not end with an extension recognized as a supported file format are ignored. If the input file is of a supported type, but is not tagged with a recognized extension, simply adding the recognized extention on the command line will result in the file being recognized as valid input.