<< ncreadatt sciNetCDF Low level interface >>

sciNetCDF >> sciNetCDF > ncdisp

ncdisp

Outputs the content of a NetCDF source.

Calling Sequence

output = ncdisp(source, location, [output_options])

Arguments

source

Path to a NetCDF file or URL of an OpenNDAP source (string).

location

Optional path of a group or variable (string). By defaut is '/' (data of all variables are output). For a group, the path must end with a '/'.

output_options

Optional parameters to control the output (matrix of string):

  • 'min': the data of variables are not displayed, only the definitions.

  • 'to_var': the content is returned into output instead of the console.

  • Description

    ncdisp displays the content of a NetCDF source (NetCDF file or OpenNDAP source).

    It displays the same content as the NetCDF ncdump tool. The definitions and data of variables (and all other content: group hierarchy, dimensions,...) are displayed in the console using the CDL notation (Common Data Language).

    By default the data for all variables are output. The location parameter is used as a filter to output data only for a specific variable or group, which can be convenient if the NetCDF source is big.

    Examples

    scinetcdf_path = getSciNetCDFPath();
    source = fullfile(scinetcdf_path, 'tests/unit_tests/data/micro.nc');
    
    // Displays the whole content of the file
    ncdisp(source);
    
    // Displays only the definitions of variables (no data)
    ncdisp(source, '/', 'min');
    
    // Displays all the definitions and the data of the variable 'x'
    ncdisp(source, 'x');
    
    // Displays all the definitions and the data of the group 'grp'
    ncdisp(source, 'grp/');

    See Also


    Report an issue
    << ncreadatt sciNetCDF Low level interface >>