Re: Reading in binary file using fbindirread

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri Jul 09 2010 - 08:34:52 MDT

Try

data = = fbindirread ("path/file",0,(nlat,nlon/), "byte")
----------------------------------------------------------
You used "integer":

one integer is 4 bytes; 721*721=519841; 519841/4=129960.25
----------------------------------------------------------

Does not the NSIDC provide a netCDF or HDF file with the
appropriate lat/lon coordinates for the 721x721 and 361x361 grids?

If not, I placed 'my' EASE 721x721 lat lon coordinate file.
Hopefully, it is correct.

ftp ftp.cgd.ucar.edu
anonymous
email
cd pub/shea/EASE
get EaseLatLon.nc
quit

On 7/9/10 7:13 AM, Gina Henderson wrote:
> Hi there,
>
> I am trying to read in a binary file but am not sure what exactly I am
> getting. My data is described as being in the format: "flat binary file
> of array size 721x721 in 1-byte unsigned integers". The dataset's
> resolution is 25 km NH.
>
> I got fbindirread to run using the following:
>
> data = = fbindirread ("path/file",0, -1, "integer")
>
> and the variable summary was as follows:
>
> Variable: snow
> Type: integer
> Total Size: 519840 bytes
> 129960 values
> Number of Dimensions: 1
> Dimensions and sizes: [129960]
> Coordinates:
>
> I am unclear on why the dimensions and sizes do not reflect the array
> size and how to go about reading this in as a 2D array rather than one
> long record. I tried running fbindirread using the options:
> fbindirread("path/file",0,(/nlat,nlon/),"integer") where nlat and nlon =
> 721 but this did not match the record size which is not surprising based
> on the printVarSummary info above.
>
> Any suggestions on how to read this data and assign coordinates would be
> greatly appreciated.
> Thanks, Gina.
>
>
>
>
> _______________________________________________
> 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 Fri Jul 9 08:34:58 2010

This archive was generated by hypermail 2.1.8 : Fri Jul 09 2010 - 16:06:21 MDT