[Thread Prev][Thread Next][Index]
Re: Reading 1-byte binary data (type=i1)
Hi,
I'm posting Steve's solution to convert signed
to unsigned 1-byte values so that it can be found
in email-archives.
The trick is as simple as:
yes? LET unsigned_sst = IF sst LT 0 THEN 256+sst ELSE sst
========
"Paulo B. Oliveira" wrote:
> Hi all,
>
> I'm trying to read binary SST data files derived from satellite data.
> Each gridpoint (pixel) is stored as 8bit unsigned char (range: [0,255]).
>
> Reading the file with:
>
> file/var=sst/format=stream/type=i1 datafile
>
> variable SST is in the range [-127,127].
>
> Is there a way to force ferret to interpret each byte as unsigned ?
>
> Regards,
>
> Paulo.
--
Steve Hankin
NOAA/PMEL, 7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080 -- FAX (206) 526-6744
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement