<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2002-2-1 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>4.4.10 Binary table i/o: The -b option</TITLE> <META NAME="description" CONTENT="4.4.10 Binary table i/o: The -b option"> <META NAME="keywords" CONTENT="GMT_Docs"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="GMT_Docs.css"> <LINK REL="next" HREF="node53.html"> <LINK REL="previous" HREF="node51.html"> <LINK REL="up" HREF="node37.html"> <LINK REL="next" HREF="node53.html"> </HEAD> <BODY bgcolor="#ffffff"> <!--Navigation Panel--> <A NAME="tex2html3290" HREF="node53.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html3284" HREF="node37.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html3278" HREF="node51.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html3286" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html3288" HREF="node256.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html3291" HREF="node53.html">4.4.11 Number of Copies:</A> <B> Up:</B> <A NAME="tex2html3285" HREF="node37.html">4.4 Standardized command line</A> <B> Previous:</B> <A NAME="tex2html3279" HREF="node51.html">4.4.9 Plot positioning and</A> <B> <A NAME="tex2html3287" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html3289" HREF="node256.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION0012410000000000000000"></A> <A NAME="17870"></A> <A NAME="17871"></A> <A NAME="17872"></A> <A NAME="17873"></A> <BR> 4.4.10 Binary table i/o: The <B>-b</B> option </H2> <A NAME="18690"></A> <A NAME="18691"></A> <A NAME="18692"></A> <A NAME="18693"></A> <P> All <A NAME="tex2html1139" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> programs that accept table data input may read ASCII, native binary, or netCDF data. When using native binary data the user must be aware of the fact that <A NAME="tex2html1140" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> has no way of determining the actual number of columns in the file. You must therefore pass that information to <A NAME="tex2html1141" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> via the binary <B>-bi</B>[<B>s</B>]<I>n</I> option, where <I>n</I> is the actual number of data columns (<B>s</B> indicates single (4 bytes) rather than double (8 bytes) precision). If uppercase <B>S</B> (or <B>D</B>) are used it implies that byte-swapping should be performed just prior to writing (for output) or immediately after reading (for input). Note that <I>n</I> may be larger than <I>m</I>, the number of columns that the <A NAME="tex2html1142" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> program requires to do its task. If <I>n</I> is not given then it defaults to <I>m</I>. If <I>n</I> <IMG WIDTH="16" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img12.png" ALT="$<$"> <I>m</I> an error is generated. <P> Because of its meta data, reading netCDF tables (i.e. netCDF files containing 1-dimensional arrays) is quite a bit less complex than reading native binary files. When feeding netCDF tables to programs like <A NAME="tex2html1143" HREF="../man/psxy.html"><I><B>psxy</B></I></A><A NAME="19203"></A>, the program will automatically recognize the format and read whatever amount of columns are needed for that program. To steer which columns are to be read, the user can either append the suffix <B>?</B><I>var1</I><B>/</B><I>var2</I><B>/</B><I>...</I> to the netCDF file name or add the option <B>-bic</B><I>var1</I><B>/</B><I>var2</I><B>/</B><I>...</I>, where <I>var1</I>, <I>var2</I>, etc. are the names of the variables to be processed. The latter option is particularly practical when more than one file is read: the <B>-bic</B> option will apply to all files. <P> Currently, netCDF tables can only be input, not output. For more information, see Appendix <A HREF="node173.html#app:B">B</A>. <P> <HR> <!--Navigation Panel--> <A NAME="tex2html3290" HREF="node53.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html3284" HREF="node37.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html3278" HREF="node51.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html3286" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html3288" HREF="node256.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html3291" HREF="node53.html">4.4.11 Number of Copies:</A> <B> Up:</B> <A NAME="tex2html3285" HREF="node37.html">4.4 Standardized command line</A> <B> Previous:</B> <A NAME="tex2html3279" HREF="node51.html">4.4.9 Plot positioning and</A> <B> <A NAME="tex2html3287" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html3289" HREF="node256.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> Paul Wessel 2010-07-14 </ADDRESS> </BODY> </HTML>