[ncl-talk] reading binary data

Debasish Hazra debasish.hazra5 at gmail.com
Wed May 11 09:52:23 MDT 2016


Thanks Dennis. But it still does no produce any figures. I have attached
the script of ncl. Found the following instruction of how to read that in
iDL :

   res = 1.0                 ; 1.0 degree spatial resolution
   nlon = ROUND(360./res)    ; number of columns (-180,180)
   nlat = ROUND(180./res)    ; number of rows    (-90, 90)
   lonFirst = -180+0.5*res   ; west boundary (first column)
   latFirst = -90+0.5*res    ; south boundary (first row)

   dailyGriddedAod550 = FLTARR(nlon, nlat)

   date = '2015161'   ; string in YYYYDDD format

   fileName = date+'_highQc_aot550_eps.dat'
   OPENR, lun, /GET_LUN, fileName
   READU, lun, dailyGriddedAod550
   CLOSE, lun
   FREE_LUN, lun

Thanks.
Debasish

On Tue, May 10, 2016 at 4:21 PM, Dennis Shea <shea at ucar.edu> wrote:

> Did you look at the size of your file??
>
> 259200  2015161_highQc_aot550_eps.dat
> ^^^^^^^
>
> float or integer are 4 bytes
>
> 4*180*360 = 259200     so **one** float or integer variable
>
> You are using
>
>    setfileoption("bin","readbyteorder","littleendian")
>
>    var1 =
> cbinread("./EPS_HQ/2015161_highQc_aot550_eps.dat",(/2,180,360/),"float")
>    var2 =
> cbinread("./EPS_HQ/2015161_highQc_aot550_eps.dat",(/2,180,360/),"integer")
>
> For two integer or float variables the size should be:  259200 + 259200 =
> 518400
>
> At the very least, you should have been getting an NCL error message about
> wrong size.
>
>
>
>
>
>
>
>
>
> On Tue, May 10, 2016 at 12:32 PM, Debasish Hazra <
> debasish.hazra5 at gmail.com> wrote:
>
>> Hi,
>>
>> I am trying to read binary data with ncl (v6.3) but not sure whether it
>> is reading it right. Also, it does not produce any plots. Attached are the
>> script presently working on and sample data. Any help on this is well
>> appreciated.
>>
>> Thanks.
>> Debasish.
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160511/143ab760/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_script2.ncl
Type: application/octet-stream
Size: 2512 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160511/143ab760/attachment.obj 


More information about the ncl-talk mailing list