Re: open binary file

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Thu Aug 30 2012 - 09:54:02 MDT

Yiqi,

1. If you have a choice, it would be much better to write Netcdf
format from IDL, not binary. Netcdf format adds variable names,
dimensions, and data type info to the raw data. IDL has easy Netcdf
functions, and NCL understands Netcdf very easily.

2. If you are required to use binary, then use the fbindirread
function, not fbinrecread. This is because your IDL program does not
specify /F77_UNFORMATTED in the OPENW statement. Your binary file is
stream formatted, not record formatted.

--Dave

On Wed, Aug 29, 2012 at 6:06 PM, Yiqi Zheng <zhengyiqi1989@gmail.com> wrote:
> Dear all,
>
> I have a problem of opening a binary file. Attached is a binary_write.pro
> program (written in IDL) shows how the files were constructed. I use the
> following command, but problems always occur.
>
> head1 = fbinrecread( FileName, 0, 3, "long" )
> data1 = fbinrecread( FileName, 1, -1, "float" )
>
> I thought the problem might be, I could not make sure the data type from the
> binary_write.pro. But is there any solutions when data type is not clear? Or
> is there anything else incorrect?
>
> Thank you very much!
>
> Best wishes,
> Yiqi
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Aug 30 09:54:25 2012

This archive was generated by hypermail 2.1.8 : Tue Sep 11 2012 - 15:30:42 MDT