BES - Modules - The NetCDF Handler: Difference between revisions

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
No edit summary
Line 12: Line 12:
;NC_BYTE: There is no 'signed byte' type in DAP2 so these map to an unsigned byte.
;NC_BYTE: There is no 'signed byte' type in DAP2 so these map to an unsigned byte.
;NC_CHAR: There is no 'character' type in DAP2 so these map to DAP Strings of length one. Arrays of ''N'' characters in netCDF map to arrays of ''N-1'' Strings in DAP
;NC_CHAR: There is no 'character' type in DAP2 so these map to DAP Strings of length one. Arrays of ''N'' characters in netCDF map to arrays of ''N-1'' Strings in DAP
;NC_INT64 and NC_UINT64: DAP2 does not support 64-bit integers (this will be added soon to the next version of the protocol).
;NC_INT64, NC_UINT64: DAP2 does not support 64-bit integers (this will be added soon to the next version of the protocol).
 
{|border="1" style="text-align:center;"
! netCDF type name
! netCDF type
! DAP2 type name
! DAP2 type
! Notes
|-
|NC_BYTE
|8-bit signed integer
|dods_byte
|8-bit unsigned integer
|The DAP2 type is unsigned
|-
|NC_CHAR
|8-bit unsigned integer
|dods_str
|variable length character string
|treated as character data; arrays are treated specially (see text)
|-
|NC_SHORT
|16-bit signed integer
|dods_int16
|16-bit signed integer
|
|- style="font-style:italic; color:green;"
|NC_USHORT
|16-bit unsigned integer
|dods_uint16
|16-bit unsigned integer
|
|-
|NC_INT
|32-bit signed integer
|dods_int32
|32-bit signed integer
|
|-style="font-style:italic; color:green;"
|NC_UINT
|32-bit unsigned integer
|dods_uint32
|32-bit unsigned integer
|
|- style="font-style:italic; color:green;"
|NC_INT64
|64-bit signed integer
|None
|
|Not supported
|- style="font-style:italic; color:green;"
|NC_UINT64
|64-bit unsigned integer
|None
|
|Not supported
|-
|NC_FLOAT
|32-bit floating point
|dods_float32
|32-bit floating point
|
|-
|NC_DOUBLE
| 64-bit floating point
|dods_float64
| 64-bit floating point
|
|- style="font-style:italic; color:green;"
|NC_STRING
|variable length character string
|dods_str
|variable length character string
|In DAP2 it's impossible to distinguish this from an array of NC_CHAR
|}


== Configuration parameters ==
== Configuration parameters ==

Revision as of 21:07, 15 September 2011

Kinds of files the handler will serve

There are several versions of the netCDF software for reading and writing data and using those different versions, it's possible to make several different kinds of data files. For the most part, netCDF strives to maintain compatibility so that any older file can be read using any newer version of the library. To ensure that the netCDF handler can read (almost) any valid netCDF data file, you should make sure to use the latest version of the netCDF library when you build or install the handler.

However, as of netCDF 4, there are some new data model components in netCDF that are hard to represent in DAP2 (hence the 'almost' in the preceding paragraph). If the handler, as of version 3.10.x, is linked with netCDF 4.1.x or later, you will be able to read any netCDF file that fits the 'classic' model of netCDF (as defined by documentation) which essentially means any file that uses only data types present in the netCDF 3.x API. In addition, these files can employ both internal compression and chunking.

The new data types present in the netCDF data model present more of a challenge. However, as of version 3.10.x, the Hyrax data handler will serve most of the new cardinal types and the more commonly used 'user defined types'.

Mappings between NetCDF version 4 data model and DAP2 data types

All of the cardinal types in the netCDF 4 data model map directly to types in DAP2 except for the following:

NC_BYTE
There is no 'signed byte' type in DAP2 so these map to an unsigned byte.
NC_CHAR
There is no 'character' type in DAP2 so these map to DAP Strings of length one. Arrays of N characters in netCDF map to arrays of N-1 Strings in DAP
NC_INT64, NC_UINT64
DAP2 does not support 64-bit integers (this will be added soon to the next version of the protocol).
netCDF type name netCDF type DAP2 type name DAP2 type Notes
NC_BYTE 8-bit signed integer dods_byte 8-bit unsigned integer The DAP2 type is unsigned
NC_CHAR 8-bit unsigned integer dods_str variable length character string treated as character data; arrays are treated specially (see text)
NC_SHORT 16-bit signed integer dods_int16 16-bit signed integer
NC_USHORT 16-bit unsigned integer dods_uint16 16-bit unsigned integer
NC_INT 32-bit signed integer dods_int32 32-bit signed integer
NC_UINT 32-bit unsigned integer dods_uint32 32-bit unsigned integer
NC_INT64 64-bit signed integer None Not supported
NC_UINT64 64-bit unsigned integer None Not supported
NC_FLOAT 32-bit floating point dods_float32 32-bit floating point
NC_DOUBLE 64-bit floating point dods_float64 64-bit floating point
NC_STRING variable length character string dods_str variable length character string In DAP2 it's impossible to distinguish this from an array of NC_CHAR

Configuration parameters