[ncl-talk] reading binary files

David Brown dbrown at ucar.edu
Mon Dec 15 16:17:44 MST 2014


Hi Debasish,

This file may contain similar information compared to the file you
sent previously, but it is formatted quite differently and therefore
you need to program the script to read it differently. There is
nothing wrong with NCL 6.2.1's behavior with respect to this file. If
you read the document that you sent along with your code it gives you
the information you need to know: the file is "little-endian"; it has
two fields, the first is float data with the missing values set to
-9999.0, the second is an integer. Since you can only read data of a
single type using NCL's binary input routines, you need to read the
data twice; first as a float, and second as an integer. In the first
case you should keep only the first half of the data and in the second
only the second half.

I am attaching a a modified version of your script that reads this
data as specified above, along with a png file that shows both these
fields plotted.
 -dave


On Fri, Dec 12, 2014 at 2:40 PM, Debasish Hazra
<debasish.hazra5 at gmail.com> wrote:
> Once again, strange problem encountered with reading binary in NCL (6.21). A
> week back, David Brown (@ncl)  helped with a script that read a particular
> binary  file. However, After modifying a little, I could read similar
> dataset (npp_aot550_edr_gridded_0.25_20130727.high.bin) with NCL, but looks
> like something is going wrong either with griddng or colorbar. Colorbar
> should be between  0 to 1, but it seems to be over 3 at some unusual places.
> Data has been uploaded in ftp and a trial script, data read help has been
> attached.
>
>  Any help is appreciated.
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: virsaot.ncl
Type: application/octet-stream
Size: 5033 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141215/a2dbb8d0/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test_Aot.png
Type: image/png
Size: 258941 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141215/a2dbb8d0/attachment-0001.png 


More information about the ncl-talk mailing list