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

Previous: Interoperability with HDF5, Up: Structure


4.11 DAP Support

Beginning with NetCDF version 4.1, optional support is provided for accessing data through OPeNDAP servers using the DAP protocol.

DAP support is enabled by running the netCDF configure script with the –enable-dap flag. DAP support also requires access to the curl and xml2 libraries; refer to the installation manual for details The NetCDF Installation and Porting Guide.

DAP uses a data model that is different from that supported by netCDF, either CLASSIC or extended. Generically, the DAP data model is encoded textually in a DDS (Dataset Descriptor Structure). There is a second data model for DAP attributes, which is encoded textually in a DAS (Dataset Attribute Structure). For detailed information about the DAP DDS and DAS, refer the OPeNDAP Consortium web site http://opendap.org.

In order to access a DAP data source through the netCDF interface, it is necessary to translate the DAP model to the netCDF model. Currently, only netCDF Classic is supported, which means that the DAP model is translated into the netCDF Classic data model; netCDF Extended is not yet supported (but is a coming attraction). Please note that the translation is unstable in the sense that future versions will likely produce somewhat different translations than that of the initial release. The reason for this instability is two-fold. First, the implementation base will be changing from libdap plus libnc-dap to ocapi plus netCDF specific code. Second, as experience is gained, the quality of the translations should improve.

It is possible to see what the translation does to a particular DAP data source by examining the source first through a web browser to see the DDS, and then through ncdump to see the netCDF Classic translation. The ncdump output will actually be the union of the DDS with the DAS, so to see the complete translation, it is necessary to view both.

For example, if a web browser is given the following, the first URL will return the DDS for the specified dataset, and the second URL will return the DAS for the specified dataset.

     http://test.opendap.org:8080/dods/dts/test.01.dds
     http://test.opendap.org:8080/dods/dts/test.01.das

Then by using the following ncgen command, it is possible to see the equivalent netCDF Classic translation.

     ncgen -h http://test.opendap.org:8080/dods/dts/test.01

The DDS output from the web server should look like this.

Dataset {
    Byte b;
    Int32 i32;
    UInt32 ui32;
    Int16 i16;
    UInt16 ui16;
    Float32 f32;
    Float64 f64;
    String s;
    Url u;
} SimpleTypes;

The DAS output from the web server should look like this.

Attributes {
    Facility {
        String PrincipleInvestigator ``Mark Abbott'', ``Ph.D'';
        String DataCenter ``COAS Environmental Computer Facility'';
        String DrifterType ``MetOcean WOCE/OCM'';
    }
    b {
        String Description ``A test byte'';
        String units ``unknown'';
    }
    i32 {
        String Description ``A 32 bit test server int'';
        String units ``unknown'';
    }
}

The output from ncgen should look like this.

netcdf test {
variables:
	byte b ;
		b:Description = "A test byte" ;
		b:units = "unknown" ;
	int i32 ;
		i32:Description = "A 32 bit test server int" ;
		i32:units = "unknown" ;
	int ui32 ;
	short i16 ;
	short ui16 ;
	float f32 ;
	double f64 ;
	char s ;
	char u ;
}
Note that the Facility attributes do not appear in the translation because they are neither global nor associated with a variable in the DDS.
 
 
  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