<!ENTITY % AggregationType "JoinNew | Union | JoinExisting">
<!ENTITY % VariableType "byte | short | int | float | double | String">
<!ELEMENT aggregation (fileAccess+, variable*, fileScan?)>
<!ATTLIST aggregation
aggType (%AggregationType;) #REQUIRED
serviceName CDATA #IMPLIED
varName CDATA #IMPLIED
varType (%VariableType;) #IMPLIED
varUnit CDATA #IMPLIED
dateFormat CDATA #IMPLIED
>
Use the aggregation element to define the collections of files to be aggregated, and the manner in which it is to be done.
An aggregation element contains one or more fileAccess elements, followed by 0 or more variable elements, followed by an optional fileScan element. (As of Aggregation Server version 0.6, you should not use the fileScan element.)
Unlike Union and JoinExist, JoinNew type aggregations must create a new coordinate variable. The variable name is specified with the varName attribute to the aggregation, and the variable's values must be specified in the coord attribute of the fileAccess elements contained in this aggregation element. The varType attribute specifies the type of the new coordinate variable, while the varUnit attribute specifies the unit string which is added as its attribute.
For example, consider three data files containing satellite measurements in 1440x720 element arrays. Aggregating them with the following catalog entry:
<aggregation serviceName="GSO" aggType="JoinNew" varName="time"
varType="int" varUnit="secs since 0000-01-01 00:00:00"
dateFormat="yyyy/M/d:HH:mm:ss z">
<fileAccess urlPath="qscat/01.dat" coord="0000/1/1:00:00:00 GMT"/>
<fileAccess urlPath="qscat/02.dat" coord="0000/1/2:00:00:00 GMT"/>
<fileAccess urlPath="qscat/03.dat" coord="0000/1/3:00:00:00 GMT"/>
</aggregation>
will result in this DDS and DAS:
Dataset {
Int32 time[time = 3];
Byte binarydata[time = 3][latitude = 720][longitude = 1440];
} qscat/bmaps;
Attributes {
time {
String units "secs since 0000-01-01 00:00:00";
}
}
and a query on the time variable returns:
time[3] 0, 86400, 172800
An aggregation element appears inside metadata
elements, which allow content type ANY.
These are the possible attributes for an aggregation element.
Required. One of JoinNew, JoinExisting, or Union.
The serviceName specifies the internal data service to use. The name is given by the name attribute of the service element. It may be overridden by one of the fileAccess elements (or supplied, if it is omitted here). If it is not present in either this element or in the fileAccess element, the server will issue an error.
The varName specifies the existing (JoinExisting) or new (JoinNew) coordinate variable to join the files on. It is not used for Union type aggregations.
The coordinate values specified in the coord attribute of the fileAccess elements are converted to the type specified by varType, which must be one of byte, short, int, float, double or String. If varType is not specified, then the coordinates are added as Strings. This attribute is only used in JoinNew aggregations.
A unit string of the added variable (only for JoinNew). This is added to the DAS of the retrieved data, if possible.
Date-valued coordinates are handled in a special way if the
dateFormat attribute is specified. In this case, the
dateFormat is the format of the date
coordinate values. This format is defined by
java.text.SimpleDateFormat. The coordinate values are first
parsed by SimpleDateFormat according to the dateFormat.
This gives a long value in units of "msecs since Jan 1, 1970". If
varUnit is specified, this value is converted to it using the
ucar.units package, and the varUnit must therefore be
convertible with "msecs since Jan 1, 1970". If varUnit is not
specified, the value is converted into "secs since Jan 1, 1970". If
varType is specified, the value is converted to that type. If
not, the value is converted to a double.