Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

CDM Section Specification

Syntax

Array sections can be specified with Fortran 90 array section syntax, using zero-based indexing. For example:

/group1/group2/varName(12:22,0:100:2,:,17) 

specifies an array section for a four dimensional variable:

  1. 12:22 includes all the elements from 12 to 22 inclusive
  2. 0:100:2 includes the elements from 0 to 100 inclusive, with a stride of 2
  3. : includes all the elements
  4. 17 includes just the 18th element.

For structures, you can specify nested selectors, e.g. record(12).wind(1:20,:,3) does a selection on the wind member variable of the record structure at index 12. If you don’t specify a section, it means read the entire variable, e.g. record.wind means all the data in all the wind variables in all the record structures.

Formally:

 sectionSpec := selector | selector '.' selector 
 selector := varName ['(' sectionSpec ')']
 varName := STRING 
 sectionSpec := dim | dim ',' sectionSpec
 dim := ':' | slice | start ':' end | start ':' end ':' stride


 slice := INTEGER 
 start := INTEGER
 stride := INTEGER
 end := INTEGER
 STRING := String with escaped chars = '.', '/', '(', and ')'

where:

TBD:

Restrictions

A Sequence is a one-dimensional Structure with a variable length, it cannot be subsetted

A variable long name must be used, that is with its group names: /group1/group2/varName

Use

  public Array NetcdfFile.readSection(String variableSection);

Also See:


This document is maintained by John Caron and was last updated on May 08, 2008
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690