[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 19991103: ncdump differences in output



Matthew,

> From: "Matthew J. Bunkers" <address@hidden> 
> Organization: .
> Keywords: 199910291801.MAA16406

In the above message, you wrote:

> Hello.  I work at the NWS in Rapid City, SD and was working with the
> ncdump command on our AWIPS system.  In particular, I was looking at
> the contents of our netCDF satellite images.  The values ranged from
> the -100s to the +100s.  However, when I took the same files down to
> the School of Mines computer lab, the results from the ncdump command
> were different.  They were all positive and different by 256 (bits,
> I assume).  For example, a -112 pixel val ue at the NWS became a 144
> pixel value at the school.  What is going on here?
>
> Thank you.
>
> Matt Bunkers, NWS Rapid City, SD

The netCDF package makes no assumptions about the "signedness" of 8-bit
"NC_BYTE" variables: the bits are copied without modification between
NC_BYTE variables and the host system's "char" data type.  On some
systems a "char" is signed; on others it is unsigned.  Thus, on some
systems an NC_BYTE value will print as 144 while on other systems that
same value will print as -112.  It is up to the application program to
assign meaning the the bit patterns because that is beyond the purview
of the netCDF package.

--------
Steve Emmerson   <http://www.unidata.ucar.edu>