Re: reading in binary data

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Thu Oct 27 2011 - 13:27:47 MDT

Not really. Both C and Fortran can be made to write identical
binary formats, with various degrees of effort, depending on the
complexity of the format details.

If you can get either the code or documentation for write_geogrid.c,
that should help a lot to understand your file.

--Dave

On 10/27/2011 12:42 PM, Joe Grim wrote:
> It turns out that the binary file was written out by a C program
> (write_geogrid.c). I assume this makes a difference.
>
> Joe
>
> On 10/27/2011 12:08 PM, Dennis Shea wrote:
>> What is the size of the file in bytes?
>>
>> %> ls -l file_name
>>
>> Is it 1200*1200*2 or 1200*1200*4 ?
>>
>> Or are there 'extra' bytes?
>>
>> ===
>> The defuult in fortran is to write 'sequentail' mode
>> which *silently* prepend and postpends extra bytes.
>>
>>
>> On 10/27/11 12:00 PM, Joe Grim wrote:
>>> Hi,
>>>
>>> I've been trying to read in some FORTRAN-formatted binary data using
>>> fbindirread, but have been unsuccessful thus far. The data is described
>>> by the following:
>>>
>>> type = continuous
>>> signed = yes
>>> projection = regular_ll
>>> dx = 0.00833333
>>> dy = 0.00833333
>>> known_x = 1.0
>>> known_y = 1.0
>>> known_lat = -89.99583
>>> known_lon = -179.99583
>>> wordsize = 2
>>> tile_x = 1200
>>> tile_y = 1200
>>> tile_z = 1
>>> tile_bdr=3
>>> units="meters MSL"
>>> description="Topography height"
>>>
>>> I understand most of this (e.g., the data is 1200x1200, each data point
>>> requires 2 bytes, the value can be positive or negative), but when I try
>>> to read in the data using fbindirread, I can't find a single way that
>>> works:
>>> e.g., HGT_M = fbindirread(geog_data_path+filename,0,-1,"short")
>>>
>>> If someone knows how this works, would you please help me out? I really
>>> appreciate it!
>>>
>>> Joe Grim
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Oct 27 13:27:57 2011

This archive was generated by hypermail 2.1.8 : Fri Oct 28 2011 - 10:52:03 MDT