NCDF_LIST

The NCDF_LIST routine lists the variables and attributes in a NetCDF file. When calling NCDF_LIST, IDL prints the output directly to the console unless you specify the QUIET keyword.

This routine is written in the IDL language. Its source code can be found in the file NCDF_LIST.pro in the lib subdirectory of the IDL distribution.

Examples

In this example, we print the variables and attributes within a NetCDF file:

file = FILEPATH('sample.nc', $

   SUBDIRECTORY=['examples','data'])

NCDF_LIST, file, /VARIABLES, /DIMENSIONS, /GATT, /VATT

IDL prints:

C:\Program Files\***\IDLxx\examples\data\sample.nc

# dimensions: 3

# Variables: 1

# Global attributes: 3

The unlimited dimension is 2

 

Dimensions

0 Name: x Size: 512

1 Name: y Size: 768

2 Name: z Size: 0

 

Global Attributes

0 TITLE: Incredibly Important Data

1 GALAXY: Milky Way

2 PLANET: Earth

 

Variables and attributes

0 image: BYTE(768,512) = BYTE(y,x)

   0 TITLE: New York City

Syntax

NCDF_LIST, filename, /DIMENSIONS, /GATT, OUT=variable, /QUIET, /VARIABLES, /VATT, VNAME=variable

Arguments

FILENAME

A string giving the name of the NetCDF file.

Keywords

DIMENSIONS

Set this keyword to print out the dimensions within the file.

GATT

Set this keyword to print out the global attributes.

OUT

Set this keyword to a named variable in which to return the output. Note that the output will still be printed unless the QUIET keyword is also set.

QUIET

Set this keyword to suppress output to the screen.

VARIABLES

Set this keyword to print out information about the variables within the file.

VATT

Set this keyword to print out the variable attributes for each variable.

VNAME

Set this keyword to a named variable in which to return a string array containing the variable names.

Version History

8.4.1

Introduced

See Also

NCDF_GET, NCDF_PUT