https://docs.opendap.org/index.php?title=Wiki_Testing/hdrfmts&feed=atom&action=historyWiki Testing/hdrfmts - Revision history2024-03-29T14:25:43ZRevision history for this page on the wikiMediaWiki 1.38.4https://docs.opendap.org/index.php?title=Wiki_Testing/hdrfmts&diff=4948&oldid=prevTomSgouros at 23:50, 6 October 20092009-10-06T23:50:09Z<p></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 23:50, 6 October 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[FreeForm|return to FreeForm]]</ins></div></td></tr>
<tr><td colspan="2" class="diff-side-deleted"></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=Header Formats=</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=Header Formats=</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l68">Line 68:</td>
<td colspan="2" class="diff-lineno">Line 70:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>single record or data block. FreeForm ND can read headers included in</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>single record or data block. FreeForm ND can read headers included in</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>the data file or stored in a separate file. Header formats, like data</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>the data file or stored in a separate file. Header formats, like data</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>formats, are described in format description files<del style="font-weight: bold; text-decoration: none;">. For a list of the</del></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>formats, are described in format description files.</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">header descriptors you can use in format descriptions, see</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;">([http://www <cite> ff,tblfmt</cite>])</del>.</div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>===File Headers===</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>===File Headers===</div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l420">Line 420:</td>
<td colspan="2" class="diff-lineno">Line 420:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This format description file contains a header format description, a</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>This format description file contains a header format description, a</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>description for dBASE input data, the special RETURN descriptor, and a</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>description for dBASE input data, the special RETURN descriptor, and a</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>description for ASCII output data. The variable <del style="font-weight: bold; text-decoration: none;">\var{</del>count<del style="font-weight: bold; text-decoration: none;">} </del>(fourth</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>description for ASCII output data. The variable <ins style="font-weight: bold; text-decoration: none;">''</ins>count<ins style="font-weight: bold; text-decoration: none;">'' </ins>(fourth</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>from the bottom in the header format description) indicates the number</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>from the bottom in the header format description) indicates the number</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>of data records that follow each header. The descriptor RETURN lets</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>of data records that follow each header. The descriptor RETURN lets</div></td></tr>
</table>TomSgouroshttps://docs.opendap.org/index.php?title=Wiki_Testing/hdrfmts&diff=1988&oldid=prevYuan: /* Separate File Header */2008-02-06T14:45:05Z<p><span dir="auto"><span class="autocomment">Separate File Header</span></span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:45, 6 February 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l329">Line 329:</td>
<td colspan="2" class="diff-lineno">Line 329:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><blockquote>When you run <font color='green'>newform</font>, it will write the separate header to <font color='green'>llmxmn.bin</font> along with the data in <font color='green'>llmxmn.dat</font>. </blockquote></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><blockquote><ins style="font-weight: bold; text-decoration: none;">NOTE: </ins>When you run <font color='green'>newform</font>, it will write the separate header to <font color='green'>llmxmn.bin</font> along with the data in <font color='green'>llmxmn.dat</font>. </blockquote></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Separate Record Headers====</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Separate Record Headers====</div></td></tr>
</table>Yuanhttps://docs.opendap.org/index.php?title=Wiki_Testing/hdrfmts&diff=1987&oldid=prevYuan: /* Separate File Header */2008-02-06T14:44:49Z<p><span dir="auto"><span class="autocomment">Separate File Header</span></span></p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 14:44, 6 February 2008</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l329">Line 329:</td>
<td colspan="2" class="diff-lineno">Line 329:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><blockquote>When you run <font color='green'>newform</font>, it will write the separate header to</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><blockquote>When you run <font color='green'>newform</font>, it will write the separate header to <font color='green'>llmxmn.bin</font> along with the data in <font color='green'>llmxmn.dat</font>. <ins style="font-weight: bold; text-decoration: none;"></blockquote></ins></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> </div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><font color='green'>llmxmn.bin</font> along with the data in <font color='green'>llmxmn.dat</font>. <del style="font-weight: bold; text-decoration: none;">}</del></div></td><td colspan="2" class="diff-side-added"></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Separate Record Headers====</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>====Separate Record Headers====</div></td></tr>
</table>Yuanhttps://docs.opendap.org/index.php?title=Wiki_Testing/hdrfmts&diff=1278&oldid=prevYuan: New page: =Header Formats= Headers are one of the most commonly encountered forms of metadata-data about data. Applications need the information contained in headers for reading the data that the ...2007-10-05T02:30:42Z<p>New page: =Header Formats= Headers are one of the most commonly encountered forms of metadata-data about data. Applications need the information contained in headers for reading the data that the ...</p>
<p><b>New page</b></p><div>=Header Formats=<br />
<br />
<br />
Headers are one of the most commonly encountered forms of<br />
metadata-data about data. Applications need the information contained<br />
in headers for reading the data that the headers describe. To access<br />
these data, applications must be able to read the headers. Just as<br />
there are many data formats, there are numerous header formats. You<br />
can include header format descriptions, which have exactly the same<br />
form as data format descriptions, in format description files.<br />
<br />
==Header Treatment in FreeForm ND==<br />
<br />
<br />
FreeForm ND is not 100 percent backwards compatible with FreeForm in<br />
the area of header treatment.<br />
<br />
Headers have traditionally been handled differently from data in<br />
FreeForm ND. If a header format was not specified as either input or<br />
output, it was taken as both input and output. <font color='green'>newform</font> did<br />
little in processing headers, and FreeForm ND relied on extraneous<br />
utilities to work with headers.<br />
<br />
===New Behavior===<br />
<br />
In FreeForm ND, header formats are treated the same as data formats.<br />
This means that header formats must be identified as either input or<br />
output, explicitly or implicitly. If done explicitly, then either the<br />
input or the output descriptor will form the format type (e.g.,<br />
<font color='green'>ASCII_input_header</font>). If done implicitly, then the same<br />
ambiguity resolution rules that apply to data formats will be applied<br />
to header formats. This means that ASCII header formats will be taken<br />
as input for data files with a <font color='green'>.dat</font> extension, dBASE header<br />
formats will be taken as input for data files with a <font color='green'>.dab</font><br />
extension, and binary header formats will be taken as input for all<br />
other data files.<br />
<br />
If an embedded header and the data have different file types, then<br />
either the header format or data format (preferably both) must be<br />
explicitly identified as input or output (for example, an ASCII header<br />
embedded in a binary data file). Obviously, ambiguous formats with<br />
different file types cannot both be resolved as input formats.<br />
<br />
The same header format is no longer used as both an input and an<br />
output header format.<br />
<br />
In FreeForm ND, <font color='green'>newform</font> honors output header formats that are<br />
separate (e.g., <font color='green'>ASCII_output_header_separate</font>). The header is<br />
written to a separate file which, unless otherwise specified, is named<br />
after the output data file with a <font color='green'>.hdr</font> extension. This requires<br />
that you name the output file using the <font color='green'>-o</font> option flag; redirected<br />
output cannot be used with separate output headers. The output header<br />
file name and path can be specified using the same keywords that tell<br />
FreeForm ND how to find an input separate header file (i.e.,<br />
<font color='green'>header_file_ext</font>, <font color='green'>header_file_name</font>, and<br />
<font color='green'>header_file_path</font>).<br />
<br />
When defining keywords to specify how an output header file is to be<br />
named, you must use a new type of equivalence section,<br />
<font color='green'>input_eqv</font>, which must appear in the format file along with<br />
<font color='green'>output_eqv</font>.<br />
<br />
==Header Types==<br />
<br />
<br />
FreeForm ND recognizes two types of headers. File headers describe all<br />
the data in a file whereas record headers describe the data in a<br />
single record or data block. FreeForm ND can read headers included in<br />
the data file or stored in a separate file. Header formats, like data<br />
formats, are described in format description files. For a list of the<br />
header descriptors you can use in format descriptions, see<br />
([http://www <cite> ff,tblfmt</cite>]).<br />
<br />
===File Headers===<br />
<br />
<br />
A file header included in a data file is at the beginning of the file.<br />
Only one file header can be associated with a data file.<br />
Alternatively, a file header can be stored in a file separate from the<br />
data file.<br />
<br />
In the following example, a file header is used to store the minimum<br />
and maximum for each variable and the data are converted from ASCII to<br />
binary. There are two variables, latitude and longitude. The file<br />
header format and data formats are described in the format description<br />
file <font color='green'>llmaxmin.fmt</font>.<br />
<br />
Here is <font color='green'>llmaxmin.fmt</font>:<br />
<br />
<pre><br />
ASCII_file_header "Latitude/Longitude Limits"<br />
minmax_title 1 24 char 0<br />
latitude_min 25 36 double 6<br />
latitude_max 37 46 double 6<br />
longitude_min 47 59 double 6<br />
longitude_max 60 70 double 6<br />
<br />
ASCII_data "lat/lon"<br />
latitude 1 10 double 6<br />
longitude 12 22 double 6<br />
<br />
binary_data "lat/lon"<br />
latitude 1 4 long 6<br />
longitude 5 8 long 6<br />
</pre><br />
<br />
The example ASCII data file <font color='green'>llmaxmin.dat</font> contains a file header<br />
and data as described in <font color='green'>llmaxmin.fmt</font>.<br />
<br />
<font color='green'>llmaxmin.dat</font>:<br />
<br />
<pre><br />
<br />
1 2 3 4 5 6 7<br />
1234567890123456789012345678901234567890123456789012345678901234567890<br />
<br />
Latitude and Longitude: -83.223548 54.118314 -176.161101 149.408117<br />
-47.303545 -176.161101<br />
-25.928001 0.777265<br />
-28.286662 35.591879<br />
<br />
12.588231 149.408117<br />
-83.223548 55.319598<br />
<br />
54.118314 -136.940570<br />
<br />
38.818812 91.411330<br />
-34.577065 30.172129<br />
<br />
27.331551 -155.233735<br />
<br />
11.624981 -113.660611<br />
</pre><br />
<br />
This use of a file header would be appropriate if you were interested<br />
in creating maps from large data files. By including maximums and<br />
minimums in a header, the scale of the axes can be determined without<br />
reading the entire file.<br />
<br />
FreeForm ND naming conventions have been followed in this example, so<br />
to convert the ASCII data in the example to binary format, use the<br />
following simple command:<br />
<br />
<pre><br />
newform llmaxmin.dat -o llmaxmin.bin<br />
</pre><br />
<br />
The file header in the example will be written into the binary file as<br />
ASCII text because the header descriptor in <font color='green'>llmaxmin.fmt</font><br />
(<font color='green'>ASCII_file_header</font>) does not specify read/write type, so the<br />
format is used for both the input and output header.<br />
<br />
===Record Headers===<br />
<br />
<br />
Record headers occur once for every block of data in a file. They are<br />
interspersed with the data, a configuration sometimes called a format<br />
sandwich. Record headers can also be stored together in a separate<br />
file.<br />
<br />
The following format description file specifies a record header and<br />
ASCII and binary data formats for aeromagnetic trackline data.<br />
<br />
Here is <font color='green'>aeromag.fmt</font>:<br />
<br />
<pre><br />
ASCII_record_header "Aeromagnetic Record Header Format"<br />
flight_line_number 1 5 long 0<br />
count 6 13 long 0<br />
fiducial_number_corresponding_to_first_logical_record 14 22 long 0<br />
date_MMDDYY_or_julian_day 23 30 long 0<br />
flight_number 31 38 long 0<br />
utm_easting_of_first_record 39 48 float 0<br />
utm_northing_of_first_record 49 58 float 0<br />
utm_easting_of_last_record 59 68 float 0<br />
utm_northing_of_last_record 69 78 float 0<br />
blank_padding 79 104 char 0<br />
<br />
ASCII_data "Aeromagnetic ASCII Data Format"<br />
flight_line_number 1 5 long 0<br />
fiducial_number 6 15 long 0<br />
utm_easting_meters 16 25 float 0<br />
utm_northing_meters 26 35 float 0<br />
mag_total_field_intensity_nT 36 45 long 0<br />
mag_residual_field_nT 46 55 long 0<br />
alt_radar_meters 56 65 long 0<br />
alt_barometric_meters 66 75 long 0<br />
blank 76 80 char 0<br />
latitude 81 92 float 6<br />
longitude 93 104 float 6<br />
<br />
binary_data "Aeromagnetic Binary Data Format"<br />
flight_line_number 1 4 long 0<br />
fiducial_number 5 8 long 0<br />
utm_easting_meters 9 12 long 0<br />
utm_northing_meters 13 16 long 0<br />
mag_total_field_intensity_nT 17 20 long 0<br />
mag_residual_field_nT 21 24 long 0<br />
alt_radar_meters 25 28 long 0<br />
alt_barometric_meters 29 32 long 0<br />
blank 33 37 char 0<br />
latitude 38 41 long 6<br />
longitude 42 45 long 6<br />
</pre><br />
<br />
The example ASCII file <font color='green'>aeromag.dat</font> contains two record headers<br />
followed by a number of data records. The header and data formats are<br />
described in <font color='green'>aeromag.fmt</font>. The variable count (second variable<br />
defined in the header format description) is used to indicate how many<br />
data records occur after each header.<br />
<br />
<font color='green'>aeromag.dat</font>:<br />
<br />
<pre><br />
<br />
1 2 3 4 5 6 7 8 9 10<br />
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345<br />
<br />
420 5 5272 178 2 413669. 6669740. 333345. 6751355. <br />
<br />
420 5272 413669. 6669740. 2715963 2715449 1088 1348 60.157307 -154.555191<br />
<br />
420 5273 413635. 6669773. 2715977 2715464 1088 1350 60.157593 -154.555817<br />
<br />
420 5274 413601. 6669807. 2716024 2715511 1088 1353 60.157894 -154.556442<br />
<br />
420 5275 413567. 6669841. 2716116 2715603 1079 1355 60.158188 -154.557068<br />
<br />
420 5276 413533. 6669875. 2716263 2715750 1079 1358 60.158489 -154.557693<br />
<br />
411 10 8366 178 2 332640. 6749449. 412501. 6668591. <br />
<br />
411 8366 332640. 6749449. 2736555 2736538 963 1827 60.846806 -156.080185<br />
<br />
411 8367 332674. 6749415. 2736539 2736522 932 1827 60.846516 -156.079529<br />
<br />
411 8368 332708. 6749381. 2736527 2736510 917 1829 60.846222 -156.078873<br />
<br />
411 8369 332742. 6749347. 2736516 2736499 922 1832 60.845936 -156.078217<br />
<br />
411 8370 332776. 6749313. 2736508 2736491 946 1839 60.845642 -156.077560<br />
<br />
411 8371 332810. 6749279. 2736505 2736488 961 1846 60.845348 -156.076904<br />
<br />
411 8372 332844. 6749245. 2736493 2736476 982 1846 60.845062 -156.076248<br />
<br />
411 8373 332878. 6749211. 2736481 2736463 1015 1846 60.844769 -156.075607<br />
<br />
411 8374 332912. 6749177. 2736470 2736452 1029 1846 60.844479 -156.074951<br />
<br />
411 8375 332946. 6749143. 2736457 2736439 1041 1846 60.844189 -156.074295<br />
</pre><br />
<br />
<br />
This file contains two record headers. The first occurs on the first<br />
line of the file and has a count of 5, so it is followed by 5 data<br />
records. The second record header follows the first 5 data records. It<br />
has a count of 10 and is followed by 10 data records.<br />
<br />
The FreeForm ND default naming conventions have been used here so you<br />
could use the following abbreviated command to reformat<br />
<font color='green'>aeromag.dat</font> to a binary file named <font color='green'>aeromag.bin</font>:<br />
<br />
<pre><br />
newform aeromag.dat -o aeromag.bin<br />
</pre><br />
<br />
The ASCII record headers are written into the binary file as ASCII<br />
text.<br />
<br />
===Separate Header Files===<br />
<br />
You may need to describe a data set with external headers. An external or separate header file can contain only headers-one file header or multiple record headers.<br />
<br />
====Separate File Header====<br />
<br />
<br />
<br />
Suppose you want the file header used to store the minimum and maximum<br />
values for latitude and longitude (from the llmaxmin example) in a<br />
separate file so that the data file is homogenous, thus easier for<br />
applications to read. Instead of one ASCII file (<font color='green'>llmaxmin.dat</font>),<br />
you will have an ASCII header file, say it is named <font color='green'>llmxmn.hdr</font>,<br />
and an ASCII data file-call it <font color='green'>llmxmn.dat</font>.<br />
<br />
Here is <font color='green'>llmxmn.hdr</font>:<br />
<br />
<pre><br />
Latitude and Longitude: -83.223548 54.118314 -176.161101 149.408117<br />
</pre><br />
<br />
<br />
And here is <font color='green'>llmxmn.dat</font>:<br />
<br />
<pre><br />
-47.303545 -176.161101<br />
-25.928001 0.777265<br />
-28.286662 35.591879<br />
<br />
12.588231 149.408117<br />
-83.223548 55.319598<br />
<br />
54.118314 -136.940570<br />
<br />
38.818812 91.411330<br />
-34.577065 30.172129<br />
<br />
27.331551 -155.233735<br />
<br />
11.624981 -113.660611<br />
</pre><br />
<br />
You will need to make one change to <font color='green'>llmaxmin.fmt</font>, adding the<br />
qualifier separate to the header descriptor, so that FreeForm ND will<br />
look for the header in a separate file. The first line of<br />
<font color='green'>llmaxmin.fmt</font> becomes:<br />
<br />
<pre><br />
ASCII_file_header_separate "Latitude/Longitude Limits"<br />
</pre><br />
<br />
Save <font color='green'>llmaxmin.fmt</font> as <font color='green'>llmxmn.fmt</font> after you make the change.<br />
<br />
To convert the data in <font color='green'>llmxmn.dat</font> to binary format in<br />
<font color='green'>llmxmn.bin</font>, use the following command:<br />
<br />
<pre><br />
newform llmxmn.dat -o llmxmn.bin<br />
</pre><br />
<br />
<blockquote>When you run <font color='green'>newform</font>, it will write the separate header to<br />
<br />
<font color='green'>llmxmn.bin</font> along with the data in <font color='green'>llmxmn.dat</font>. }<br />
<br />
====Separate Record Headers====<br />
<br />
<br />
<br />
Record headers in separate files can act as indexes into data files if<br />
the headers specify the positions of the data in the data file. For<br />
example, if you have a file containing data from 25 observation<br />
stations, you could effectively index the file by including a station<br />
ID and the starting position of the data for that station in each<br />
record header. Then you could use the index to quickly locate the data<br />
for a particular station.<br />
<br />
Returning to the <font color='green'>aeromag</font> example, suppose you want to place the<br />
two record headers in a separate file. Again, the only change you need<br />
to make to the format description file (<font color='green'>aeromag.fmt</font>) is to add<br />
the qualifier separate to the header descriptor. The first line would<br />
then be:<br />
<br />
<pre><br />
ASCII_record_header_separate "Aeromagnetic Record Header Format"<br />
</pre><br />
<br />
The separate header file would contain the following two lines:<br />
<br />
<pre><br />
420 5 5272 178 2 413669. 6669740. 333345. 6751355.<br />
411 10 8366 178 2 332640. 6749449. 412501. 6668591.<br />
</pre><br />
<br />
The data file would look like the current <font color='green'>aeromag.dat</font> with the<br />
first and seventh lines removed.<br />
<br />
Assuming the data file is named <font color='green'>aeromag.dat</font>, the default name<br />
and location of the header file would be <font color='green'>aeromag.hdr</font> in the same<br />
directory as the data file. Otherwise, the separate header file name<br />
and location need to be defined in an equivalence table. (For<br />
information about equivalence tables, see the GeoVu Tools Reference<br />
Guide.)<br />
<br />
===The dBASEfile Format===<br />
<br />
<br />
Headers and data records in dBASE format are represented in ASCII but<br />
are not separated by end-of-line characters. They can be difficult to<br />
read or to use in applications that expect newlines to separate<br />
records. By using <font color='green'>newform</font>, dBASE data can be reformatted to<br />
include end-of-line characters.<br />
<br />
In this example, you will reformat the dBASE data file<br />
<font color='green'>oceantmp.dab</font> (see below) into the ASCII data file<br />
<font color='green'>oceantmp.dat</font>. The input file <font color='green'>oceantmp.dab</font> contains a<br />
record header at the beginning of each line. The header is followed by<br />
data on the same line. When you convert the file to ASCII, the header<br />
will be on one line followed by the data on the number of lines<br />
specified by the variable count. The format description file<br />
<font color='green'>oceantmp.fmt</font> is used for this reformatting.<br />
<br />
Here is <font color='green'>oceantmp.fmt</font>:<br />
<br />
<pre><br />
dbase_record_header "NODC-01 record header format"<br />
WMO_quad 1 1 char 0<br />
latitude_deg_abs 2 3 uchar 0<br />
latitude_min 4 5 uchar 0<br />
longitude_deg_abs 6 8 uchar 0<br />
longitude_min 9 10 uchar 0<br />
date_yymmdd 11 16 long 0<br />
hours 17 19 uchar 1<br />
country_code 20 21 char 0<br />
vessel 22 23 char 0<br />
count 24 26 short 0<br />
data_type_code 27 27 char 0<br />
cruise 28 32 long 0<br />
station 33 36 short 0<br />
<br />
dbase_data "IBT input format"<br />
depth_m 1 4 short 0<br />
temperature 5 8 short 2<br />
<br />
RETURN "NEW LINE INDICATOR"<br />
<br />
ASCII_data "ASCII output format"<br />
depth_m 1 5 short 0<br />
temperature 27 31 float 2<br />
</pre><br />
<br />
<br />
This format description file contains a header format description, a<br />
description for dBASE input data, the special RETURN descriptor, and a<br />
description for ASCII output data. The variable \var{count} (fourth<br />
from the bottom in the header format description) indicates the number<br />
of data records that follow each header. The descriptor RETURN lets<br />
<font color='green'>newform</font> skip over the end-of-line marker at the end of each data<br />
block in the input file <font color='green'>oceantmp.dab</font> as it is meaningless to<br />
<font color='green'>newform</font> here. Because the end-of-line marker appears at the end<br />
of the data records in each input data block, RETURN is placed after<br />
the input data format description in the format description file.<br />
<br />
<font color='green'>oceantmp.dab</font>:<br />
<br />
<pre><br />
<br />
1 2 3 4 5 6 7<br />
1234567890123456789012345678901234567890123456789012345678901234567890<br />
11000171108603131109998 4686021000000002767001027670020276700302767<br />
110011751986072005690AM 4686091000000002928001028780020287200302872<br />
11111176458102121909998 4681011000000002728009126890241110005000728<br />
112281795780051918090PI 268101100000000268900402711<br />
</pre><br />
<br />
Each dBASE header in <font color='green'>oceantmp.dab</font> is located from position 1 to<br />
36. It is followed by four data records of 8 bytes each. Each record<br />
comprises a depth and temperature reading. The variable count in the<br />
header (positions 24-26) indicates that there are 4 data records each<br />
in the first 3 lines and 2 on the last line. This will all be more<br />
obvious after conversion.<br />
<br />
To reformat <font color='green'>oceantmp.dab</font> to ASCII, use the following command:<br />
<br />
<pre><br />
newform oceantmp.dab -o oceantmp.dat<br />
</pre><br />
<br />
The resulting file <font color='green'>oceantmp.dat</font> is much easier to read. It is<br />
readily apparent that there are 4 data records after the first three<br />
headers and 2 after the last.<br />
<br />
Here is <font color='green'>oceantmp.dat</font>:<br />
<br />
<pre><br />
<br />
1 2 3 4<br />
1234567890123456789012345678901234567890<br />
11000171108603131109998 46860210000<br />
<br />
0 27.67<br />
<br />
10 27.67<br />
<br />
20 27.67<br />
<br />
30 27.67<br />
110011751986072005690AM 46860910000<br />
<br />
0 29.28<br />
<br />
10 28.78<br />
<br />
20 28.72<br />
<br />
30 28.72<br />
11111176458102121909998 46810110000<br />
<br />
0 27.28<br />
<br />
91 26.89<br />
<br />
241 11.00<br />
<br />
500 07.28<br />
112281795780051918090PI 26810110000<br />
<br />
0 26.89<br />
<br />
40 27.11<br />
</pre></div>Yuan