Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 5764c67416561ab82b35afcf9c650e17 > files > 746

GMT-doc-4.5.2-1.fc13.noarch.rpm

<!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.19 The NaN data value</TITLE>
<META NAME="description" CONTENT="4.19 The NaN data value">
<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="node74.html">
<LINK REL="previous" HREF="node72.html">
<LINK REL="up" HREF="node30.html">
<LINK REL="next" HREF="node74.html">
</HEAD>

<BODY  bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html3548"
  HREF="node74.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html3542"
  HREF="node30.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html3536"
  HREF="node72.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html3544"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html3546"
  HREF="node255.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html3549"
  HREF="node74.html">4.20 GMT environment parameters</A>
<B> Up:</B> <A NAME="tex2html3543"
  HREF="node30.html">4. General features</A>
<B> Previous:</B> <A NAME="tex2html3537"
  HREF="node72.html">4.18 Options for COARDS-compliant</A>
 &nbsp; <B>  <A NAME="tex2html3545"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html3547"
  HREF="node255.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION0012190000000000000000"></A>
<A NAME="18012"></A>
<A NAME="18013"></A>
<BR>
4.19 The NaN data value
</H1>

<P>
For a variety of data processing and plotting tasks there is a need to acknowledge that
a data point is missing or unassigned.  In the ``old days'' such information was passed
by letting a value like -9999.99 take on the special meaning of ``this is not really a
value, it is missing''.  The problem with this scheme is that -9999.99 (or any other
floating point value) may be a perfectly reasonable data value and in such a scenario
would be skipped.  The solution adopted in <A NAME="tex2html1198"
  HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> is to use the IEEE concept Not-a-Number
(NaN) for this purpose.  Mathematically, a NaN is what you get if you do an undefined
mathematical operation like <IMG
 WIDTH="28" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
 SRC="img84.png"
 ALT="$0/0$">; in ASCII data files they appear as the textstring NaN.
This value is internally stored with a particular bit pattern
defined by IEEE so that special action can be taken when it is encountered by programs.
In particular, a library function called <TT>isnan</TT> is used to test if a floating point
is a NaN.  <A NAME="tex2html1199"
  HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> uses these tests extensively to determine if a value is suitable for plotting
or processing (if a NaN is used in a calculation the result would become NaN as well).  Data points
whose values equal NaN are not normally plotted (or plotted with the special NaN color given in
<U>.gmtdefaults4</U>).  Several tools such as <A NAME="tex2html1200"
  HREF="../man/xyz2grd.html"><I><B>xyz2grd</B></I></A><A NAME="19043"></A>, <A NAME="tex2html1201"
  HREF="../man/gmtmath.html"><I><B>gmtmath</B></I></A><A NAME="19048"></A>, and
<A NAME="tex2html1202"
  HREF="../man/grdmath.html"><I><B>grdmath</B></I></A><A NAME="19053"></A> can convert user data to NaN and vice versa, thus facilitating arbitrary
masking and clipping of data sets.  Note that a few computers do not have native IEEE hardware
support.  At this point, this applies to some of the older Cray super-computers.  Users on such
machines may have to adopt the old `-9999.99'' scheme to achieve the desired results.

<P>
Data records that contain NaN values for the <I>x</I> or <I>y</I> columns (or the <I>z</I> column
for cases when 3-D Cartesian data are expected) are usually skipped during reading.  However,
the presence of these bad records can be interpreted in two different ways, and this behavior
is controlled by the <B>NAN_RECORDS</B> defaults parameter.  The default setting (<I>gap</I>)
considers such records to indicate a gap in an otherwise continuous series of points (e.g., a line),
and programs can act upon this information, e.g., not to draw a line across the gap or to break the line
into separate segments.  The alternative setting (<I>bad</I>) makes no such interpretation and
simply reports back how many bad records were skipped during reading.

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html3548"
  HREF="node74.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html3542"
  HREF="node30.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html3536"
  HREF="node72.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html3544"
  HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html3546"
  HREF="node255.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html3549"
  HREF="node74.html">4.20 GMT environment parameters</A>
<B> Up:</B> <A NAME="tex2html3543"
  HREF="node30.html">4. General features</A>
<B> Previous:</B> <A NAME="tex2html3537"
  HREF="node72.html">4.18 Options for COARDS-compliant</A>
 &nbsp; <B>  <A NAME="tex2html3545"
  HREF="node1.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html3547"
  HREF="node255.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2010-01-14
</ADDRESS>
</BODY>
</HTML>