|
|
|||
|
||||
An NcML document is an XML document (aka an instance document) whose contents are described and constrained by NcML Schema-2.2. NcML Schema-2.2 combines the earlier NcML core schema which is an XML description of the netCDF-Java 2.2 / NetCDF-4 data model, with the earlier NcML dataset schema, which allows you to define, redefine, aggregate, and subset existing netCDF files.
An NcML document represents a generic netCDF dataset, i.e. a container for data conforming to the netCDF data model. For instance, it might represent an existing netCDF file, a netCDF file not yet written, a GRIB file read through the netCDF-Java library, a subset of a netCDF file, an aggregation of netCDF files, or a self-contained dataset (i.e. all the data is included in the NcML document and there is no seperate netCDF file holding the data). An NcML document therefore should not necessarily be thought of as a physical netCDF file, but rather the "public interface" to a set of data conforming to the netCDF data model.
NcML Schema-2.2 is written in the W3C XML Schema language, and essentially represents the netCDF-Java 2.2 / NetCDF-4 data model, which schematically looks like this in UML:

netCDF-Java 2.2 / NetCDF-4 UML
Aggregation specific elements are listed in red.
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2"
elementFormDefault="qualified">
The netcdf element represents a generic netCDF dataset, i.e. a container for data conforming to the netCDF data model. For instance, a netcdf element might represent an existing netCDF file, a netCDF file not yet written, a GRIB file read through the netCDF-Java library, a subset of a netCDF file, an aggregation of netCDF files, or a self-contained dataset (i.e. all the data is included in the NcML document and there is no seperate netCDF file holding the data). An NcML document therefore should not necessarily be thought of as a physical netCDF file, but rather the "public interface" or API to a set of data, which may or may not be implemented with a physical netCDF file.
The element netcdf is the root tag of the NcML instance document, and is said to define a NetCDF dataset.
<!-- XML encoding of Netcdf container object --> <xsd:element name="netcdf">
<xsd:complexType>
<xsd:sequence> (1) <xsd:choice minOccurs="0">
<xsd:element name="readMetadata"/>
<xsd:element name="explicit"/>
</xsd:choice>
(2) <xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="group"/> <xsd:element ref="dimension"/>
<xsd:element ref="variable"/>
<xsd:element ref="attribute"/>
<xsd:element ref="remove"/>
</xsd:choice>
(3) <xsd:element ref="aggregation" minOccurs="0"/>
</xsd:sequence>
(4)<xsd:attribute name="location" type="xsd:anyURI"/> (5)<xsd:attribute name="id" type="xsd:string"/> (6)<xsd:attribute name="title" type="xsd:string"/> (7)<xsd:attribute name="enhance" type="xsd:boolean"/> (8)<xsd:attribute name="addRecords" type="xsd:boolean"/>
<!-- for aggregations --> (9)<xsd:attribute name="ncoords" type="xsd:string"/> (10)<xsd:attribute name="coordValue" type="xsd:string"/> (11)<xsd:attribute name="fmrcDefinition" type="xsd:string"/> </xsd:complexType> </xsd:element>
A group element represents a netCDF group, a container for variable, dimension, attribute, or other group elements.
<xsd:element name="group">
<xsd:complexType>
(1) <xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="dimension"/>
<xsd:element ref="variable"/>
<xsd:element ref="attribute"/>
<xsd:element ref="group"/>
<xsd:element ref="remove"/>
</xsd:choice>
(2) <xsd:attribute name="name" type="xsd:string" use="required"/>
(3) <xsd:attribute name="orgName" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
The dimension element represents a netCDF dimension, i.e. a named index of specified length.
<!-- XML encoding of Dimension object --> <xsd:element name="dimension">
<xsd:complexType>
(1) <xsd:attribute name="name" type="xsd:token" use="required"/>
(2) <xsd:attribute name="length" type="xsd:nonNegativeInteger"/>
(3) <xsd:attribute name="isUnlimited" type="xsd:boolean" default="false"/>
(4) <xsd:attribute name="isVariableLength" type="xsd:boolean" default="false"/>
(5) <xsd:attribute name="isShared" type="xsd:boolean" default="true"/>
(6) <xsd:attribute name="orgName" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
A variable element represents a netCDF variable, i.e. a scalar or multidimensional array of specified type indexed by 0 or more dimensions.
<xsd:element name="variable">
<xsd:complexType>
<xsd:sequence>
(1) <xsd:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
(2) <xsd:element ref="values" minOccurs="0"/>
(3) <xsd:element ref="variable" minOccurs="0" maxOccurs="unbounded"/>
(4) <xsd:element ref="logicalView" minOccurs="0" />
(5) <xsd:element ref="remove" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
(6) <xsd:attribute name="name" type="xsd:token" use="required" />
(7) <xsd:attribute name="type" type="DataType" use="required" />
(8) <xsd:attribute name="shape" type="xsd:token" />
(9) <xsd:attribute name="orgName" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
A values element specifies the data values of a variable, either by listing them for example: <values>-109.0 -107.0 -115.0 93.923230</values> or by specifying a start and increment, for example: <values start="-109.5" increment="2.0" />. For a multi-dimensional variable, the values must be listed compatibly with the size and shape of the variable (slowest varying dimension first).
<xsd:element name="values">
<xsd:complexType mixed="true">
(1) <xsd:attribute name="start" type="xsd:float"/>
<xsd:attribute name="increment" type="xsd:float"/>
<xsd:attribute name="npts" type="xsd:int"/>
(2) <xsd:attribute name="separator" type="xsd:string" />
</xsd:complexType>
</xsd:element>
The attribute elements represents a netCDF attribute, i.e. a name-value pair of specified type. Its value may be specified in the values attribute e.g. <attribute name="Conventions" value="COARDS"/>, or in the element content, , e.g. <attribute name="valid_range" type="float">-99.0 110</values>. It is recommended to use the second form when there are multiple values, but this is only a matter of style.
<xsd:element name="attribute">
<xsd:complexType mixed="true">
(1) <xsd:attribute name="name" type="xsd:token" use="required"/>
(2) <xsd:attribute name="type" type="DataType" default="String"/>
(3) <xsd:attribute name="value" type="xsd:string" />
(4) <xsd:attribute name="separator" type="xsd:string" />
(5) <xsd:attribute name="orgName" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
The DataType element is an enumerated list of the data types allowed for NcML Variable and Attribute objects.
<xsd:simpleType name="DataType">
<xsd:restriction base="xsd:token">
<xsd:enumeration value="char"/>
<xsd:enumeration value="byte"/>
<xsd:enumeration value="short"/>
<xsd:enumeration value="int"/>
<xsd:enumeration value="long"/>
<xsd:enumeration value="float"/>
<xsd:enumeration value="double"/>
<xsd:enumeration value="String"/>
<xsd:enumeration value="string"/>
<xsd:enumeration value="Structure"/>
</xsd:restriction>
</xsd:simpleType>
The remove element is used to remove attribute, dimension, variable or group objects that are in the referenced dataset. Place the remove element in the container of the object to be removed.
<xsd:element name="remove">
<xsd:complexType>
(1) <xsd:attribute name="name" type="xsd:string" use="required"/> (2) <xsd:attribute name="type" type="ObjectType" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="ObjectType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="attribute"/>
<xsd:enumeration value="dimension"/>
<xsd:enumeration value="variable"/>
<xsd:enumeration value="group"/>
</xsd:restriction>
</xsd:simpleType>
The aggregation element allows multiple datasets to be combined into a single logical dataset. There can only be one aggregation element in a netcdf element.
<xsd:element name="aggregation">
<xsd:complexType>
<xsd:sequence> (1) <xsd:element name="variableAgg" minOccurs="0" maxOccurs="unbounded"> <xsd:complexType> <xsd:attribute name="name" type="xsd:string" use="required"/> </xsd:complexType> </xsd:element>
(2) <xsd:element ref="netcdf" minOccurs="0" maxOccurs="unbounded"/>
(3) <xsd:element name="scan" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
(4) <xsd:attribute name="location" type="xsd:string" use="required"/>
(5) <xsd:attribute name="suffix" type="xsd:string" />
(6) <xsd:attribute name="regExp" type="xsd:string" />
(7) <xsd:attribute name="subdirs" type="xsd:boolean" default="true"/>
(8) <xsd:attribute name="olderThan" type="xsd:string" />
(9) <xsd:attribute name="dateFormatMark" type="xsd:string" />
(10) <xsd:attribute name="enhance" type="xsd:boolean"/>
</xsd:complexType>
</xsd:element>
(11) <xsd:element name="scanFmrc" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
(4) <xsd:attribute name="location" type="xsd:string" use="required"/>
(5) <xsd:attribute name="suffix" type="xsd:string" />
(6) <xsd:attribute name="regExp" type="xsd:string" />
(7) <xsd:attribute name="subdirs" type="xsd:boolean" default="true"/>
(8) <xsd:attribute name="olderThan" type="xsd:string" />
(12) <xsd:attribute name="runDateMatcher" type="xsd:string" />
<xsd:attribute name="forecastDateMatcher" type="xsd:string" />
<xsd:attribute name="forecastOffsetMatcher" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
(13) <xsd:attribute name="type" type="AggregationType" use="required"/> (14) <xsd:attribute name="dimName" type="xsd:token" /> (15) <xsd:attribute name="recheckEvery" type="xsd:string" /> </xsd:complexType> </xsd:element>
Filename: SUPER-NATIONAL_1km_SFC-T_20051206_2300.gini
DateFormatMark: SUPER-NATIONAL_1km_SFC-T_#yyyyMMdd_HHmm
Filename: gfs_3_20060706_0300_006.grb
runDateMatcher: #gfs_3_#yyyyMMdd_HH
forecastOffsetMatcher: HHH#.grb#
will extract the run date 2006-07-06T03:00:00Z, and the forecast offset "6 hours".
<!-- type of aggregation --> <xsd:simpleType name="AggregationType"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="forecastModelRunCollection"/>
<xsd:enumeration value="forecastModelRunSingleCollection"/> <xsd:enumeration value="joinExisting"/> <xsd:enumeration value="joinNew"/> <xsd:enumeration value="union"/> </xsd:restriction> </xsd:simpleType>
The allowable aggregation types.
The following is taken from the javadoc, see here for full info. The following pattern letters are defined (all other characters from 'A' to 'Z' and from 'a' to 'z' are reserved):
Letter Date or Time Component Presentation Examples GEra designator Text ADyYear Year 1996;96MMonth in year Month July;Jul;07wWeek in year Number 27WWeek in month Number 2DDay in year Number 189dDay in month Number 10FDay of week in month Number 2EDay in week Text Tuesday;TueaAm/pm marker Text PMHHour in day (0-23) Number 0kHour in day (1-24) Number 24KHour in am/pm (0-11) Number 0hHour in am/pm (1-12) Number 12mMinute in hour Number 30sSecond in minute Number 55SMillisecond Number 978zTime zone General time zone Pacific Standard Time;PST;GMT-08:00ZTime zone RFC 822 time zone -0800Examples
The following examples show how date and time patterns are interpreted in the U.S. locale. The given date and time are 2001-07-04 12:08:56 local time in the U.S. Pacific Time time zone.
Date and Time Pattern Result "yyyy.MM.dd G 'at' HH:mm:ss z"2001.07.04 AD at 12:08:56 PDT"EEE, MMM d, ''yy"Wed, Jul 4, '01"h:mm a"12:08 PM"hh 'o''clock' a, zzzz"12 o'clock PM, Pacific Daylight Time"K:mm a, z"0:08 PM, PDT"yyyyy.MMMMM.dd GGG hh:mm aaa"02001.July.04 AD 12:08 PM"EEE, d MMM yyyy HH:mm:ss Z"Wed, 4 Jul 2001 12:08:56 -0700"yyMMddHHmmssZ"010704120856-0700
This document is maintained by John Caron and was last updated on Nov 08, 2006
| Contact Us Site Map Search Terms and Conditions Privacy Policy Participation Policy | ||||||
|
||||||