Prev Up Next Index
Go backward to Caching DAS and DDS Objects
Go up to 4.1 Data Servers
Go forward to 4.1.4 The Usage Filter

4.1.3 The Data filter

The data filter program is structured similarly to both the DAS and DDS filters except that it returns a binary MIME document rather than text and that it takes two arguments instead of just one. In addition to the data set or file name (argument 1) it also takes the DODS constraint expression (argument 2, which was enclosed in the URL's query).

The NetCDF data filter is all but identical to the DDS filter. The only difference is that it calls the send_data method of DODSFilter to send the binary data over the network. This function calls the DDS send method.

If for some reason you cannot use the send member function of DDS, then you must ensure that the the read, CE evaluation and the serialize operations are all carried out in the correct order. Furthermore, you must ensure that the return value of the data filter is a binary MIME document with a text prefix (currently, DODS does not use the multi-part MIME standard); that is a regular binary MIME document with a section at the start that is text. This text is the DDS generated after evaluating the projection clauses of the constraint expression. The text part is separated from the data by the keyword "Data:" at the start of the line.10

The ASCII Data Filter

DODS is packaged with a filter to translate a DODS data stream into an ASCII data file. Clients can request ASCII data by appending .asc or .ascii to their URL instead of .dods. The asciival program is useful as a standalone client (see The OPeNDAP User Guide), but may also be used by a server to provide ASCII data.

A request for ASCII data is processed as any other request for data, but the final output of the data filter is piped into the asciival program and the result returned to the client:

nc_dods Data.nc | asciival -m -- -

The DODS_Dispatch class takes care of this step automatically, when it encounters a request using .asc or .ascii.


Tom Sgouros, July 2, 2004

Prev Up Next